patch-2.2.18 linux/include/asm-sparc64/io.h
Next file: linux/include/asm-sparc64/semaphore.h
Previous file: linux/include/asm-sparc64/envctrl.h
Back to the patch index
Back to the overall index
- Lines: 63
- Date:
Thu Nov 2 13:05:35 2000
- Orig file:
v2.2.17/include/asm-sparc64/io.h
- Orig date:
Fri Apr 21 12:46:50 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/include/asm-sparc64/io.h linux/include/asm-sparc64/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.19.2.1 2000/01/14 03:55:36 davem Exp $ */
+/* $Id: io.h,v 1.19.2.5 2000/10/25 18:14:47 davem Exp $ */
#ifndef __SPARC64_IO_H
#define __SPARC64_IO_H
@@ -14,6 +14,20 @@
#define SLOW_DOWN_IO do { } while (0)
+#ifndef CONFIG_PCI
+
+/* In builds without PCI these should not be called.
+ *
+ * XXX Unfortunately they are, this is how the scsi
+ * XXX disk driver determines whether kernel buffers
+ * XXX are physically contiguous :-(
+ */
+#define virt_to_phys(addr) __pa(addr)
+#define phys_to_virt(addr) __va(addr)
+#define bus_dvma_to_mem(vaddr) (__builtin_trap(), 0)
+
+#else
+
#define PCI_DVMA_HASHSZ 256
extern unsigned long pci_dvma_offset;
@@ -46,14 +60,15 @@
return (void *)(paddr + off);
}
-#define virt_to_bus virt_to_phys
-#define bus_to_virt phys_to_virt
-
extern __inline__ unsigned long bus_dvma_to_mem(unsigned long vaddr)
{
return vaddr & pci_dvma_mask;
}
+#endif /* CONFIG_PCI */
+
+#define virt_to_bus virt_to_phys
+#define bus_to_virt phys_to_virt
extern __inline__ unsigned int inb(unsigned long addr)
{
@@ -244,6 +259,8 @@
return retval;
}
+#ifdef __KERNEL__
+
/*
* On the sparc we have the whole physical IO address space mapped at all
* times, so ioremap() and iounmap() do not need to do anything.
@@ -279,5 +296,7 @@
u32 io, int rdonly);
extern void sparc_free_io (void *va, int sz);
extern void *sparc_dvma_malloc (int sz, char *name, __u32 *dvma_addr);
+
+#endif /* __KERNEL__ */
#endif /* !(__SPARC64_IO_H) */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)