Blame view
arch/m68k/include/asm/virtconvert.h
972 Bytes
1da177e4c Linux-2.6.12-rc2 |
1 2 3 4 5 6 7 8 |
#ifndef __VIRT_CONVERT__ #define __VIRT_CONVERT__ /* * Macros used for converting between virtual and physical mappings. */ #ifdef __KERNEL__ |
1da177e4c Linux-2.6.12-rc2 |
9 |
#include <linux/compiler.h> |
12d810c1b m68k: discontinuo... |
10 |
#include <linux/mmzone.h> |
1da177e4c Linux-2.6.12-rc2 |
11 12 |
#include <asm/setup.h> #include <asm/page.h> |
1da177e4c Linux-2.6.12-rc2 |
13 14 15 |
/* * Change virtual addresses to physical addresses and vv. */ |
1da177e4c Linux-2.6.12-rc2 |
16 17 |
static inline unsigned long virt_to_phys(void *address) { |
12d810c1b m68k: discontinuo... |
18 |
return __pa(address); |
1da177e4c Linux-2.6.12-rc2 |
19 20 21 22 |
} static inline void *phys_to_virt(unsigned long address) { |
12d810c1b m68k: discontinuo... |
23 |
return __va(address); |
1da177e4c Linux-2.6.12-rc2 |
24 |
} |
1da177e4c Linux-2.6.12-rc2 |
25 26 |
/* Permanent address of a page. */ |
682137f7e m68knommu: fix de... |
27 |
#ifdef CONFIG_MMU |
12d810c1b m68k: discontinuo... |
28 29 30 31 |
#ifdef CONFIG_SINGLE_MEMORY_CHUNK #define page_to_phys(page) \ __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) #else |
f54bcdc2b m68k: Eliminate u... |
32 |
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
12d810c1b m68k: discontinuo... |
33 |
#endif |
682137f7e m68knommu: fix de... |
34 35 36 |
#else #define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) #endif |
1da177e4c Linux-2.6.12-rc2 |
37 38 39 |
/* * IO bus memory addresses are 1:1 with the physical address, |
1da177e4c Linux-2.6.12-rc2 |
40 |
*/ |
1da177e4c Linux-2.6.12-rc2 |
41 42 |
#define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt |
1da177e4c Linux-2.6.12-rc2 |
43 44 45 |
#endif #endif |