Back to home page

OSCL-LXR

 
 

    


0001 #ifndef _ASM_X86_PGTABLE_32_AREAS_H
0002 #define _ASM_X86_PGTABLE_32_AREAS_H
0003 
0004 #include <asm/cpu_entry_area.h>
0005 
0006 /*
0007  * Just any arbitrary offset to the start of the vmalloc VM area: the
0008  * current 8MB value just means that there will be a 8MB "hole" after the
0009  * physical memory until the kernel virtual memory starts.  That means that
0010  * any out-of-bounds memory accesses will hopefully be caught.
0011  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
0012  * area for the same reason. ;)
0013  */
0014 #define VMALLOC_OFFSET  (8 * 1024 * 1024)
0015 
0016 #ifndef __ASSEMBLY__
0017 extern bool __vmalloc_start_set; /* set once high_memory is set */
0018 #endif
0019 
0020 #define VMALLOC_START   ((unsigned long)high_memory + VMALLOC_OFFSET)
0021 #ifdef CONFIG_X86_PAE
0022 #define LAST_PKMAP 512
0023 #else
0024 #define LAST_PKMAP 1024
0025 #endif
0026 
0027 #define CPU_ENTRY_AREA_PAGES        (NR_CPUS * DIV_ROUND_UP(sizeof(struct cpu_entry_area), PAGE_SIZE))
0028 
0029 /* The +1 is for the readonly IDT page: */
0030 #define CPU_ENTRY_AREA_BASE \
0031     ((FIXADDR_TOT_START - PAGE_SIZE*(CPU_ENTRY_AREA_PAGES+1)) & PMD_MASK)
0032 
0033 #define LDT_BASE_ADDR       \
0034     ((CPU_ENTRY_AREA_BASE - PAGE_SIZE) & PMD_MASK)
0035 
0036 #define LDT_END_ADDR        (LDT_BASE_ADDR + PMD_SIZE)
0037 
0038 #define PKMAP_BASE      \
0039     ((LDT_BASE_ADDR - PAGE_SIZE) & PMD_MASK)
0040 
0041 #ifdef CONFIG_HIGHMEM
0042 # define VMALLOC_END    (PKMAP_BASE - 2 * PAGE_SIZE)
0043 #else
0044 # define VMALLOC_END    (LDT_BASE_ADDR - 2 * PAGE_SIZE)
0045 #endif
0046 
0047 #define MODULES_VADDR   VMALLOC_START
0048 #define MODULES_END VMALLOC_END
0049 #define MODULES_LEN (MODULES_VADDR - MODULES_END)
0050 
0051 #define MAXMEM  (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
0052 
0053 #endif /* _ASM_X86_PGTABLE_32_AREAS_H */