diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86_64/page.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 4974433bbf34..40a24d0df090 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -61,6 +61,8 @@ typedef struct { unsigned long pgd; } pgd_t; | |||
61 | 61 | ||
62 | typedef struct { unsigned long pgprot; } pgprot_t; | 62 | typedef struct { unsigned long pgprot; } pgprot_t; |
63 | 63 | ||
64 | extern unsigned long phys_base; | ||
65 | |||
64 | #define pte_val(x) ((x).pte) | 66 | #define pte_val(x) ((x).pte) |
65 | #define pmd_val(x) ((x).pmd) | 67 | #define pmd_val(x) ((x).pmd) |
66 | #define pud_val(x) ((x).pud) | 68 | #define pud_val(x) ((x).pud) |
@@ -101,14 +103,14 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
101 | #define PAGE_OFFSET __PAGE_OFFSET | 103 | #define PAGE_OFFSET __PAGE_OFFSET |
102 | 104 | ||
103 | /* Note: __pa(&symbol_visible_to_c) should be always replaced with __pa_symbol. | 105 | /* Note: __pa(&symbol_visible_to_c) should be always replaced with __pa_symbol. |
104 | Otherwise you risk miscompilation. */ | 106 | Otherwise you risk miscompilation. */ |
105 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) | 107 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) |
106 | /* __pa_symbol should be used for C visible symbols. | 108 | /* __pa_symbol should be used for C visible symbols. |
107 | This seems to be the official gcc blessed way to do such arithmetic. */ | 109 | This seems to be the official gcc blessed way to do such arithmetic. */ |
108 | #define __pa_symbol(x) \ | 110 | #define __pa_symbol(x) \ |
109 | ({unsigned long v; \ | 111 | ({unsigned long v; \ |
110 | asm("" : "=r" (v) : "0" (x)); \ | 112 | asm("" : "=r" (v) : "0" (x)); \ |
111 | (v - __START_KERNEL_map); }) | 113 | ((v - __START_KERNEL_map) + phys_base); }) |
112 | 114 | ||
113 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | 115 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) |
114 | #ifdef CONFIG_FLATMEM | 116 | #ifdef CONFIG_FLATMEM |