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>
This commit is contained in:
Alexandr Shadchin 2011-10-04 00:45:09 +06:00
parent 05b41e2dc6
commit 93a3a28f2c

View File

@ -435,7 +435,6 @@ xf86DisableIO()
#define vuip volatile unsigned int * #define vuip volatile unsigned int *
static unsigned long msb_set = 0;
static pointer memSBase = 0; static pointer memSBase = 0;
static pointer memBase = 0; static pointer memBase = 0;
@ -473,29 +472,25 @@ writeSparse32(int Value, pointer Base, register unsigned long Offset);
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
extern int sysarch(int, void *); extern int sysarch(int, void *);
#endif
struct parms { struct parms {
u_int64_t hae; u_int64_t hae;
}; };
#ifndef __NetBSD__ static void
static int
sethae(u_int64_t hae) sethae(u_int64_t hae)
{ {
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef ALPHA_SETHAE #ifndef ALPHA_SETHAE
#define ALPHA_SETHAE 0 #define ALPHA_SETHAE 0
#endif #endif
struct parms p; static struct parms p;
p.hae = hae;
return (sysarch(ALPHA_SETHAE, (char *)&p)); if (p.hae != hae) {
#endif p.hae = hae;
#ifdef __OpenBSD__ sysarch(ALPHA_SETHAE, (char *)&p);
return -1; }
#endif
} }
#endif /* __NetBSD__ */ #endif
static pointer static pointer
mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags) 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)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask; msb = Offset & hae_mask;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
result = *(vuip) ((unsigned long)memSBase + (Offset << 5)); result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
result >>= shift; result >>= shift;
@ -574,12 +566,9 @@ readSparse16(pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask; msb = Offset & hae_mask;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))); result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
result >>= shift; result >>= shift;
@ -604,12 +593,9 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask; msb = Offset & hae_mask;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
*(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101; *(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)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask; msb = Offset & hae_mask;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
*(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
w * 0x00010001; w * 0x00010001;
@ -655,12 +638,9 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
if (Offset >= (hae_thresh)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask; msb = Offset & hae_mask;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
*(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101; *(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)) { if (Offset >= (hae_thresh)) {
msb = Offset & hae_mask ; msb = Offset & hae_mask ;
Offset -= msb; Offset -= msb;
if (msb_set != msb) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#ifndef __NetBSD__
sethae(msb); sethae(msb);
#endif #endif
msb_set = msb;
}
} }
*(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
w * 0x00010001; w * 0x00010001;