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-arm26/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-arm26/pgalloc.h')
-rw-r--r-- | include/asm-arm26/pgalloc.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/include/asm-arm26/pgalloc.h b/include/asm-arm26/pgalloc.h new file mode 100644 index 000000000000..6437167b1ffe --- /dev/null +++ b/include/asm-arm26/pgalloc.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/pgalloc.h | ||
3 | * | ||
4 | * Copyright (C) 2000-2001 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef _ASMARM_PGALLOC_H | ||
11 | #define _ASMARM_PGALLOC_H | ||
12 | |||
13 | #include <asm/processor.h> | ||
14 | #include <asm/cacheflush.h> | ||
15 | #include <asm/tlbflush.h> | ||
16 | #include <linux/slab.h> | ||
17 | |||
18 | extern kmem_cache_t *pte_cache; | ||
19 | |||
20 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr){ | ||
21 | return kmem_cache_alloc(pte_cache, GFP_KERNEL); | ||
22 | } | ||
23 | |||
24 | static inline void pte_free_kernel(pte_t *pte){ | ||
25 | if (pte) | ||
26 | kmem_cache_free(pte_cache, pte); | ||
27 | } | ||
28 | |||
29 | /* | ||
30 | * Populate the pmdp entry with a pointer to the pte. This pmd is part | ||
31 | * of the mm address space. | ||
32 | * | ||
33 | * If 'mm' is the init tasks mm, then we are doing a vmalloc, and we | ||
34 | * need to set stuff up correctly for it. | ||
35 | */ | ||
36 | static inline void | ||
37 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) | ||
38 | { | ||
39 | //FIXME - is this doing the right thing? | ||
40 | set_pmd(pmdp, (unsigned long)ptep | 1/*FIXME _PMD_PRESENT*/); | ||
41 | } | ||
42 | |||
43 | /* | ||
44 | * FIXME - We use the old 2.5.5-rmk1 hack for this. | ||
45 | * This is not truly correct, but should be functional. | ||
46 | */ | ||
47 | #define pte_alloc_one(mm,addr) ((struct page *)pte_alloc_one_kernel(mm,addr)) | ||
48 | #define pte_free(pte) pte_free_kernel((pte_t *)pte) | ||
49 | #define pmd_populate(mm,pmdp,ptep) pmd_populate_kernel(mm,pmdp,(pte_t *)ptep) | ||
50 | |||
51 | /* | ||
52 | * Since we have only two-level page tables, these are trivial | ||
53 | * | ||
54 | * trick __pmd_alloc into optimising away. The actual value is irrelevant though as it | ||
55 | * is thrown away. It just cant be zero. -IM | ||
56 | */ | ||
57 | |||
58 | #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) | ||
59 | #define pmd_free(pmd) do { } while (0) | ||
60 | #define pgd_populate(mm,pmd,pte) BUG() | ||
61 | |||
62 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); | ||
63 | extern void free_pgd_slow(pgd_t *pgd); | ||
64 | |||
65 | #define pgd_alloc(mm) get_pgd_slow(mm) | ||
66 | #define pgd_free(pgd) free_pgd_slow(pgd) | ||
67 | |||
68 | #define check_pgt_cache() do { } while (0) | ||
69 | |||
70 | #endif | ||