@@ -10,5 +10,6 @@
extern pgd_t *idmap_pgd;
void setup_mm_for_reboot(void);
+void idmap_prepare(void);
#endif /* __ASM_IDMAP_H */
@@ -75,17 +75,7 @@ static void __soft_restart(void *addr)
{
phys_reset_t phys_reset;
- /* Take out a flat memory mapping. */
- setup_mm_for_reboot();
-
- /* Clean and invalidate caches */
- flush_cache_all();
-
- /* Turn off caching */
- cpu_proc_fin();
-
- /* Push out any further dirty data, and ensure cache is empty */
- flush_cache_all();
+ idmap_prepare();
/* Switch to the identity mapping. */
phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
@@ -122,3 +122,18 @@ void setup_mm_for_reboot(void)
local_flush_tlb_all();
#endif
}
+
+void idmap_prepare(void)
+{
+ /* Take out a flat memory mapping. */
+ setup_mm_for_reboot();
+
+ /* Clean and invalidate caches */
+ flush_cache_all();
+
+ /* Turn off caching */
+ cpu_proc_fin();
+
+ /* Push out any further dirty data, and ensure cache is empty */
+ flush_cache_all();
+}