diff options
Diffstat (limited to 'linux/src/include')
-rw-r--r-- | linux/src/include/asm-i386/io.h | 6 | ||||
-rw-r--r-- | linux/src/include/linux/compatmac.h | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/linux/src/include/asm-i386/io.h b/linux/src/include/asm-i386/io.h index 98e32ce..f961f1d 100644 --- a/linux/src/include/asm-i386/io.h +++ b/linux/src/include/asm-i386/io.h @@ -25,6 +25,8 @@ * Linus */ +#include <machine/vm_param.h> + #ifdef SLOW_IO_BY_JUMPING #define __SLOW_DOWN_IO __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:") #else @@ -45,12 +47,12 @@ */ extern inline unsigned long virt_to_phys(volatile void * address) { - return (unsigned long) address; + return (unsigned long) _kvtophys(address); } extern inline void * phys_to_virt(unsigned long address) { - return (void *) address; + return (void *) phystokv(address); } /* diff --git a/linux/src/include/linux/compatmac.h b/linux/src/include/linux/compatmac.h index b9a4112..9537070 100644 --- a/linux/src/include/linux/compatmac.h +++ b/linux/src/include/linux/compatmac.h @@ -47,6 +47,7 @@ #define COMPATMAC_H #include <linux/version.h> +#include <asm/io.h> #if LINUX_VERSION_CODE < 0x020100 /* Less than 2.1.0 */ #define TWO_ZERO @@ -96,11 +97,11 @@ static inline unsigned char get_irq (unsigned char bus, unsigned char fn) static inline void *ioremap(unsigned long base, long length) { - if (base < 0x100000) return (void *)base; + if (base < 0x100000) return phys_to_virt(base); return vremap (base, length); } -#define my_iounmap(x, b) (((long)x<0x100000)?0:vfree ((void*)x)) +#define my_iounmap(x, b) (((long)x<(long)phys_to_virt(0x100000))?0:vfree ((void*)x)) #define capable(x) suser() |