fixmap.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _ASM_FIXMAP_H
  2. #define _ASM_FIXMAP_H
  3. #define FIXADDR_START 0xffc00000UL
  4. #define FIXADDR_END 0xfff00000UL
  5. #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE)
  6. #include <asm/kmap_types.h>
  7. #include <asm/pgtable.h>
  8. enum fixed_addresses {
  9. FIX_EARLYCON_MEM_BASE,
  10. __end_of_permanent_fixed_addresses,
  11. FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
  12. FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
  13. /* Support writing RO kernel text via kprobes, jump labels, etc. */
  14. FIX_TEXT_POKE0,
  15. FIX_TEXT_POKE1,
  16. __end_of_fixmap_region,
  17. /*
  18. * Share the kmap() region with early_ioremap(): this is guaranteed
  19. * not to clash since early_ioremap() is only available before
  20. * paging_init(), and kmap() only after.
  21. */
  22. #define NR_FIX_BTMAPS 32
  23. #define FIX_BTMAPS_SLOTS 7
  24. #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
  25. FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
  26. FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
  27. __end_of_early_ioremap_region
  28. };
  29. static const enum fixed_addresses __end_of_fixed_addresses =
  30. __end_of_fixmap_region > __end_of_early_ioremap_region ?
  31. __end_of_fixmap_region : __end_of_early_ioremap_region;
  32. #define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY)
  33. #define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK)
  34. #define FIXMAP_PAGE_RO (FIXMAP_PAGE_NORMAL | L_PTE_RDONLY)
  35. /* Used by set_fixmap_(io|nocache), both meant for mapping a device */
  36. #define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED)
  37. #define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO
  38. #define __early_set_fixmap __set_fixmap
  39. #ifdef CONFIG_MMU
  40. void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);
  41. void __init early_fixmap_init(void);
  42. #include <asm-generic/fixmap.h>
  43. #else
  44. static inline void early_fixmap_init(void) { }
  45. #endif
  46. #endif