[PATCH] RTC: class driver for Samsung S3C series SoC
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / asm-m32r / pgalloc.h
blobe09a86c3cadf44bf4266eece984c47dbf390b804
1 #ifndef _ASM_M32R_PGALLOC_H
2 #define _ASM_M32R_PGALLOC_H
4 /* $Id$ */
6 #include <linux/mm.h>
8 #include <asm/io.h>
10 #define pmd_populate_kernel(mm, pmd, pte) \
11 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
13 static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
14 struct page *pte)
16 set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte)));
20 * Allocate and free page tables.
22 static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
24 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
26 return pgd;
29 static __inline__ void pgd_free(pgd_t *pgd)
31 free_page((unsigned long)pgd);
34 static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
35 unsigned long address)
37 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
39 return pte;
42 static __inline__ struct page *pte_alloc_one(struct mm_struct *mm,
43 unsigned long address)
45 struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO);
48 return pte;
51 static __inline__ void pte_free_kernel(pte_t *pte)
53 free_page((unsigned long)pte);
56 static __inline__ void pte_free(struct page *pte)
58 __free_page(pte);
61 #define __pte_free_tlb(tlb, pte) pte_free((pte))
64 * allocating and freeing a pmd is trivial: the 1-entry pmd is
65 * inside the pgd, so has no extra memory associated with it.
66 * (In the PAE case we free the pmds as part of the pgd.)
69 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
70 #define pmd_free(x) do { } while (0)
71 #define __pmd_free_tlb(tlb, x) do { } while (0)
72 #define pgd_populate(mm, pmd, pte) BUG()
74 #define check_pgt_cache() do { } while (0)
76 #endif /* _ASM_M32R_PGALLOC_H */