--- xc/programs/Xserver/hw/xfree86/SuperProbe/OS_Linux.c~ Fri Nov 10 21:25:57 2000 +++ xc/programs/Xserver/hw/xfree86/SuperProbe/OS_Linux.c Fri Nov 10 21:26:26 2000 @@ -37,6 +37,9 @@ #include #ifdef __alpha__ + +#include + /* * The Jensen lacks dense memory, thus we have to address the bus via * the sparse addressing scheme. --- xc/programs/Xserver/hw/xfree86/loader/loadmod.c~ Fri Nov 10 21:26:45 2000 +++ xc/programs/Xserver/hw/xfree86/loader/loadmod.c Fri Nov 10 21:27:43 2000 @@ -1001,7 +1001,7 @@ * memory before jumping to that code, you may * do it here. */ -#ifdef __alpha__ +#if defined(__alpha__) && !defined(linux) istream_mem_barrier(); #endif return ret; @@ -1045,7 +1045,7 @@ TestFree (mod->name); TestFree (mod->filename); xfree (mod); -#ifdef __alpha__ +#if defined(__alpha__) && !defined(linux) istream_mem_barrier(); #endif } --- xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c~ Fri Nov 10 21:28:11 2000 +++ xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c Fri Nov 10 21:28:44 2000 @@ -31,6 +31,10 @@ #define LOADER_PRIVATE #include "loader.h" +#if defined(__alpha__) && defined(linux) +# include +#endif + /* XXX beware (or fix it) libc functions called here are the xf86 ones */ #ifdef USE_MODULES --- xc/config/cf/linux.cf~ Fri Nov 17 15:01:38 2000 +++ xc/config/cf/linux.cf Fri Nov 17 15:01:39 2000 @@ -506,7 +506,7 @@ # define OptimizedCDebugFlags DefaultGcc2AxpOpt # define LinuxMachineDefines -D__alpha__ # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET -# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 +# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 -DJENSEN_SUPPORT # ifdef UseCompaqMathLibrary # define MathLibrary -lcpml -lm # endif --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c~ Thu Nov 16 09:25:40 2000 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c Thu Nov 16 09:36:19 2000 @@ -298,7 +298,7 @@ if (isJensen) { # ifndef JENSEN_SUPPORT FatalError("Jensen is not supported any more\n" - "If you are interesetd in fixing Jensen support\n" + "If you are interested in fixing Jensen support\n" "please contact xfree86@xfree86.org\n"); # else xf86Msg(X_INFO,"Machine type is Jensen\n"); @@ -558,14 +558,21 @@ strerror(errno)); } /* This requirers linux-0.99.pl10 or above */ - lnxBase = mmap((caddr_t)0, 0x100000000, + lnxBase = mmap((caddr_t)0, 0x100000000, /* 4GB!! */ PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t) _bus_base()); +#ifdef __alpha__ + lnxSBase = mmap((caddr_t)0, 0x400000000, /* 16GB!! */ + PROT_READ | PROT_WRITE, + MAP_SHARED, fd, + (off_t) _bus_base_sparse()); +#else lnxSBase = mmap((caddr_t)0, 0x100000000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t) _bus_base_sparse()); +#endif close(fd); @@ -590,6 +597,7 @@ Offset += (unsigned long)Base - (unsigned long)lnxBase; shift = (Offset & 0x3) << 3; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000UL; Offset -= msb; @@ -598,6 +606,7 @@ msb_set = msb; } } +#endif result = *(vuip) ((unsigned long)lnxSBase + (Offset << 5)); result >>= shift; @@ -612,6 +621,7 @@ Offset += (unsigned long)Base - (unsigned long)lnxBase; shift = (Offset & 0x2) << 3; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000UL; Offset -= msb; @@ -620,6 +630,7 @@ msb_set = msb; } } +#endif result = *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))); result >>= shift; return 0xffffUL & result; @@ -638,6 +649,7 @@ register unsigned int b = Value & 0xffU; Offset += (unsigned long)Base - (unsigned long)lnxBase; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000; Offset -= msb; @@ -646,6 +658,7 @@ msb_set = msb; } } +#endif *(vuip) ((unsigned long)lnxSBase + (Offset << 5)) = b * 0x01010101; mem_barrier(); } @@ -657,6 +670,7 @@ register unsigned int w = Value & 0xffffU; Offset += (unsigned long)Base - (unsigned long)lnxBase; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000; Offset -= msb; @@ -667,6 +681,9 @@ } *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x00010001; +#else + *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x10001; +#endif mem_barrier(); } @@ -686,6 +703,7 @@ register unsigned int b = Value & 0xffU; Offset += (unsigned long)Base - (unsigned long)lnxBase; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000; Offset -= msb; @@ -694,6 +712,7 @@ msb_set = msb; } } +#endif *(vuip) ((unsigned long)lnxSBase + (Offset << 5)) = b * 0x01010101; } @@ -704,6 +723,7 @@ register unsigned int w = Value & 0xffffU; Offset += (unsigned long)Base - (unsigned long)lnxBase; +#ifndef __alpha__ if (Offset >= (1UL << 24)) { msb = Offset & 0xf8000000; Offset -= msb; @@ -714,6 +734,9 @@ } *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x00010001; +#else + *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x10001; +#endif } static void --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c~ Thu Nov 16 09:11:27 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c Thu Nov 16 09:23:46 2000 @@ -216,11 +216,25 @@ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; +#ifdef __alpha__ + /* map 8K instead of 4K, so PDIO is subsumed */ + pNv->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, + regBase+0x00680000, 0x00002000); +#else pNv->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00680000, 0x00001000); +#endif + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PRAMDAC %x\n", pNv->riva.PRAMDAC)); +#ifdef __alpha__ + /* map 8K instead of 4K, so PDIO is subsumed */ + pNv->riva.PFB = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, + regBase+0x00100000, 0x00002000); +#else pNv->riva.PFB = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00100000, 0x00001000); +#endif + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PFB %x\n", pNv->riva.PFB)); pNv->riva.PFIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00002000, 0x00002000); @@ -228,11 +242,23 @@ pNv->riva.PGRAPH = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00400000, 0x00002000); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PGRAPH %x\n", pNv->riva.PGRAPH)); +#ifdef __alpha__ + /* Done as part of PFB map of 8K (see above) */ + pNv->riva.PEXTDEV = (U032 *)(((U008 *)pNv->riva.PFB) + 0x1000); /* HACK! SPARSE will fail! */ +#else pNv->riva.PEXTDEV = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00101000, 0x00001000); +#endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PEXTDEV %x\n", pNv->riva.PEXTDEV)); +#ifdef __alpha__ + /* Must map 8K or more on Alpha. */ + pNv->riva.PTIMER = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, + regBase+0x00008000, 0x00002000); + pNv->riva.PTIMER = (U032*)(((U008 *)pNv->riva.PTIMER) + 0x1000); +#else pNv->riva.PTIMER = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00009000, 0x00001000); +#endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PTIMER %x\n", pNv->riva.PTIMER)); pNv->riva.PMC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00000000, 0x00001000); @@ -245,12 +271,18 @@ * These registers are read/write as 8 bit values. Probably have to map * sparse on alpha. */ +#ifdef __alpha__ + /* Done as part of PCRTC map of 8K (see below). */ + pNv->riva.PCIO = (U008 *)pNv->riva.PCRTC + 0x1000; /* HACK! SPARSE will fail! */ + pNv->riva.PDIO = (U008 *)pNv->riva.PRAMDAC + 0x1000; /* HACK! SPARSE will fail! */ +#else pNv->riva.PCIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00601000, 0x00001000); pNv->riva.PDIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00681000, 0x00001000); +#endif pNv->riva.PVIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x000C0000, 0x00001000); @@ -307,8 +339,14 @@ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; pNv->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00710000, 0x00010000); +#ifdef __alpha__ + /* map 8K instead of 4K, so PCIO is subsumed. */ + pNv->riva.PCRTC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, + regBase+0x00600000, 0x00002000); +#else pNv->riva.PCRTC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00600000, 0x00001000); +#endif NVCommonSetup(pScrn); } @@ -328,8 +366,14 @@ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; pNv->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00710000, 0x00010000); +#ifdef __alpha__ + /* map 8K instead of 4K, so PCIO is subsumed. */ + pNv->riva.PCRTC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, + regBase+0x00600000, 0x00002000); +#else pNv->riva.PCRTC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag, regBase+0x00600000, 0x00001000); +#endif NVCommonSetup(pScrn); }