This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / include / asm-i386 / mach-xen / asm / io.h
similarity index 84%
rename from include/asm-xen/asm-i386/io.h
rename to include/asm-i386/mach-xen/asm/io.h
index e31a16d..7c3fafd 100644 (file)
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  * access
  */
-#define xlate_dev_mem_ptr(p)    __va(p)
+#define xlate_dev_mem_ptr(p)   __va(p)
 
 /*
  * Convert a virtual cached pointer to an uncached pointer
  */
-#define xlate_dev_kmem_ptr(p)   p
+#define xlate_dev_kmem_ptr(p)  p
 
 /**
  *     virt_to_phys    -       map virtual addresses to physical
@@ -102,6 +102,7 @@ static inline void * phys_to_virt(unsigned long address)
  */
 #define page_to_pseudophys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
 #define page_to_phys(page)      (phys_to_machine(page_to_pseudophys(page)))
+#define page_to_bus(page)       (phys_to_machine(page_to_pseudophys(page)))
 
 #define bio_to_pseudophys(bio)  (page_to_pseudophys(bio_page((bio))) + \
                                  (unsigned long) bio_offset((bio)))
@@ -143,16 +144,17 @@ extern void iounmap(volatile void __iomem *addr);
 extern void *bt_ioremap(unsigned long offset, unsigned long size);
 extern void bt_iounmap(void *addr, unsigned long size);
 
+/* Use early IO mappings for DMI because it's initialized early */
+#define dmi_ioremap bt_ioremap
+#define dmi_iounmap bt_iounmap
+#define dmi_alloc alloc_bootmem
+
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
  */
 #define isa_virt_to_bus(_x) isa_virt_to_bus_is_UNSUPPORTED->x
 #define isa_page_to_bus(_x) isa_page_to_bus_is_UNSUPPORTED->x
-#ifdef CONFIG_XEN_PHYSDEV_ACCESS
 #define isa_bus_to_virt(_x) (void *)(__fix_to_virt(FIX_ISAMAP_BEGIN) + (_x))
-#else
-#define isa_bus_to_virt(_x) isa_bus_to_virt_needs_PRIVILEGED_BUILD
-#endif
 
 /*
  * However PCI ones are not necessarily 1:1 and therefore these interfaces
@@ -228,25 +230,13 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
  * used as the IO-area pointer (it can be iounmapped as well, so the
  * analogy with PCI is quite large):
  */
-#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
-
-#define isa_readb(a) readb(__ISA_IO_base + (a))
-#define isa_readw(a) readw(__ISA_IO_base + (a))
-#define isa_readl(a) readl(__ISA_IO_base + (a))
-#define isa_writeb(b,a) writeb(b,__ISA_IO_base + (a))
-#define isa_writew(w,a) writew(w,__ISA_IO_base + (a))
-#define isa_writel(l,a) writel(l,__ISA_IO_base + (a))
-#define isa_memset_io(a,b,c)           memset_io(__ISA_IO_base + (a),(b),(c))
-#define isa_memcpy_fromio(a,b,c)       memcpy_fromio((a),__ISA_IO_base + (b),(c))
-#define isa_memcpy_toio(a,b,c)         memcpy_toio(__ISA_IO_base + (a),(b),(c))
-
+#define __ISA_IO_base ((char __iomem *)(fix_to_virt(FIX_ISAMAP_BEGIN)))
 
 /*
  * Again, i386 does not require mem IO specific function.
  */
 
 #define eth_io_copy_and_sum(a,b,c,d)           eth_copy_and_sum((a),(void __force *)(b),(c),(d))
-#define isa_eth_io_copy_and_sum(a,b,c,d)       eth_copy_and_sum((a),(void __force *)(__ISA_IO_base + (b)),(c),(d))
 
 /**
  *     check_signature         -       find BIOS signatures
@@ -309,15 +299,8 @@ static inline void flush_write_buffers(void)
 
 #ifdef SLOW_IO_BY_JUMPING
 #define __SLOW_DOWN_IO "jmp 1f; 1: jmp 1f; 1:"
-#elif defined(__UNSAFE_IO__)
-#define __SLOW_DOWN_IO "outb %%al,$0x80;"
 #else
-#define __SLOW_DOWN_IO "\n1: outb %%al,$0x80\n"                \
-                      "2:\n"                           \
-                      ".section __ex_table,\"a\"\n\t"  \
-                      ".align 4\n\t"                   \
-                      ".long 1b,2b\n"                  \
-                      ".previous"
+#define __SLOW_DOWN_IO "outb %%al,$0x80;"
 #endif
 
 static inline void slow_down_io(void) {
@@ -362,8 +345,7 @@ static inline unsigned type in##bwl(int port) { \
 #endif
 
 
-#if __UNSAFE_IO__
-#define ____BUILDIO(bwl,bw,type) \
+#define BUILDIO(bwl,bw,type) \
 static inline void out##bwl##_local(unsigned type value, int port) { \
        __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
 } \
@@ -371,35 +353,7 @@ static inline unsigned type in##bwl##_local(int port) { \
        unsigned type value; \
        __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \
        return value; \
-}
-#else
-#define ____BUILDIO(bwl,bw,type) \
-static inline void out##bwl##_local(unsigned type value, int port) { \
-       __asm__ __volatile__("1: out" #bwl " %" #bw "0, %w1\n"          \
-                            "2:\n"                                     \
-                            ".section __ex_table,\"a\"\n\t"            \
-                            ".align 4\n\t"                             \
-                            ".long 1b,2b\n"                            \
-                            ".previous" : : "a"(value), "Nd"(port));   \
 } \
-static inline unsigned type in##bwl##_local(int port) { \
-       unsigned type value; \
-       __asm__ __volatile__("1:in" #bwl " %w1, %" #bw "0\n"            \
-                            "2:\n"                                     \
-                            ".section .fixup,\"ax\"\n"                 \
-                            "3: mov" #bwl " $~0,%" #bw "0\n\t"         \
-                            "jmp 2b\n"                                 \
-                            ".previous\n"                              \
-                            ".section __ex_table,\"a\"\n\t"            \
-                            ".align 4\n\t"                             \
-                            ".long 1b,3b\n"                            \
-                            ".previous" : "=a"(value) : "Nd"(port));   \
-       return value; \
-}
-#endif
-
-#define BUILDIO(bwl,bw,type) \
-____BUILDIO(bwl,bw,type) \
 static inline void out##bwl##_local_p(unsigned type value, int port) { \
        out##bwl##_local(value, port); \
        slow_down_io(); \