fixmap.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * fixmap.h: compile-time virtual memory allocation
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 1998 Ingo Molnar
  9. * Copyright (C) 2013 Mark Salter <msalter@redhat.com>
  10. *
  11. * Adapted from arch/x86_64 version.
  12. *
  13. */
  14. #ifndef _ASM_ARM64_FIXMAP_H
  15. #define _ASM_ARM64_FIXMAP_H
  16. #ifndef __ASSEMBLY__
  17. #include <linux/kernel.h>
  18. #include <asm/page.h>
  19. /*
  20. * Here we define all the compile-time 'special' virtual
  21. * addresses. The point is to have a constant address at
  22. * compile time, but to set the physical address only
  23. * in the boot process.
  24. *
  25. * These 'compile-time allocated' memory buffers are
  26. * page-sized. Use set_fixmap(idx,phys) to associate
  27. * physical memory with fixmap indices.
  28. *
  29. */
  30. enum fixed_addresses {
  31. FIX_EARLYCON_MEM_BASE,
  32. __end_of_permanent_fixed_addresses,
  33. /*
  34. * Temporary boot-time mappings, used by early_ioremap(),
  35. * before ioremap() is functional.
  36. */
  37. #ifdef CONFIG_ARM64_64K_PAGES
  38. #define NR_FIX_BTMAPS 4
  39. #else
  40. #define NR_FIX_BTMAPS 64
  41. #endif
  42. #define FIX_BTMAPS_SLOTS 7
  43. #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
  44. FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
  45. FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
  46. __end_of_fixed_addresses
  47. };
  48. #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
  49. #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
  50. #define FIXMAP_PAGE_IO __pgprot(PROT_DEVICE_nGnRE)
  51. extern void __early_set_fixmap(enum fixed_addresses idx,
  52. phys_addr_t phys, pgprot_t flags);
  53. #define __set_fixmap __early_set_fixmap
  54. #include <asm-generic/fixmap.h>
  55. #endif /* !__ASSEMBLY__ */
  56. #endif /* _ASM_ARM64_FIXMAP_H */