aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/pgalloc.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-alpha/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-alpha/pgalloc.h')
-rw-r--r--include/asm-alpha/pgalloc.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
new file mode 100644
index 000000000000..308475642913
--- /dev/null
+++ b/include/asm-alpha/pgalloc.h
@@ -0,0 +1,78 @@
1#ifndef _ALPHA_PGALLOC_H
2#define _ALPHA_PGALLOC_H
3
4#include <linux/config.h>
5#include <linux/mm.h>
6#include <linux/mmzone.h>
7
8/*
9 * Allocate and free page tables. The xxx_kernel() versions are
10 * used to allocate a kernel page table - this turns on ASN bits
11 * if any.
12 */
13
14static inline void
15pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
16{
17 pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
18}
19
20static inline void
21pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
22{
23 pmd_set(pmd, pte);
24}
25
26static inline void
27pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
28{
29 pgd_set(pgd, pmd);
30}
31
32extern pgd_t *pgd_alloc(struct mm_struct *mm);
33
34static inline void
35pgd_free(pgd_t *pgd)
36{
37 free_page((unsigned long)pgd);
38}
39
40static inline pmd_t *
41pmd_alloc_one(struct mm_struct *mm, unsigned long address)
42{
43 pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
44 return ret;
45}
46
47static inline void
48pmd_free(pmd_t *pmd)
49{
50 free_page((unsigned long)pmd);
51}
52
53extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
54
55static inline void
56pte_free_kernel(pte_t *pte)
57{
58 free_page((unsigned long)pte);
59}
60
61static inline struct page *
62pte_alloc_one(struct mm_struct *mm, unsigned long addr)
63{
64 pte_t *pte = pte_alloc_one_kernel(mm, addr);
65 if (pte)
66 return virt_to_page(pte);
67 return NULL;
68}
69
70static inline void
71pte_free(struct page *page)
72{
73 __free_page(page);
74}
75
76#define check_pgt_cache() do { } while (0)
77
78#endif /* _ALPHA_PGALLOC_H */