fixmap.h 724 B

12345678910111213141516171819202122232425262728
  1. #ifndef _ASM_FIXMAP_H
  2. #define _ASM_FIXMAP_H
  3. #define FIXADDR_START 0xffc00000UL
  4. #define FIXADDR_TOP 0xffe00000UL
  5. #define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START)
  6. #define FIX_KMAP_NR_PTES (FIXADDR_SIZE >> PAGE_SHIFT)
  7. #define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT))
  8. #define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT)
  9. extern void __this_fixmap_does_not_exist(void);
  10. static inline unsigned long fix_to_virt(const unsigned int idx)
  11. {
  12. if (idx >= FIX_KMAP_NR_PTES)
  13. __this_fixmap_does_not_exist();
  14. return __fix_to_virt(idx);
  15. }
  16. static inline unsigned int virt_to_fix(const unsigned long vaddr)
  17. {
  18. BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
  19. return __virt_to_fix(vaddr);
  20. }
  21. #endif