Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _CRIS_ARCH_PAGE_H |
| 2 | #define _CRIS_ARCH_PAGE_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | #ifdef __KERNEL__ |
| 6 | |
| 7 | /* This handles the memory map.. */ |
| 8 | #ifdef CONFIG_CRIS_LOW_MAP |
| 9 | #define PAGE_OFFSET KSEG_6 /* kseg_6 is mapped to physical ram */ |
| 10 | #else |
| 11 | #define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram */ |
| 12 | #endif |
| 13 | |
| 14 | /* macros to convert between really physical and virtual addresses |
Jesper Nilsson | 581b4fd | 2008-01-28 16:50:32 +0100 | [diff] [blame] | 15 | * by stripping a selected bit, we can convert between KSEG_x and |
| 16 | * 0x40000000 where the DRAM really resides |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #ifdef CONFIG_CRIS_LOW_MAP |
| 20 | /* we have DRAM virtually at 0x6 */ |
| 21 | #define __pa(x) ((unsigned long)(x) & 0xdfffffff) |
| 22 | #define __va(x) ((void *)((unsigned long)(x) | 0x20000000)) |
| 23 | #else |
| 24 | /* we have DRAM virtually at 0xc */ |
| 25 | #define __pa(x) ((unsigned long)(x) & 0x7fffffff) |
| 26 | #define __va(x) ((void *)((unsigned long)(x) | 0x80000000)) |
| 27 | #endif |
| 28 | |
| 29 | #endif |
| 30 | #endif |