diff options
Diffstat (limited to 'arch/um/kernel/mem.c')
-rw-r--r-- | arch/um/kernel/mem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 3eddc2091d4d..663011c2983f 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -132,7 +132,7 @@ static void __init fixrange_init(unsigned long start, unsigned long end, | |||
132 | if (pud_none(*pud)) | 132 | if (pud_none(*pud)) |
133 | one_md_table_init(pud); | 133 | one_md_table_init(pud); |
134 | pmd = pmd_offset(pud, vaddr); | 134 | pmd = pmd_offset(pud, vaddr); |
135 | for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { | 135 | for (; (j < PTRS_PER_PMD) && (vaddr < end); pmd++, j++) { |
136 | one_page_table_init(pmd); | 136 | one_page_table_init(pmd); |
137 | vaddr += PMD_SIZE; | 137 | vaddr += PMD_SIZE; |
138 | } | 138 | } |
@@ -191,22 +191,23 @@ static void __init fixaddr_user_init( void) | |||
191 | pud_t *pud; | 191 | pud_t *pud; |
192 | pmd_t *pmd; | 192 | pmd_t *pmd; |
193 | pte_t *pte; | 193 | pte_t *pte; |
194 | unsigned long paddr, vaddr = FIXADDR_USER_START; | 194 | phys_t p; |
195 | unsigned long v, vaddr = FIXADDR_USER_START; | ||
195 | 196 | ||
196 | if ( ! size ) | 197 | if (!size) |
197 | return; | 198 | return; |
198 | 199 | ||
199 | fixrange_init( FIXADDR_USER_START, FIXADDR_USER_END, swapper_pg_dir); | 200 | fixrange_init( FIXADDR_USER_START, FIXADDR_USER_END, swapper_pg_dir); |
200 | paddr = (unsigned long)alloc_bootmem_low_pages( size); | 201 | v = (unsigned long) alloc_bootmem_low_pages(size); |
201 | memcpy( (void *)paddr, (void *)FIXADDR_USER_START, size); | 202 | memcpy((void *) v , (void *) FIXADDR_USER_START, size); |
202 | paddr = __pa(paddr); | 203 | p = __pa(v); |
203 | for ( ; size > 0; size -= PAGE_SIZE, vaddr += PAGE_SIZE, | 204 | for ( ; size > 0; size -= PAGE_SIZE, vaddr += PAGE_SIZE, |
204 | paddr += PAGE_SIZE) { | 205 | p += PAGE_SIZE) { |
205 | pgd = swapper_pg_dir + pgd_index(vaddr); | 206 | pgd = swapper_pg_dir + pgd_index(vaddr); |
206 | pud = pud_offset(pgd, vaddr); | 207 | pud = pud_offset(pgd, vaddr); |
207 | pmd = pmd_offset(pud, vaddr); | 208 | pmd = pmd_offset(pud, vaddr); |
208 | pte = pte_offset_kernel(pmd, vaddr); | 209 | pte = pte_offset_kernel(pmd, vaddr); |
209 | pte_set_val( (*pte), paddr, PAGE_READONLY); | 210 | pte_set_val(*pte, p, PAGE_READONLY); |
210 | } | 211 | } |
211 | #endif | 212 | #endif |
212 | } | 213 | } |