highmem.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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, enum km_type type, pgprot_t prot);
  56. void *kmap_atomic(struct page *page, enum km_type type);
  57. void kunmap_atomic(void *kvaddr, enum km_type type);
  58. void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
  59. void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
  60. struct page *kmap_atomic_to_page(void *ptr);
  61. #ifndef CONFIG_PARAVIRT
  62. #define kmap_atomic_pte(page, type) kmap_atomic(page, type)
  63. #endif
  64. #define flush_cache_kmaps() do { } while (0)
  65. extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
  66. unsigned long end_pfn);
  67. #endif /* __KERNEL__ */
  68. #endif /* _ASM_X86_HIGHMEM_H */