2 * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
4 #ifndef __CF_VIRTCONVERT__
5 #define __CF_VIRTCONVERT__
8 * Macros used for converting between virtual and physical mappings.
15 #include <linux/compiler.h>
16 #include <linux/mmzone.h>
17 #include <asm/setup.h>
21 * Change virtual addresses to physical addresses and vv.
23 static inline unsigned long virt_to_phys(void *address
)
28 static inline void *phys_to_virt(unsigned long address
)
33 /* Permanent address of a page. */
34 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
35 #define page_to_phys(page) \
36 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
38 #define page_to_phys(_page) ({ \
39 struct page *__page = _page; \
40 struct pglist_data *pgdat; \
41 pgdat = pg_data_table[page_to_nid(__page)]; \
42 page_to_pfn(__page) << PAGE_SHIFT; \
47 * IO bus memory addresses are 1:1 with the physical address,
50 #define virt_to_bus(a) (a + PCI_DMA_BASE)
51 #define bus_to_virt(a) (a - PCI_DMA_BASE)
53 #define virt_to_bus(a) (a)
54 #define bus_to_virt(a) (a)
57 #endif /* __KERNEL__ */
58 #endif /* __CF_VIRTCONVERT__ */
This page took 0.043453 seconds and 5 git commands to generate.