summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2009-08-31 20:23:26 -0400
committerMatt Turner <mattst88@gmail.com>2009-08-31 20:25:15 -0400
commit5ef53a94ce4e48e11de26290cd677266308640c8 (patch)
tree29d15929342b6c22ca8dea35d75c0559c1e24175
parenta8e634b86d47353ef354717904fa66ebe35e1303 (diff)
alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus
xf86SlowBCopyToBus and xf86SlowBCopyFromBus cause segfaults on my system. Also remove associated slowbcopy_tobus/slowbcopy_frombus macros. Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--hw/xfree86/common/compiler.h16
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c52
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c2
-rw-r--r--hw/xfree86/vgahw/vgaHW.c16
4 files changed, 9 insertions, 77 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index b2301e7c9..95ef72c39 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1209,8 +1209,6 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
-extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
-extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Some macros to hide the system dependencies for MMIO accesses */
/* Changed to kill noise generated by gcc's -Wcast-align */
@@ -1342,18 +1340,4 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
# define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
# endif /* __alpha__ */
-
-/*
- * With Intel, the version in os-support/misc/SlowBcopy.s is used.
- * This avoids port I/O during the copy (which causes problems with
- * some hardware).
- */
-# ifdef __alpha__
-# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
-# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
-# else /* __alpha__ */
-# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
-# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
-# endif /* __alpha__ */
-
#endif /* _COMPILER_H */
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index 182a3e6ec..8a5017e52 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -1,15 +1,8 @@
-/*******************************************************************************
- for Alpha Linux
-*******************************************************************************/
-
/*
* Create a dependency that should be immune from the effect of register
* renaming as is commonly seen in superscalar processors. This should
* insert a minimum of 100-ns delays between reads/writes at clock rates
* up to 100 MHz---GGL
- *
- * Slowbcopy(char *src, char *dst, int count)
- *
*/
#ifdef HAVE_XORG_CONFIG_H
@@ -54,48 +47,3 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
while(len--)
*dst++ = *src++;
}
-
-#ifdef __alpha__
-
-#ifdef linux
-
-#define SPARSE (7)
-
-#else
-
-#define SPARSE 0
-
-#endif
-
-void
-xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
-{
- 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);
- }
-}
-
-void
-xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
-{
- 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);
- }
-}
-#endif
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index 40afd5b8e..a615a1d45 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
- xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
+ xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 004376b75..025dde2da 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo1) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
+ xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
}
#endif
@@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo2) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
+ xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
}
#endif
@@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->TextInfo) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
+ xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
+ xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
hwp->Base, TEXT_AMOUNT);
}
#endif
@@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
+ xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
}
#endif /* SAVE_FONT1 */
#if SAVE_FONT2
if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
+ xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
}
#endif /* SAVE_FONT2 */
#if SAVE_TEXT
if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
+ xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- slowbcopy_frombus(hwp->Base,
+ xf86SlowBcopy(hwp->Base,
(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
}
#endif /* SAVE_TEXT */