/arch/x86/include/asm/pgtable_32_types.h

https://bitbucket.org/thekraven/iscream_thunderc-2.6.35 · C++ Header · 55 lines · 33 code · 10 blank · 12 comment · 0 complexity · f5d0ad818f1c04192f98dafa51f8aa97 MD5 · raw file

  1. #ifndef _ASM_X86_PGTABLE_32_DEFS_H
  2. #define _ASM_X86_PGTABLE_32_DEFS_H
  3. /*
  4. * The Linux x86 paging architecture is 'compile-time dual-mode', it
  5. * implements both the traditional 2-level x86 page tables and the
  6. * newer 3-level PAE-mode page tables.
  7. */
  8. #ifdef CONFIG_X86_PAE
  9. # include <asm/pgtable-3level_types.h>
  10. # define PMD_SIZE (1UL << PMD_SHIFT)
  11. # define PMD_MASK (~(PMD_SIZE - 1))
  12. #else
  13. # include <asm/pgtable-2level_types.h>
  14. #endif
  15. #define PGDIR_SIZE (1UL << PGDIR_SHIFT)
  16. #define PGDIR_MASK (~(PGDIR_SIZE - 1))
  17. /* Just any arbitrary offset to the start of the vmalloc VM area: the
  18. * current 8MB value just means that there will be a 8MB "hole" after the
  19. * physical memory until the kernel virtual memory starts. That means that
  20. * any out-of-bounds memory accesses will hopefully be caught.
  21. * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  22. * area for the same reason. ;)
  23. */
  24. #define VMALLOC_OFFSET (8 * 1024 * 1024)
  25. #ifndef __ASSEMBLY__
  26. extern bool __vmalloc_start_set; /* set once high_memory is set */
  27. #endif
  28. #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET)
  29. #ifdef CONFIG_X86_PAE
  30. #define LAST_PKMAP 512
  31. #else
  32. #define LAST_PKMAP 1024
  33. #endif
  34. #define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE * (LAST_PKMAP + 1)) \
  35. & PMD_MASK)
  36. #ifdef CONFIG_HIGHMEM
  37. # define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)
  38. #else
  39. # define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
  40. #endif
  41. #define MODULES_VADDR VMALLOC_START
  42. #define MODULES_END VMALLOC_END
  43. #define MODULES_LEN (MODULES_VADDR - MODULES_END)
  44. #define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
  45. #endif /* _ASM_X86_PGTABLE_32_DEFS_H */