.. | .. |
---|
4 | 4 | |
---|
5 | 5 | #include <linux/kernel.h> |
---|
6 | 6 | #include <linux/sched.h> |
---|
| 7 | +#include <linux/pgtable.h> |
---|
7 | 8 | |
---|
8 | 9 | #include <asm/pgtsrmmu.h> |
---|
9 | | -#include <asm/pgtable.h> |
---|
10 | 10 | #include <asm/vaddrs.h> |
---|
11 | 11 | #include <asm/page.h> |
---|
12 | 12 | |
---|
.. | .. |
---|
17 | 17 | |
---|
18 | 18 | extern struct resource sparc_iomap; |
---|
19 | 19 | |
---|
20 | | -#define check_pgt_cache() do { } while (0) |
---|
21 | | - |
---|
22 | 20 | pgd_t *get_pgd_fast(void); |
---|
23 | 21 | static inline void free_pgd_fast(pgd_t *pgd) |
---|
24 | 22 | { |
---|
.. | .. |
---|
28 | 26 | #define pgd_free(mm, pgd) free_pgd_fast(pgd) |
---|
29 | 27 | #define pgd_alloc(mm) get_pgd_fast() |
---|
30 | 28 | |
---|
31 | | -static inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp) |
---|
| 29 | +static inline void pud_set(pud_t * pudp, pmd_t * pmdp) |
---|
32 | 30 | { |
---|
33 | 31 | unsigned long pa = __nocache_pa(pmdp); |
---|
34 | 32 | |
---|
35 | | - set_pte((pte_t *)pgdp, __pte((SRMMU_ET_PTD | (pa >> 4)))); |
---|
| 33 | + set_pte((pte_t *)pudp, __pte((SRMMU_ET_PTD | (pa >> 4)))); |
---|
36 | 34 | } |
---|
37 | 35 | |
---|
38 | | -#define pgd_populate(MM, PGD, PMD) pgd_set(PGD, PMD) |
---|
| 36 | +#define pud_populate(MM, PGD, PMD) pud_set(PGD, PMD) |
---|
39 | 37 | |
---|
40 | 38 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, |
---|
41 | 39 | unsigned long address) |
---|
.. | .. |
---|
52 | 50 | #define pmd_free(mm, pmd) free_pmd_fast(pmd) |
---|
53 | 51 | #define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd) |
---|
54 | 52 | |
---|
55 | | -void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep); |
---|
56 | | -#define pmd_pgtable(pmd) pmd_page(pmd) |
---|
| 53 | +#define pmd_populate(mm, pmd, pte) pmd_set(pmd, pte) |
---|
| 54 | +#define pmd_pgtable(pmd) (pgtable_t)__pmd_page(pmd) |
---|
57 | 55 | |
---|
58 | 56 | void pmd_set(pmd_t *pmdp, pte_t *ptep); |
---|
59 | | -#define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) |
---|
| 57 | +#define pmd_populate_kernel pmd_populate |
---|
60 | 58 | |
---|
61 | | -pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address); |
---|
| 59 | +pgtable_t pte_alloc_one(struct mm_struct *mm); |
---|
62 | 60 | |
---|
63 | | -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
---|
64 | | - unsigned long address) |
---|
| 61 | +static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) |
---|
65 | 62 | { |
---|
66 | | - return srmmu_get_nocache(PTE_SIZE, PTE_SIZE); |
---|
| 63 | + return srmmu_get_nocache(SRMMU_PTE_TABLE_SIZE, |
---|
| 64 | + SRMMU_PTE_TABLE_SIZE); |
---|
67 | 65 | } |
---|
68 | 66 | |
---|
69 | 67 | |
---|
70 | 68 | static inline void free_pte_fast(pte_t *pte) |
---|
71 | 69 | { |
---|
72 | | - srmmu_free_nocache(pte, PTE_SIZE); |
---|
| 70 | + srmmu_free_nocache(pte, SRMMU_PTE_TABLE_SIZE); |
---|
73 | 71 | } |
---|
74 | 72 | |
---|
75 | 73 | #define pte_free_kernel(mm, pte) free_pte_fast(pte) |
---|