summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/bsd/alpha_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/os-support/bsd/alpha_video.c')
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index bab184e7c..aa3313dc3 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.6 2003/12/30 15:18:30 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.5 2003/04/03 16:50:04 dawes Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -117,13 +117,11 @@ has_bwx(void)
#endif
}
#else /* __NetBSD__ */
-static unsigned long hae_thresh = (1UL << 24);
-static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */
static struct alpha_bus_window *abw;
static int abw_count = -1;
static void
-init_abw(void)
+init_abw()
{
if (abw_count < 0) {
abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
@@ -144,7 +142,7 @@ has_bwx(void)
}
static unsigned long
-dense_base(void)
+dense_base()
{
if (abw_count < 0)
init_abw();
@@ -156,7 +154,7 @@ dense_base(void)
}
static unsigned long
-memory_base(void)
+memory_base()
{
if (abw_count < 0)
init_abw();
@@ -286,13 +284,11 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
pVidMem->mapMem = mapVidMemSparse;
pVidMem->unmapMem = unmapVidMemSparse;
-#ifndef __NetBSD__
if (axpSystem == -1)
axpSystem = bsdGetAXP();
hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
hae_mask = xf86AXPParams[axpSystem].hae_mask;
sparse_size = xf86AXPParams[axpSystem].size;
-#endif /* __NetBSD__ */
}
pVidMem->initialised = TRUE;
}
@@ -318,7 +314,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
if (base == MAP_FAILED)
{
- FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n",
+ FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
"xf86MapVidMem", DEV_MEM, Size, Base,
strerror(errno));
}
@@ -328,7 +324,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
/* else, mmap /dev/vga */
if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
{
- FatalError("%s: Address 0x%lx outside allowable range\n",
+ FatalError("%s: Address 0x%x outside allowable range\n",
"xf86MapVidMem", Base);
}
base = mmap(0, Size,
@@ -376,7 +372,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
if ((long)ptr == -1)
{
xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
+ "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
DEV_MEM, Len, Base, Offset, strerror(errno));
return(-1);
}
@@ -494,7 +490,6 @@ struct parms {
u_int64_t hae;
};
-#ifndef __NetBSD__
static int
sethae(u_int64_t hae)
{
@@ -510,7 +505,6 @@ sethae(u_int64_t hae)
return -1;
#endif
}
-#endif /* __NetBSD__ */
static pointer
mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
@@ -559,6 +553,7 @@ readSparse8(pointer Base, register unsigned long Offset)
{
register unsigned long result, shift;
register unsigned long msb;
+
mem_barrier();
Offset += (unsigned long)Base - (unsigned long)memBase;
shift = (Offset & 0x3) << 3;
@@ -566,12 +561,11 @@ readSparse8(pointer Base, register unsigned long Offset)
msb = Offset & hae_mask;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}
+
result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
result >>= shift;
return 0xffUL & result;
@@ -590,9 +584,7 @@ readSparse16(pointer Base, register unsigned long Offset)
msb = Offset & hae_mask;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}
@@ -620,9 +612,7 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset)
msb = Offset & hae_mask;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}
@@ -641,9 +631,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset)
msb = Offset & hae_mask;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}
@@ -671,9 +659,7 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
msb = Offset & hae_mask;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}
@@ -691,9 +677,7 @@ writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
msb = Offset & hae_mask ;
Offset -= msb;
if (msb_set != msb) {
-#ifndef __NetBSD__
sethae(msb);
-#endif
msb_set = msb;
}
}