From 264b750cc2d576beadfd74bcde45ac75edc4aab9 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 23 Mar 2012 02:19:44 +0100 Subject: Add missing phystokv/kvtophys calls * i386/i386/vm_param.h [!MACH_XEN]: Do not include . * i386/i386at/model_dep.c (init_alloc_aligned): Use phystokv to compare physical memory addresses with kernel start, end, and symbol table. * i386/intel/pmap.c (pmap_enter): Use kvtophys to convert ptp pointer to pte entry. * linux/dev/init/main.c (alloc_contig_mem, linux_init): Use phystokv to convert allocated pages to virtual pointer. * linux/src/include/asm-i386/io.h: Include . (virt_to_phys): Call _kvtophys. (phys_to_virt): Call phystokv. * linux/src/include/linux/compatmac.h: Include . (ioremap): Use phys_to_virt to convert physical address to virtual pointer. (my_iounmap): Likewise. * linux/dev/include/asm-i386/page.h: Include . (PAGE_SHIFT, PAGE_SIZE, PAGE_MASK): Remove macros. * linux/src/drivers/scsi/ncr53c8xx.c (vm_size_t): Remove type. * linux/dev/glue/net.c: Include (device_write): Call phystokv to convert from physical page address to virtual pointer. * linux/dev/glue/block.c (alloc_buffer, free_buffer, rdwr_full): Likewise. --- linux/src/drivers/scsi/ncr53c8xx.c | 2 +- linux/src/include/asm-i386/io.h | 6 ++++-- linux/src/include/linux/compatmac.h | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'linux/src') diff --git a/linux/src/drivers/scsi/ncr53c8xx.c b/linux/src/drivers/scsi/ncr53c8xx.c index 1be3d9fe..22aec32b 100644 --- a/linux/src/drivers/scsi/ncr53c8xx.c +++ b/linux/src/drivers/scsi/ncr53c8xx.c @@ -273,7 +273,7 @@ typedef u32 u_int32; #define u_long unsigned long typedef u_long vm_offset_t; -typedef int vm_size_t; +//typedef int vm_size_t; #define bcopy(s, d, n) memcpy((d), (s), (n)) #define bzero(d, n) memset((d), 0, (n)) diff --git a/linux/src/include/asm-i386/io.h b/linux/src/include/asm-i386/io.h index 98e32ce6..f961f1d2 100644 --- a/linux/src/include/asm-i386/io.h +++ b/linux/src/include/asm-i386/io.h @@ -25,6 +25,8 @@ * Linus */ +#include + #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 b9a41127..95370702 100644 --- a/linux/src/include/linux/compatmac.h +++ b/linux/src/include/linux/compatmac.h @@ -47,6 +47,7 @@ #define COMPATMAC_H #include +#include #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() -- cgit v1.2.3