aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/init.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-22 06:52:47 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-22 06:52:49 -0400
commit3610cce87af0693603db171d5b6f6735f5e3dc5b (patch)
tree9aa7d9a0924b2f075c1b95ed57bb63ed512165c9 /arch/s390/mm/init.c
parente4aa402e7a3b6b87d8df6243a37171cdcd2f01c2 (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/init.c')
-rw-r--r--arch/s390/mm/init.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 3a25bbf2eb0a..90ec058aa7db 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -103,32 +103,28 @@ static void __init setup_ro_region(void)
103 */ 103 */
104void __init paging_init(void) 104void __init paging_init(void)
105{ 105{
106 pgd_t *pg_dir;
107 int i;
108 unsigned long pgdir_k;
109 static const int ssm_mask = 0x04000000L; 106 static const int ssm_mask = 0x04000000L;
110 unsigned long max_zone_pfns[MAX_NR_ZONES]; 107 unsigned long max_zone_pfns[MAX_NR_ZONES];
108 unsigned long pgd_type;
111 109
112 pg_dir = swapper_pg_dir; 110 init_mm.pgd = swapper_pg_dir;
113 111 S390_lowcore.kernel_asce = __pa(init_mm.pgd) & PAGE_MASK;
114#ifdef CONFIG_64BIT 112#ifdef CONFIG_64BIT
115 pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERN_REGION_TABLE; 113 S390_lowcore.kernel_asce |= _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH;
116 for (i = 0; i < PTRS_PER_PGD; i++) 114 pgd_type = _REGION3_ENTRY_EMPTY;
117 pgd_clear_kernel(pg_dir + i);
118#else 115#else
119 pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE; 116 S390_lowcore.kernel_asce |= _ASCE_TABLE_LENGTH;
120 for (i = 0; i < PTRS_PER_PGD; i++) 117 pgd_type = _SEGMENT_ENTRY_EMPTY;
121 pmd_clear_kernel((pmd_t *)(pg_dir + i));
122#endif 118#endif
119 clear_table((unsigned long *) init_mm.pgd, pgd_type,
120 sizeof(unsigned long)*2048);
123 vmem_map_init(); 121 vmem_map_init();
124 setup_ro_region(); 122 setup_ro_region();
125 123
126 S390_lowcore.kernel_asce = pgdir_k;
127
128 /* enable virtual mapping in kernel mode */ 124 /* enable virtual mapping in kernel mode */
129 __ctl_load(pgdir_k, 1, 1); 125 __ctl_load(S390_lowcore.kernel_asce, 1, 1);
130 __ctl_load(pgdir_k, 7, 7); 126 __ctl_load(S390_lowcore.kernel_asce, 7, 7);
131 __ctl_load(pgdir_k, 13, 13); 127 __ctl_load(S390_lowcore.kernel_asce, 13, 13);
132 __raw_local_irq_ssm(ssm_mask); 128 __raw_local_irq_ssm(ssm_mask);
133 129
134 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 130 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));