#ifndef _ASM_PGALLOC_H #define _ASM_PGALLOC_H #include #include #include #include #include #include #include /* Allocate the top level pgd (page directory) * * Here (for 64 bit kernels) we implement a Hybrid L2/L3 scheme: we * allocate the first pmd adjacent to the pgd. This means that we can * subtract a constant offset to get to it. The pmd and pgd sizes are * arranged so that a single pmd covers 4GB (giving a full LP64 * process access to 8TB) so our lookups are effectively L2 for the * first 4GB of the kernel (i.e. for all ILP32 processes and all the * kernel for machines with under 4GB of memory) */ static inline pgd_t *pgd_alloc(struct mm_struct *mm) { pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL|GFP_DMA, PGD_ALLOC_ORDER); pgd_t *actual_pgd = pgd; if (likely(pgd != NULL)) { memset(pgd, 0, PAGE_SIZE<