fixmap.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __UM_FIXMAP_H
  3. #define __UM_FIXMAP_H
  4. #include <asm/processor.h>
  5. #include <asm/kmap_types.h>
  6. #include <asm/archparam.h>
  7. #include <asm/page.h>
  8. #include <linux/threads.h>
  9. /*
  10. * Here we define all the compile-time 'special' virtual
  11. * addresses. The point is to have a constant address at
  12. * compile time, but to set the physical address only
  13. * in the boot process. We allocate these special addresses
  14. * from the end of virtual memory (0xfffff000) backwards.
  15. * Also this lets us do fail-safe vmalloc(), we
  16. * can guarantee that these special addresses and
  17. * vmalloc()-ed addresses never overlap.
  18. *
  19. * these 'compile-time allocated' memory buffers are
  20. * fixed-size 4k pages. (or larger if used with an increment
  21. * highger than 1) use fixmap_set(idx,phys) to associate
  22. * physical memory with fixmap indices.
  23. *
  24. * TLB entries of such buffers will not be flushed across
  25. * task switches.
  26. */
  27. /*
  28. * on UP currently we will have no trace of the fixmap mechanizm,
  29. * no page table allocations, etc. This might change in the
  30. * future, say framebuffers for the console driver(s) could be
  31. * fix-mapped?
  32. */
  33. enum fixed_addresses {
  34. __end_of_fixed_addresses
  35. };
  36. extern void __set_fixmap (enum fixed_addresses idx,
  37. unsigned long phys, pgprot_t flags);
  38. /*
  39. * used by vmalloc.c.
  40. *
  41. * Leave one empty page between vmalloc'ed areas and
  42. * the start of the fixmap, and leave one page empty
  43. * at the top of mem..
  44. */
  45. #define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  46. #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
  47. #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
  48. #include <asm-generic/fixmap.h>
  49. #endif