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/kernel/smp.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/kernel/smp.c')
-rw-r--r-- | arch/arm/kernel/smp.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 46313805f430..73cef403352a 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -68,40 +68,6 @@ enum ipi_msg_type { | |||
68 | IPI_CPU_STOP, | 68 | IPI_CPU_STOP, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static inline void identity_mapping_add(pgd_t *pgd, unsigned long start, | ||
72 | unsigned long end) | ||
73 | { | ||
74 | unsigned long addr, prot; | ||
75 | pmd_t *pmd; | ||
76 | |||
77 | prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE; | ||
78 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) | ||
79 | prot |= PMD_BIT4; | ||
80 | |||
81 | for (addr = start & PGDIR_MASK; addr < end;) { | ||
82 | pmd = pmd_offset(pgd + pgd_index(addr), addr); | ||
83 | pmd[0] = __pmd(addr | prot); | ||
84 | addr += SECTION_SIZE; | ||
85 | pmd[1] = __pmd(addr | prot); | ||
86 | addr += SECTION_SIZE; | ||
87 | flush_pmd_entry(pmd); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | static inline void identity_mapping_del(pgd_t *pgd, unsigned long start, | ||
92 | unsigned long end) | ||
93 | { | ||
94 | unsigned long addr; | ||
95 | pmd_t *pmd; | ||
96 | |||
97 | for (addr = start & PGDIR_MASK; addr < end; addr += PGDIR_SIZE) { | ||
98 | pmd = pmd_offset(pgd + pgd_index(addr), addr); | ||
99 | pmd[0] = __pmd(0); | ||
100 | pmd[1] = __pmd(0); | ||
101 | clean_pmd_entry(pmd); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | int __cpuinit __cpu_up(unsigned int cpu) | 71 | int __cpuinit __cpu_up(unsigned int cpu) |
106 | { | 72 | { |
107 | struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); | 73 | struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); |