diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-11-21 06:41:57 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-22 06:05:33 -0500 |
commit | 614dd0585f376a25c638abbed9c5fbd21d7baece (patch) | |
tree | 9bd2c8bb3523632901e3ddc3f9b1eba24e7671ab /arch/arm/mm/mmu.c | |
parent | 26bbf0b57a0848932f725076bcb1245ca696e8d3 (diff) |
ARM: pgtable: collect up identity mapping functions
We have two places where we create identity mappings - one when we bring
secondary CPUs online, and one where we setup some mappings for soft-
reboot. Combine these two into a single implementation. Also collect
the identity mapping deletion function.
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 | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 94ee0930d690..bd1a11e62f4e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -1045,38 +1045,3 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1045 | empty_zero_page = virt_to_page(zero_page); | 1045 | empty_zero_page = virt_to_page(zero_page); |
1046 | __flush_dcache_page(NULL, empty_zero_page); | 1046 | __flush_dcache_page(NULL, empty_zero_page); |
1047 | } | 1047 | } |
1048 | |||
1049 | /* | ||
1050 | * In order to soft-boot, we need to insert a 1:1 mapping in place of | ||
1051 | * the user-mode pages. This will then ensure that we have predictable | ||
1052 | * results when turning the mmu off | ||
1053 | */ | ||
1054 | void setup_mm_for_reboot(char mode) | ||
1055 | { | ||
1056 | unsigned long base_pmdval; | ||
1057 | pgd_t *pgd; | ||
1058 | int i; | ||
1059 | |||
1060 | /* | ||
1061 | * We need to access to user-mode page tables here. For kernel threads | ||
1062 | * we don't have any user-mode mappings so we use the context that we | ||
1063 | * "borrowed". | ||
1064 | */ | ||
1065 | pgd = current->active_mm->pgd; | ||
1066 | |||
1067 | base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; | ||
1068 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) | ||
1069 | base_pmdval |= PMD_BIT4; | ||
1070 | |||
1071 | for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { | ||
1072 | unsigned long pmdval = (i << PGDIR_SHIFT) | base_pmdval; | ||
1073 | pmd_t *pmd; | ||
1074 | |||
1075 | pmd = pmd_off(pgd, i << PGDIR_SHIFT); | ||
1076 | pmd[0] = __pmd(pmdval); | ||
1077 | pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1))); | ||
1078 | flush_pmd_entry(pmd); | ||
1079 | } | ||
1080 | |||
1081 | local_flush_tlb_all(); | ||
1082 | } | ||