page.h 907 B

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