highmem.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * highmem.h: virtual kernel memory mappings for high memory
  3. *
  4. * Used in CONFIG_HIGHMEM systems for memory pages which
  5. * are not addressable by direct kernel virtual addresses.
  6. *
  7. * Copyright (C) 1999 Gerhard Wichert, Siemens AG
  8. * Gerhard.Wichert@pdb.siemens.de
  9. *
  10. *
  11. * Redesigned the x86 32-bit VM architecture to deal with
  12. * up to 16 Terabyte physical memory. With current x86 CPUs
  13. * we now support up to 64 Gigabytes physical RAM.
  14. *
  15. * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
  16. */
  17. #ifndef _ASM_X86_HIGHMEM_H
  18. #define _ASM_X86_HIGHMEM_H
  19. #ifdef __KERNEL__
  20. #include <linux/interrupt.h>
  21. #include <linux/threads.h>
  22. #include <asm/kmap_types.h>
  23. #include <asm/tlbflush.h>
  24. #include <asm/paravirt.h>
  25. #include <asm/fixmap.h>
  26. /* declarations for highmem.c */
  27. extern unsigned long highstart_pfn, highend_pfn;
  28. /*
  29. * Right now we initialize only a single pte table. It can be extended
  30. * easily, subsequent pte tables have to be allocated in one physical
  31. * chunk of RAM.
  32. */
  33. /*
  34. * Ordering is:
  35. *
  36. * FIXADDR_TOP
  37. * fixed_addresses
  38. * FIXADDR_START
  39. * temp fixed addresses
  40. * FIXADDR_BOOT_START
  41. * Persistent kmap area
  42. * PKMAP_BASE
  43. * VMALLOC_END
  44. * Vmalloc area
  45. * VMALLOC_START
  46. * high_memory
  47. */
  48. #define LAST_PKMAP_MASK (LAST_PKMAP-1)
  49. #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
  50. #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
  51. extern void *kmap_high(struct page *page);
  52. extern void kunmap_high(struct page *page);
  53. void *kmap(struct page *page);
  54. void kunmap(struct page *page);
  55. void *kmap_atomic_prot(struct page *page, pgprot_t prot);
  56. void *kmap_atomic(struct page *page);
  57. void __kunmap_atomic(void *kvaddr);
  58. void *kmap_atomic_pfn(unsigned long pfn);
  59. void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
  60. struct page *kmap_atomic_to_page(void *ptr);
  61. #define flush_cache_kmaps() do { } while (0)
  62. extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
  63. unsigned long end_pfn);
  64. #endif /* __KERNEL__ */
  65. #endif /* _ASM_X86_HIGHMEM_H */