diff options
-rw-r--r-- | arch/sh/include/asm/page.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h index d71feb359304..0152c040f6c3 100644 --- a/arch/sh/include/asm/page.h +++ b/arch/sh/include/asm/page.h | |||
@@ -128,13 +128,18 @@ typedef struct page *pgtable_t; | |||
128 | * added or subtracted as required. | 128 | * added or subtracted as required. |
129 | */ | 129 | */ |
130 | #ifdef CONFIG_PMB | 130 | #ifdef CONFIG_PMB |
131 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START) | 131 | #define ___pa(x) ((x)-PAGE_OFFSET+__MEMORY_START) |
132 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START)) | 132 | #define ___va(x) ((x)+PAGE_OFFSET-__MEMORY_START) |
133 | #else | 133 | #else |
134 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | 134 | #define ___pa(x) ((x)-PAGE_OFFSET) |
135 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | 135 | #define ___va(x) ((x)+PAGE_OFFSET) |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | #ifndef __ASSEMBLY__ | ||
139 | #define __pa(x) ___pa((unsigned long)x) | ||
140 | #define __va(x) (void *)___va((unsigned long)x) | ||
141 | #endif /* !__ASSEMBLY__ */ | ||
142 | |||
138 | #ifdef CONFIG_UNCACHED_MAPPING | 143 | #ifdef CONFIG_UNCACHED_MAPPING |
139 | #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start) | 144 | #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start) |
140 | #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET) | 145 | #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET) |