[MIPS] Remove CONFIG_BUILD_ELF64.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-sparc64 / pgalloc.h
blob12e4a273bd43adf54f6f12901ff1912305e6a0ce
1 /* $Id: pgalloc.h,v 1.30 2001/12/21 04:56:17 davem Exp $ */
2 #ifndef _SPARC64_PGALLOC_H
3 #define _SPARC64_PGALLOC_H
5 #include <linux/config.h>
6 #include <linux/kernel.h>
7 #include <linux/sched.h>
8 #include <linux/mm.h>
9 #include <linux/slab.h>
11 #include <asm/spitfire.h>
12 #include <asm/cpudata.h>
13 #include <asm/cacheflush.h>
14 #include <asm/page.h>
16 /* Page table allocation/freeing. */
17 extern kmem_cache_t *pgtable_cache;
19 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
21 return kmem_cache_alloc(pgtable_cache, GFP_KERNEL);
24 static inline void pgd_free(pgd_t *pgd)
26 kmem_cache_free(pgtable_cache, pgd);
29 #define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD)
31 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
33 return kmem_cache_alloc(pgtable_cache,
34 GFP_KERNEL|__GFP_REPEAT);
37 static inline void pmd_free(pmd_t *pmd)
39 kmem_cache_free(pgtable_cache, pmd);
42 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
43 unsigned long address)
45 return kmem_cache_alloc(pgtable_cache,
46 GFP_KERNEL|__GFP_REPEAT);
49 static inline struct page *pte_alloc_one(struct mm_struct *mm,
50 unsigned long address)
52 return virt_to_page(pte_alloc_one_kernel(mm, address));
55 static inline void pte_free_kernel(pte_t *pte)
57 kmem_cache_free(pgtable_cache, pte);
60 static inline void pte_free(struct page *ptepage)
62 pte_free_kernel(page_address(ptepage));
66 #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE)
67 #define pmd_populate(MM,PMD,PTE_PAGE) \
68 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE))
70 #define check_pgt_cache() do { } while (0)
72 #endif /* _SPARC64_PGALLOC_H */