highmem.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * highmem.h: virtual kernel memory mappings for high memory
  4. *
  5. * Used in CONFIG_HIGHMEM systems for memory pages which
  6. * are not addressable by direct kernel virtual addresses.
  7. *
  8. * Copyright (C) 1999 Gerhard Wichert, Siemens AG
  9. * [email protected]
  10. *
  11. *
  12. * Redesigned the x86 32-bit VM architecture to deal with
  13. * up to 16 Terabyte physical memory. With current x86 CPUs
  14. * we now support up to 64 Gigabytes physical RAM.
  15. *
  16. * Copyright (C) 1999 Ingo Molnar <[email protected]>
  17. */
  18. #ifndef _ASM_X86_HIGHMEM_H
  19. #define _ASM_X86_HIGHMEM_H
  20. #ifdef __KERNEL__
  21. #include <linux/interrupt.h>
  22. #include <linux/threads.h>
  23. #include <asm/tlbflush.h>
  24. #include <asm/paravirt.h>
  25. #include <asm/fixmap.h>
  26. #include <asm/pgtable_areas.h>
  27. /* declarations for highmem.c */
  28. extern unsigned long highstart_pfn, highend_pfn;
  29. /*
  30. * Right now we initialize only a single pte table. It can be extended
  31. * easily, subsequent pte tables have to be allocated in one physical
  32. * chunk of RAM.
  33. */
  34. /*
  35. * Ordering is:
  36. *
  37. * high memory on: high_memory off:
  38. * FIXADDR_TOP FIXADDR_TOP
  39. * fixed addresses fixed addresses
  40. * FIXADDR_START FIXADDR_START
  41. * temp fixed addresses/persistent kmap area VMALLOC_END
  42. * PKMAP_BASE temp fixed addresses/vmalloc area
  43. * VMALLOC_END VMALLOC_START
  44. * vmalloc area high_memory
  45. * VMALLOC_START
  46. * high_memory
  47. *
  48. * The temp fixed area is only used during boot for early_ioremap(), and
  49. * it is unused when the ioremap() is functional. vmalloc/pkmap area become
  50. * available after early boot so the temp fixed area is available for re-use.
  51. */
  52. #define LAST_PKMAP_MASK (LAST_PKMAP-1)
  53. #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
  54. #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
  55. #define flush_cache_kmaps() do { } while (0)
  56. #define arch_kmap_local_post_map(vaddr, pteval) \
  57. arch_flush_lazy_mmu_mode()
  58. #define arch_kmap_local_post_unmap(vaddr) \
  59. do { \
  60. flush_tlb_one_kernel((vaddr)); \
  61. arch_flush_lazy_mmu_mode(); \
  62. } while (0)
  63. extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
  64. unsigned long end_pfn);
  65. #endif /* __KERNEL__ */
  66. #endif /* _ASM_X86_HIGHMEM_H */