page.h 881 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _CRIS_ARCH_PAGE_H
  2. #define _CRIS_ARCH_PAGE_H
  3. #ifdef __KERNEL__
  4. /* This handles the memory map.. */
  5. #ifdef CONFIG_CRIS_LOW_MAP
  6. #define PAGE_OFFSET KSEG_6 /* kseg_6 is mapped to physical ram */
  7. #else
  8. #define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram */
  9. #endif
  10. /* macros to convert between really physical and virtual addresses
  11. * by stripping a selected bit, we can convert between KSEG_x and 0x40000000 where
  12. * the DRAM really resides
  13. */
  14. #ifdef CONFIG_CRIS_LOW_MAP
  15. /* we have DRAM virtually at 0x6 */
  16. #define __pa(x) ((unsigned long)(x) & 0xdfffffff)
  17. #define __va(x) ((void *)((unsigned long)(x) | 0x20000000))
  18. #else
  19. /* we have DRAM virtually at 0xc */
  20. #define __pa(x) ((unsigned long)(x) & 0x7fffffff)
  21. #define __va(x) ((void *)((unsigned long)(x) | 0x80000000))
  22. #endif
  23. #endif
  24. #endif