hwmon: (jc42) Change detection class
[linux/fpc-iii.git] / arch / m68k / include / asm / virtconvert.h
blobf35229b8651dcff3744b7b55010f53b615d70678
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 <linux/mmzone.h>
12 #include <asm/setup.h>
13 #include <asm/page.h>
16 * Change virtual addresses to physical addresses and vv.
18 static inline unsigned long virt_to_phys(void *address)
20 return __pa(address);
23 static inline void *phys_to_virt(unsigned long address)
25 return __va(address);
28 /* Permanent address of a page. */
29 #ifdef CONFIG_MMU
30 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
31 #define page_to_phys(page) \
32 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
33 #else
34 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
35 #endif
36 #else
37 #define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT)
38 #endif
41 * IO bus memory addresses are 1:1 with the physical address,
43 #define virt_to_bus virt_to_phys
44 #define bus_to_virt phys_to_virt
46 #endif
47 #endif