diff options
author | Adam Jackson <ajax@redhat.com> | 2008-10-11 23:35:24 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-11-24 23:40:06 -0500 |
commit | c7680befe5aebd0f4277d11ff3984d8a7deb9d5b (patch) | |
tree | 6d9e59337d7441686f7376e8ddeecdb7eccab231 /hw | |
parent | df14682a31b92751091571ed82f6095f55f19cca (diff) |
Remove the remnants of Jensen support
As being an EISA-only machine, and as ISA support is gone now...
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/compiler.h | 13 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_video.c | 189 | ||||
-rw-r--r-- | hw/xfree86/os-support/misc/BUSmemcpy.c | 225 | ||||
-rw-r--r-- | hw/xfree86/os-support/misc/SlowBcopy.c | 66 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/bios_mmap.c | 29 |
5 files changed, 28 insertions, 494 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index f55219b9b..285d9a3f6 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1541,8 +1541,6 @@ extern void (*xf86WriteMmio32)(int, void *, unsigned long); extern void (*xf86WriteMmioNB8)(int, void *, unsigned long); extern void (*xf86WriteMmioNB16)(int, void *, unsigned long); extern void (*xf86WriteMmioNB32)(int, void *, unsigned long); -extern void xf86JensenMemToBus(char *, long, long, int); -extern void xf86JensenBusToMem(char *, char *, unsigned long, int); extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); @@ -1556,20 +1554,13 @@ extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); # define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) # endif -# if defined (JENSEN_SUPPORT) -# define MMIO_OUT32(base, offset, val) \ - (*xf86WriteMmio32)((CARD32)(val), base, offset) -# define MMIO_ONB32(base, offset, val) \ - (*xf86WriteMmioNB32)((CARD32)(val), base, offset) -# else -# define MMIO_OUT32(base, offset, val) \ +# define MMIO_OUT32(base, offset, val) \ do { \ write_mem_barrier(); \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ } while (0) -# define MMIO_ONB32(base, offset, val) \ +# define MMIO_ONB32(base, offset, val) \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) -# endif # define MMIO_OUT8(base, offset, val) \ (*xf86WriteMmio8)((CARD8)(val), base, offset) diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 4c64fa447..aa62514df 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -77,8 +77,6 @@ extern int iopl(int __level); extern void sethae(unsigned long hae); -# define isJensen (axpSystem == JENSEN) - # define BUS_BASE bus_base #else @@ -97,10 +95,6 @@ static void unmapVidMem(int, pointer, unsigned long); static pointer mapVidMemSparse(int, unsigned long, unsigned long, int); extern axpDevice lnxGetAXP(void); static void unmapVidMemSparse(int, pointer, unsigned long); -# if defined(JENSEN_SUPPORT) -static pointer mapVidMemJensen(int, unsigned long, unsigned long, int); -static void unmapVidMemJensen(int, pointer, unsigned long); -# endif static axpDevice axpSystem = -1; static Bool needSparse; static unsigned long hae_thresh; @@ -388,17 +382,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) } bus_base = _bus_base(); } - if (isJensen) { -# ifndef JENSEN_SUPPORT - FatalError("Jensen is not supported any more\n" - "If you are intereseted in fixing Jensen support\n" - "please contact xorg@lists.freedesktop.org\n"); -# else - xf86Msg(X_INFO,"Machine type is Jensen\n"); - pVidMem->mapMem = mapVidMemJensen; - pVidMem->unmapMem = unmapVidMemJensen; -# endif /* JENSEN_SUPPORT */ - } else if (needSparse) { + if (needSparse) { xf86Msg(X_INFO,"Machine needs sparse mapping\n"); pVidMem->mapMem = mapVidMemSparse; pVidMem->unmapMem = unmapVidMemSparse; @@ -922,175 +906,4 @@ _X_EXPORT int (*xf86ReadMmio16)(pointer Base, unsigned long Offset) _X_EXPORT int (*xf86ReadMmio32)(pointer Base, unsigned long Offset) = readDense32; -#ifdef JENSEN_SUPPORT - -static int -readSparseJensen8(pointer Base, register unsigned long Offset); -static int -readSparseJensen16(pointer Base, register unsigned long Offset); -static int -readSparseJensen32(pointer Base, register unsigned long Offset); -static void -writeSparseJensen8(int Value, pointer Base, register unsigned long Offset); -static void -writeSparseJensen16(int Value, pointer Base, register unsigned long Offset); -static void -writeSparseJensen32(int Value, pointer Base, register unsigned long Offset); -static void -writeSparseJensenNB8(int Value, pointer Base, register unsigned long Offset); -static void -writeSparseJensenNB16(int Value, pointer Base, register unsigned long Offset); -static void -writeSparseJensenNB32(int Value, pointer Base, register unsigned long Offset); - -/* - * The Jensen lacks dense memory, thus we have to address the bus via - * the sparse addressing scheme. - * - * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996 - */ - -#ifdef TEST_JENSEN_CODE -#define SPARSE (5) -#else -#define SPARSE (7) -#endif - -#define JENSEN_SHIFT(x) ((long)x<<SPARSE) - -static pointer -mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - pointer base; - int fd, prot; - - xf86WriteMmio8 = writeSparseJensen8; - xf86WriteMmio16 = writeSparseJensen16; - xf86WriteMmio32 = writeSparseJensen32; - xf86WriteMmioNB8 = writeSparseJensenNB8; - xf86WriteMmioNB16 = writeSparseJensenNB16; - xf86WriteMmioNB32 = writeSparseJensenNB32; - xf86ReadMmio8 = readSparseJensen8; - xf86ReadMmio16 = readSparseJensen16; - xf86ReadMmio32 = readSparseJensen32; - - fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); - if (fd < 0) { - FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", - strerror(errno)); - } - - if (flags & VIDMEM_READONLY) - prot = PROT_READ; - else - prot = PROT_READ | PROT_WRITE; - - /* This requires linux-0.99.pl10 or above */ - base = mmap((caddr_t)0, JENSEN_SHIFT(Size), - prot, MAP_SHARED, fd, - (off_t)(JENSEN_SHIFT((off_t)Base) + _bus_base_sparse())); - close(fd); - if (base == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap framebuffer" - " (0x%08x,0x%x) (%s)\n", Base, Size, - strerror(errno)); - } - return base; -} - -static void -unmapVidMemJensen(int ScreenNum, pointer Base, unsigned long Size) -{ - munmap((caddr_t)Base, JENSEN_SHIFT(Size)); -} - -static int -readSparseJensen8(pointer Base, register unsigned long Offset) -{ - register unsigned long result, shift; - - mem_barrier(); - shift = (Offset & 0x3) << 3; - - result = *(vuip) ((unsigned long)Base + (Offset << SPARSE)); - - result >>= shift; - return 0xffUL & result; -} - -static int -readSparseJensen16(pointer Base, register unsigned long Offset) -{ - register unsigned long result, shift; - - mem_barrier(); - shift = (Offset & 0x2) << 3; - - result = *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2))); - - result >>= shift; - return 0xffffUL & result; -} - -static int -readSparseJensen32(pointer Base, register unsigned long Offset) -{ - register unsigned long result; - - mem_barrier(); - result = *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2))); - - return result; -} - -static void -writeSparseJensen8(int Value, pointer Base, register unsigned long Offset) -{ - register unsigned int b = Value & 0xffU; - - write_mem_barrier(); - *(vuip) ((unsigned long)Base + (Offset << SPARSE)) = b * 0x01010101; -} - -static void -writeSparseJensen16(int Value, pointer Base, register unsigned long Offset) -{ - register unsigned int w = Value & 0xffffU; - - write_mem_barrier(); - *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2))) = - w * 0x00010001; -} - -static void -writeSparseJensen32(int Value, pointer Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2))) = Value; -} - -static void -writeSparseJensenNB8(int Value, pointer Base, register unsigned long Offset) -{ - register unsigned int b = Value & 0xffU; - - *(vuip) ((unsigned long)Base + (Offset << SPARSE)) = b * 0x01010101; -} - -static void -writeSparseJensenNB16(int Value, pointer Base, register unsigned long Offset) -{ - register unsigned int w = Value & 0xffffU; - - *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2))) = - w * 0x00010001; -} - -static void -writeSparseJensenNB32(int Value, pointer Base, register unsigned long Offset) -{ - *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2))) = Value; -} -#endif /* JENSEN_SUPPORT */ - #endif /* __alpha__ */ diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.c b/hw/xfree86/os-support/misc/BUSmemcpy.c index b482b867a..0500bf6c1 100644 --- a/hw/xfree86/os-support/misc/BUSmemcpy.c +++ b/hw/xfree86/os-support/misc/BUSmemcpy.c @@ -26,233 +26,8 @@ Thanks to Linus Torvalds for contributing this code. #include "compiler.h" -/* - * The Jensen lacks dense memory, thus we have to address the bus via - * the sparse addressing scheme. These routines are only used in s3im.c - * Non time critical code uses SlowBCopy_{from/to} bus. - * - * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996 - */ - -#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */ -#define LWORD_CODING (0x18) -#define SPARSE (5) -#else #define LWORD_CODING (0x60) #define SPARSE (7) -#endif - -void -xf86JensenMemToBus(char *Base, long dst, long src, int count) -{ - if( ((long)src^((long)dst)) & 3) { - /* src & dst are NOT aligned to each other */ - unsigned long addr; - unsigned long low_word, high_word,last_read; - long rm,loop; - unsigned long tmp,org,org2,mask,src_org,count_org; - - src_org=src; - count_org=count; - - /* add EISA longword coding and round off*/ - addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE); - rm = (long)dst & 3; - count += rm; - - count = count_org + rm; - org = *(volatile unsigned int *)addr; - __asm__("ldq_u %0,%1" - :"=r" (low_word):"m" (*(unsigned long *)(src_org))); - src = src_org - rm; - if( count > 4 ) { - last_read = src_org+count_org - 1; - __asm__("ldq_u %0,%1" - :"=r" (high_word):"m" (*(unsigned long *)(src+4))); - __asm__("extll %1,%2,%0" - :"=r" (low_word) - :"r" (low_word), "r" ((unsigned long)(src))); - __asm__("extlh %1,%2,%0" - :"=r" (tmp) - :"r" (high_word), "r" ((unsigned long)(src))); - tmp |= low_word; - src += 4; - __asm__("mskqh %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" (rm)); - __asm__("mskql %1,%2,%0" - :"=r" (org2) - :"r" (org), "r" (rm)); - tmp |= org2; - - loop = (count-4) >> 2; /* loop eqv. count>=4 ; count -= 4 */ - while (loop) { - /* tmp to be stored completly -- need to read next word*/ - low_word = high_word; - *(volatile unsigned int *) (addr) = tmp; - __asm__("ldq_u %0,%1" - :"=r" (high_word):"m" (*(unsigned long*)(src+4))); - loop --; - __asm__("extll %1,%2,%0" - :"=r" (low_word) - :"r" (low_word), "r" ((unsigned long)src)); - __asm__("extlh %1,%2,%0" - :"=r" (tmp) - :"r" (high_word), "r" ((unsigned long)src)); - src += 4; - tmp |= low_word; - addr += 4<<SPARSE; - } - if ( count & 3 ) { - /* Store tmp completly, and possibly read one more word.*/ - *(volatile unsigned int *) (addr) = tmp; - __asm__("ldq_u %0,%1" - :"=r" (tmp):"m" (*((unsigned long *)(last_read)) )); - addr += 4<<SPARSE; - __asm__("extll %1,%2,%0" - :"=r" (low_word) - :"r" (high_word), "r" ((unsigned long)src)); - __asm__("extlh %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" ((unsigned long)src)); - tmp |= low_word; - org = *(volatile unsigned int *)addr; - - __asm__("mskql %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" (count&3)); - __asm__("mskqh %1,%2,%0" - :"=r" (org) - :"r" (org), "r" (count&3)); - - tmp |= org; - } - *(volatile unsigned int *) (addr) = tmp; - return; - } else { /* count > 4 */ - __asm__("ldq_u %0,%1" - :"=r" (high_word):"m" (*(unsigned long *)(src+4))); - __asm__("extll %1,%2,%0" - :"=r" (low_word) - :"r" (low_word), "r" ((unsigned long)(src))); - __asm__("extlh %1,%2,%0" - :"=r" (tmp) - :"r" (high_word), "r" ((unsigned long)(src))); - tmp |= low_word; - if( count < 4 ) { - - mask = -1; - __asm__("mskqh %1,%2,%0" - :"=r" (mask) - :"r" (mask), "r" (rm)); - __asm__("mskql %1,%2,%0" - :"=r" (mask) - :"r" (mask), "r" (count)); - tmp = (tmp & mask) | (org & ~mask); - *(volatile unsigned int *) (addr) = tmp; - return; - } else { - __asm__("mskqh %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" (rm)); - __asm__("mskql %1,%2,%0" - :"=r" (org2) - :"r" (org), "r" (rm)); - - tmp |= org2; - *(volatile unsigned int *) (addr) = tmp; - return; - } - } - } else { /* src & dst are aligned to each other */ - unsigned long addr; - unsigned int tmp,org,rm; - unsigned int *src_r; - - /* add EISA longword coding and round off*/ - addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE); - - src_r = (unsigned int*)((long)src & ~3L); - rm=(long)src & 3; - count += rm; - - tmp = *src_r; - org = *(volatile unsigned int *)addr; - - __asm__("mskqh %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" (rm)); - __asm__("mskql %1,%2,%0" - :"=r" (org) - :"r" (org), "r" (rm)); - - tmp |= org; - - while (count > 4) { - *(volatile unsigned int *) addr = tmp; - addr += 4<<SPARSE; - src_r += 1; - tmp = *src_r; - count -= 4; - } - - org = *(volatile unsigned int *)addr; - __asm__("mskql %1,%2,%0" - :"=r" (tmp) - :"r" (tmp), "r" (count)); - __asm__("mskqh %1,%2,%0" - :"=r" (org) - :"r" (org), "r" (count)); - tmp |= org; - *(volatile unsigned int *) (addr) = tmp; - } -} - -void -xf86JensenBusToMem(char *Base, char *dst, unsigned long src, int count) -{ -#if 0 - /* Optimization of BusToMem() is left as an exercise to the reader ;-) - * Consider that ldq_u/extlh/extll won't work because of the bus being - * only 4 bytes wide! - */ -#else - unsigned long addr; - long result; - - addr = (unsigned long)(Base+(src<<SPARSE)) ; - while( addr & (3<<SPARSE) ){ - if(count <= 0) return; - result = *(volatile int *) addr; - result >>= ((addr>>SPARSE) & 3) * 8; - *dst++ = (char) result; - addr += 1<<SPARSE; - count--; - } - count -=4; - while(count >= 0){ - int i; - - result = *(volatile int *) (addr+LWORD_CODING); - for(i=4;i--;) { - *dst++ = (char) result; - result >>= 8; - } - addr += 4<<SPARSE; - count -= 4; - } - count +=4; - - while( count ){ - result = *(volatile int *) addr; - result >>= ((addr>>SPARSE) & 3) * 8; - *dst++ = (char) result; - addr += 1<<SPARSE; - count--; - } -#endif -} - static unsigned long __memcpy(unsigned long dest, unsigned long src, int n); diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index 7c51fcca3..be69b9dd1 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/hw/xfree86/os-support/misc/SlowBcopy.c @@ -56,29 +56,13 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) } #ifdef __alpha__ -/* - * The Jensen lacks dense memory, thus we have to address the bus via - * the sparse addressing scheme. Time critical code uses routines from - * BUSmemcpy.c - * - * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996 - */ #ifdef linux -unsigned long _bus_base(void); - -#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */ -#define SPARSE (5) -#else #define SPARSE (7) -#endif - -#define isJensen() (!_bus_base()) #else -#define isJensen() 0 #define SPARSE 0 #endif @@ -86,42 +70,32 @@ unsigned long _bus_base(void); _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count) { - if (isJensen()) - { - unsigned long addr; - long result; - - addr = (unsigned long) src; - while( count ){ - result = *(volatile int *) addr; - result >>= ((addr>>SPARSE) & 3) * 8; - *dst++ = (unsigned char) (0xffUL & result); - addr += 1<<SPARSE; - count--; - outb(0x80, 0x00); - } + unsigned long addr; + long result; + + addr = (unsigned long) src; + while( count ){ + result = *(volatile int *) addr; + result >>= ((addr>>SPARSE) & 3) * 8; + *dst++ = (unsigned char) (0xffUL & result); + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); } - else - xf86SlowBcopy(src,dst,count); } _X_EXPORT void xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count) { - if (isJensen()) - { - unsigned long addr; - - addr = (unsigned long) dst; - while(count) { - *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101; - src++; - addr += 1<<SPARSE; - count--; - outb(0x80, 0x00); - } + unsigned long addr; + + addr = (unsigned long) dst; + while(count) { + *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101; + src++; + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); } - else - xf86SlowBcopy(src,dst,count); } #endif diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c index 8bac87ebe..0c368e713 100644 --- a/hw/xfree86/os-support/shared/bios_mmap.c +++ b/hw/xfree86/os-support/shared/bios_mmap.c @@ -91,33 +91,15 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, * re: boundaries and sizes and such... */ -/* - * The Jensen lacks dense memory, thus we have to address the bus via - * the sparse addressing scheme. - * - * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996 - */ - #ifdef linux -#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */ -#define SPARSE (5) -#define isJensen (1) -#else -#define isJensen (!_bus_base()) -#define SPARSE (7) -#endif - extern unsigned long _bus_base(void); -extern unsigned long _bus_base_sparse(void); -#define BUS_BASE (isJensen ? _bus_base_sparse() : _bus_base()) -#define JENSEN_SHIFT(x) (isJensen ? ((long)x<<SPARSE) : (long)x) +#define BUS_BASE _bus_base() #else extern u_int64_t dense_base(void); #define BUS_BASE dense_base() -#define JENSEN_SHIFT(x) ((long) x) #endif @@ -141,8 +123,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, Offset += Base & (psize - 1); Base &= ~(psize - 1); mlen = (Offset + Len + psize - 1) & ~(psize - 1); - base = mmap((caddr_t)0, JENSEN_SHIFT(mlen), PROT_READ, - MAP_SHARED, fd, (off_t)(JENSEN_SHIFT(Base) + BUS_BASE)); + base = mmap((caddr_t)0, mlen, PROT_READ, + MAP_SHARED, fd, (off_t)(Base + BUS_BASE)); if (base == MAP_FAILED) { @@ -151,10 +133,9 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, return(-1); } - xf86SlowBCopyFromBus((unsigned char *)(base+JENSEN_SHIFT(Offset)), - Buf, Len); + xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len); - munmap((caddr_t)JENSEN_SHIFT(base), JENSEN_SHIFT(mlen)); + munmap((caddr_t)base, mlen); close(fd); return(Len); } |