diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-m32r/pgalloc.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-m32r/pgalloc.h')
-rw-r--r-- | include/asm-m32r/pgalloc.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h new file mode 100644 index 000000000000..6da309b6fda7 --- /dev/null +++ b/include/asm-m32r/pgalloc.h | |||
@@ -0,0 +1,78 @@ | |||
1 | #ifndef _ASM_M32R_PGALLOC_H | ||
2 | #define _ASM_M32R_PGALLOC_H | ||
3 | |||
4 | /* $Id$ */ | ||
5 | |||
6 | #include <linux/config.h> | ||
7 | #include <linux/mm.h> | ||
8 | |||
9 | #include <asm/io.h> | ||
10 | |||
11 | #define pmd_populate_kernel(mm, pmd, pte) \ | ||
12 | set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) | ||
13 | |||
14 | static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | ||
15 | struct page *pte) | ||
16 | { | ||
17 | set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte))); | ||
18 | } | ||
19 | |||
20 | /* | ||
21 | * Allocate and free page tables. | ||
22 | */ | ||
23 | static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | ||
24 | { | ||
25 | pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); | ||
26 | |||
27 | return pgd; | ||
28 | } | ||
29 | |||
30 | static __inline__ void pgd_free(pgd_t *pgd) | ||
31 | { | ||
32 | free_page((unsigned long)pgd); | ||
33 | } | ||
34 | |||
35 | static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | ||
36 | unsigned long address) | ||
37 | { | ||
38 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); | ||
39 | |||
40 | return pte; | ||
41 | } | ||
42 | |||
43 | static __inline__ struct page *pte_alloc_one(struct mm_struct *mm, | ||
44 | unsigned long address) | ||
45 | { | ||
46 | struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO); | ||
47 | |||
48 | |||
49 | return pte; | ||
50 | } | ||
51 | |||
52 | static __inline__ void pte_free_kernel(pte_t *pte) | ||
53 | { | ||
54 | free_page((unsigned long)pte); | ||
55 | } | ||
56 | |||
57 | static __inline__ void pte_free(struct page *pte) | ||
58 | { | ||
59 | __free_page(pte); | ||
60 | } | ||
61 | |||
62 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | ||
63 | |||
64 | /* | ||
65 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | ||
66 | * inside the pgd, so has no extra memory associated with it. | ||
67 | * (In the PAE case we free the pmds as part of the pgd.) | ||
68 | */ | ||
69 | |||
70 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | ||
71 | #define pmd_free(x) do { } while (0) | ||
72 | #define __pmd_free_tlb(tlb, x) do { } while (0) | ||
73 | #define pgd_populate(mm, pmd, pte) BUG() | ||
74 | |||
75 | #define check_pgt_cache() do { } while (0) | ||
76 | |||
77 | #endif /* _ASM_M32R_PGALLOC_H */ | ||
78 | |||