summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlexandr Shadchin <Alexandr.Shadchin@gmail.com>2011-10-04 00:45:09 +0600
committerAlexandr Shadchin <Alexandr.Shadchin@gmail.com>2011-10-29 02:13:28 +0600
commit93a3a28f2c1e95ea7fae6cf1c2fb50b30eae9c33 (patch)
tree0a68d4d295b6ea7d2384fad532d15b93ecedc8a9 /hw
parent05b41e2dc60a0aefc685a33260e5d8e09580908b (diff)
bsd: alpha_video: Function sethae() need only for FreeBSD
Return value sethae() is becoming void because no caller used it. Also old msb_set static checked by each caller is replaced by the p.hae static checked in sethae() when it's called. Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c51
1 files changed, 14 insertions, 37 deletions
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index c47f7bfc7..1a3736b3b 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -435,7 +435,6 @@ xf86DisableIO()
#define vuip volatile unsigned int *
-static unsigned long msb_set = 0;
static pointer memSBase = 0;
static pointer memBase = 0;
@@ -473,29 +472,25 @@ writeSparse32(int Value, pointer Base, register unsigned long Offset);
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
extern int sysarch(int, void *);
-#endif
struct parms {
u_int64_t hae;
};
-#ifndef __NetBSD__
-static int
+static void
sethae(u_int64_t hae)
{
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef ALPHA_SETHAE
#define ALPHA_SETHAE 0
#endif
- struct parms p;
- p.hae = hae;
- return (sysarch(ALPHA_SETHAE, (char *)&p));
-#endif
-#ifdef __OpenBSD__
- return -1;
-#endif
+ static struct parms p;
+
+ if (p.hae != hae) {
+ p.hae = hae;
+ sysarch(ALPHA_SETHAE, (char *)&p);
+ }
}
-#endif /* __NetBSD__ */
+#endif
static pointer
mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
@@ -550,12 +545,9 @@ readSparse8(pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
result >>= shift;
@@ -574,12 +566,9 @@ readSparse16(pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
result >>= shift;
@@ -604,12 +593,9 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
*(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
}
@@ -625,12 +611,9 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
*(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
w * 0x00010001;
@@ -655,12 +638,9 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
*(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
}
@@ -675,12 +655,9 @@ writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask ;
Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sethae(msb);
#endif
- msb_set = msb;
- }
}
*(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
w * 0x00010001;