diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-11-21 11:27:49 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-21 14:24:14 -0500 |
commit | 516295e5ab4bf986865cfff856d484ec678e3b0b (patch) | |
tree | 2125f49635462fca18ac6d36ebf7363d3cc6d521 /arch/arm/mm/mmu.c | |
parent | f60892d3e36dcdd0d9f30db05beae7a446a93f28 (diff) |
ARM: pgtable: add pud-level code
Add pud_offset() et.al. between the pgd and pmd code in preparation of
using pgtable-nopud.h rather than 4level-fixup.h.
This incorporates a fix from Jamie Iles <jamie@jamieiles.com> for
uaccess_with_memcpy.c.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 176749010935..82ef6966ae09 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -550,11 +550,11 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | |||
550 | } while (pte++, addr += PAGE_SIZE, addr != end); | 550 | } while (pte++, addr += PAGE_SIZE, addr != end); |
551 | } | 551 | } |
552 | 552 | ||
553 | static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | 553 | static void __init alloc_init_section(pud_t *pud, unsigned long addr, |
554 | unsigned long end, phys_addr_t phys, | 554 | unsigned long end, phys_addr_t phys, |
555 | const struct mem_type *type) | 555 | const struct mem_type *type) |
556 | { | 556 | { |
557 | pmd_t *pmd = pmd_offset(pgd, addr); | 557 | pmd_t *pmd = pmd_offset(pud, addr); |
558 | 558 | ||
559 | /* | 559 | /* |
560 | * Try a section mapping - end, addr and phys must all be aligned | 560 | * Try a section mapping - end, addr and phys must all be aligned |
@@ -583,6 +583,19 @@ static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | |||
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
586 | static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, | ||
587 | unsigned long phys, const struct mem_type *type) | ||
588 | { | ||
589 | pud_t *pud = pud_offset(pgd, addr); | ||
590 | unsigned long next; | ||
591 | |||
592 | do { | ||
593 | next = pud_addr_end(addr, end); | ||
594 | alloc_init_section(pud, addr, next, phys, type); | ||
595 | phys += next - addr; | ||
596 | } while (pud++, addr = next, addr != end); | ||
597 | } | ||
598 | |||
586 | static void __init create_36bit_mapping(struct map_desc *md, | 599 | static void __init create_36bit_mapping(struct map_desc *md, |
587 | const struct mem_type *type) | 600 | const struct mem_type *type) |
588 | { | 601 | { |
@@ -630,7 +643,8 @@ static void __init create_36bit_mapping(struct map_desc *md, | |||
630 | pgd = pgd_offset_k(addr); | 643 | pgd = pgd_offset_k(addr); |
631 | end = addr + length; | 644 | end = addr + length; |
632 | do { | 645 | do { |
633 | pmd_t *pmd = pmd_offset(pgd, addr); | 646 | pud_t *pud = pud_offset(pgd, addr); |
647 | pmd_t *pmd = pmd_offset(pud, addr); | ||
634 | int i; | 648 | int i; |
635 | 649 | ||
636 | for (i = 0; i < 16; i++) | 650 | for (i = 0; i < 16; i++) |
@@ -696,7 +710,7 @@ static void __init create_mapping(struct map_desc *md) | |||
696 | do { | 710 | do { |
697 | unsigned long next = pgd_addr_end(addr, end); | 711 | unsigned long next = pgd_addr_end(addr, end); |
698 | 712 | ||
699 | alloc_init_section(pgd, addr, next, phys, type); | 713 | alloc_init_pud(pgd, addr, next, phys, type); |
700 | 714 | ||
701 | phys += next - addr; | 715 | phys += next - addr; |
702 | addr = next; | 716 | addr = next; |