patch-2.3.14 linux/include/asm-alpha/vga.h

Next file: linux/include/asm-i386/hw_irq.h
Previous file: linux/include/asm-alpha/smp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/include/asm-alpha/vga.h linux/include/asm-alpha/vga.h
@@ -15,26 +15,26 @@
 
 extern inline void scr_writew(u16 val, u16 *addr)
 {
-	if ((long) addr < 0)
-		*addr = val;
-	else
+	if (__is_ioaddr((unsigned long) addr))
 		writew(val, (unsigned long) addr);
+	else
+		*addr = val;
 }
 
 extern inline u16 scr_readw(const u16 *addr)
 {
-	if ((long) addr < 0)
-		return *addr;
-	else
+	if (__is_ioaddr((unsigned long) addr))
 		return readw((unsigned long) addr);
+	else
+		return *addr;
 }
 
 extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
 {
-	if ((long)s < 0)
-		memsetw(s, c, count);
-	else
+	if (__is_ioaddr((unsigned long) s))
 		memsetw_io(s, c, count);
+	else
+		memsetw(s, c, count);
 }
 
 extern inline void scr_memcpyw_from(u16 *d, const u16 *s, unsigned int count)
@@ -51,6 +51,6 @@
 #define vga_readb readb
 #define vga_writeb writeb
 
-#define VGA_MAP_MEM(x) (x)
+#define VGA_MAP_MEM(x)	((unsigned long) ioremap((x), 0))
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)