Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

m68knommu: fix definitions of __pa() and __va()

Fix compilation breakage of all m68knommu targets:

CC arch/m68knommu/kernel/asm-offsets.s
In file included from include/linux/sched.h:77,
from arch/m68knommu/kernel/asm-offsets.c:12:
include/linux/percpu.h: In function 'per_cpu_ptr_to_phys':
include/linux/percpu.h:161: error: implicit declaration of function 'virt_to_phy

This is broken in linux-2.6.33-rc3.

Change the definitions of __pa() and __va() to not use virt_to_phys()
and phys_to_virt(). Trivial 1:1 conversion required for the non-MMU case.

A side effect if this is that the m68knommu can now use asm/virtconvert.h
for the definition of virt_to_phys() and phys_to_virt().

Also cleaned up the definition of page_to_phys() when moving into
virtconvert.h.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Greg Ungerer and committed by
Linus Torvalds
682137f7 066000dd

+7 -15
+1 -13
arch/m68k/include/asm/io_no.h
··· 3 3 4 4 #ifdef __KERNEL__ 5 5 6 + #include <asm/virtconvert.h> 6 7 7 8 /* 8 9 * These are for ISA/PCI shared memory _only_ and should never be used ··· 165 164 } 166 165 167 166 extern void iounmap(void *addr); 168 - 169 - /* Pages to physical address... */ 170 - #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) 171 - #define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) 172 - 173 - /* 174 - * Macros used for converting between virtual and physical mappings. 175 - */ 176 - #define phys_to_virt(vaddr) ((void *) (vaddr)) 177 - #define virt_to_phys(vaddr) ((unsigned long) (vaddr)) 178 - 179 - #define virt_to_bus virt_to_phys 180 - #define bus_to_virt phys_to_virt 181 167 182 168 /* 183 169 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
+2 -2
arch/m68k/include/asm/page_no.h
··· 56 56 57 57 #ifndef __ASSEMBLY__ 58 58 59 - #define __pa(vaddr) virt_to_phys((void *)(vaddr)) 60 - #define __va(paddr) phys_to_virt((unsigned long)(paddr)) 59 + #define __pa(vaddr) ((unsigned long)(vaddr)) 60 + #define __va(paddr) ((void *)(paddr)) 61 61 62 62 #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) 63 63 #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
+4
arch/m68k/include/asm/virtconvert.h
··· 26 26 } 27 27 28 28 /* Permanent address of a page. */ 29 + #ifdef CONFIG_MMU 29 30 #ifdef CONFIG_SINGLE_MEMORY_CHUNK 30 31 #define page_to_phys(page) \ 31 32 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) ··· 37 36 pgdat = pg_data_table[page_to_nid(__page)]; \ 38 37 page_to_pfn(__page) << PAGE_SHIFT; \ 39 38 }) 39 + #endif 40 + #else 41 + #define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) 40 42 #endif 41 43 42 44 /*