V4L/DVB (4595): Remove CONFIG_VIDEO_PVRUSB2_24XXX from pvrusb2 driver
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-m68k / virtconvert.h
blob83a87c9b1a16fa399f1dfa4126315b84f861421c
1 #ifndef __VIRT_CONVERT__
2 #define __VIRT_CONVERT__
4 /*
5 * Macros used for converting between virtual and physical mappings.
6 */
8 #ifdef __KERNEL__
10 #include <linux/compiler.h>
11 #include <asm/setup.h>
12 #include <asm/page.h>
14 #ifdef CONFIG_AMIGA
15 #include <asm/amigahw.h>
16 #endif
19 * Change virtual addresses to physical addresses and vv.
21 #ifndef CONFIG_SUN3
22 extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
23 extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
24 #else
25 static inline unsigned long mm_vtop(unsigned long vaddr)
27 return __pa(vaddr);
30 static inline unsigned long mm_ptov(unsigned long paddr)
32 return (unsigned long)__va(paddr);
34 #endif
36 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
37 static inline unsigned long virt_to_phys(void *vaddr)
39 return (unsigned long)vaddr - PAGE_OFFSET + m68k_memory[0].addr;
42 static inline void * phys_to_virt(unsigned long paddr)
44 return (void *)(paddr - m68k_memory[0].addr + PAGE_OFFSET);
46 #else
47 static inline unsigned long virt_to_phys(void *address)
49 return mm_vtop((unsigned long)address);
52 static inline void *phys_to_virt(unsigned long address)
54 return (void *) mm_ptov(address);
56 #endif
58 /* Permanent address of a page. */
59 #define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT))
60 #define page_to_phys(page) virt_to_phys((void *)__page_address(page))
63 * IO bus memory addresses are 1:1 with the physical address,
64 * except on the PCI bus of the Hades.
66 #ifdef CONFIG_HADES
67 #define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
68 #define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
69 #else
70 #define virt_to_bus virt_to_phys
71 #define bus_to_virt phys_to_virt
72 #endif
74 #endif
75 #endif