diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-22 06:52:47 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-22 06:52:49 -0400 |
commit | 3610cce87af0693603db171d5b6f6735f5e3dc5b (patch) | |
tree | 9aa7d9a0924b2f075c1b95ed57bb63ed512165c9 /arch/s390/mm/vmem.c | |
parent | e4aa402e7a3b6b87d8df6243a37171cdcd2f01c2 (diff) |
[S390] Cleanup page table definitions.
- De-confuse the defines for the address-space-control-elements
and the segment/region table entries.
- Create out of line functions for page table allocation / freeing.
- Simplify get_shadow_xxx functions.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/vmem.c')
-rw-r--r-- | arch/s390/mm/vmem.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index fd594d5fe142..1bd51d840484 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c | |||
@@ -75,29 +75,24 @@ static void __init_refok *vmem_alloc_pages(unsigned int order) | |||
75 | 75 | ||
76 | static inline pmd_t *vmem_pmd_alloc(void) | 76 | static inline pmd_t *vmem_pmd_alloc(void) |
77 | { | 77 | { |
78 | pmd_t *pmd; | 78 | pmd_t *pmd = NULL; |
79 | int i; | ||
80 | 79 | ||
81 | pmd = vmem_alloc_pages(PMD_ALLOC_ORDER); | 80 | #ifdef CONFIG_64BIT |
81 | pmd = vmem_alloc_pages(2); | ||
82 | if (!pmd) | 82 | if (!pmd) |
83 | return NULL; | 83 | return NULL; |
84 | for (i = 0; i < PTRS_PER_PMD; i++) | 84 | clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE*4); |
85 | pmd_clear_kernel(pmd + i); | 85 | #endif |
86 | return pmd; | 86 | return pmd; |
87 | } | 87 | } |
88 | 88 | ||
89 | static inline pte_t *vmem_pte_alloc(void) | 89 | static inline pte_t *vmem_pte_alloc(void) |
90 | { | 90 | { |
91 | pte_t *pte; | 91 | pte_t *pte = vmem_alloc_pages(0); |
92 | pte_t empty_pte; | ||
93 | int i; | ||
94 | 92 | ||
95 | pte = vmem_alloc_pages(PTE_ALLOC_ORDER); | ||
96 | if (!pte) | 93 | if (!pte) |
97 | return NULL; | 94 | return NULL; |
98 | pte_val(empty_pte) = _PAGE_TYPE_EMPTY; | 95 | clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY, PAGE_SIZE); |
99 | for (i = 0; i < PTRS_PER_PTE; i++) | ||
100 | pte[i] = empty_pte; | ||
101 | return pte; | 96 | return pte; |
102 | } | 97 | } |
103 | 98 | ||