summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/io.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /include/asm-sparc64/io.h
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'include/asm-sparc64/io.h')
-rw-r--r--include/asm-sparc64/io.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index 3316c0c1d..3b8502189 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.14 1997/11/01 10:23:58 ecd Exp $ */
+/* $Id: io.h,v 1.16 1998/03/24 05:54:40 ecd Exp $ */
#ifndef __SPARC64_IO_H
#define __SPARC64_IO_H
@@ -13,14 +13,22 @@
#define __SLOW_DOWN_IO do { } while (0)
#define SLOW_DOWN_IO do { } while (0)
+extern unsigned long pci_dvma_offset;
+extern unsigned long pci_dvma_mask;
+
extern __inline__ unsigned long virt_to_phys(volatile void *addr)
{
- return ((((unsigned long)addr) - PAGE_OFFSET) | 0x80000000UL);
+ unsigned long vaddr = (unsigned long)addr;
+
+ /* Handle kernel variable pointers... */
+ if (vaddr < PAGE_OFFSET)
+ vaddr += PAGE_OFFSET - (unsigned long)&empty_zero_page;
+ return ((vaddr - PAGE_OFFSET) | pci_dvma_offset);
}
extern __inline__ void *phys_to_virt(unsigned long addr)
{
- return ((void *)((addr & ~0x80000000) + PAGE_OFFSET));
+ return ((void *)((addr & pci_dvma_mask) + PAGE_OFFSET));
}
#define virt_to_bus virt_to_phys
@@ -91,9 +99,9 @@ extern void insw(unsigned long addr, void *dst, unsigned long count);
extern void insl(unsigned long addr, void *dst, unsigned long count);
/* Memory functions, same as I/O accesses on Ultra. */
-#define readb(addr) inb((unsigned long)addr)
-#define readw(addr) inw((unsigned long)addr)
-#define readl(addr) inl((unsigned long)addr)
+#define readb(addr) inb((unsigned long)(addr))
+#define readw(addr) inw((unsigned long)(addr))
+#define readl(addr) inl((unsigned long)(addr))
#define writeb(b, addr) outb((b), (unsigned long)(addr))
#define writew(w, addr) outw((w), (unsigned long)(addr))
#define writel(l, addr) outl((l), (unsigned long)(addr))