patch-2.3.99-pre2 linux/arch/arm/mm/mm-armv.c
Next file: linux/arch/arm/mm/proc-arm6,7.S
Previous file: linux/arch/arm/mm/mm-armo.c
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
Sat Mar 18 11:38:04 2000
- Orig file:
v2.3.99-pre1/linux/arch/arm/mm/mm-armv.c
- Orig date:
Thu Mar 2 14:36:22 2000
diff -u --recursive --new-file v2.3.99-pre1/linux/arch/arm/mm/mm-armv.c linux/arch/arm/mm/mm-armv.c
@@ -3,7 +3,7 @@
*
* Page table sludge for ARM v3 and v4 processor architectures.
*
- * Copyright (C) 1998-1999 Russell King
+ * Copyright (C) 1998-2000 Russell King
*/
#include <linux/sched.h>
#include <linux/mm.h>
@@ -283,6 +283,25 @@
virt += PAGE_SIZE;
length -= PAGE_SIZE;
+ }
+}
+
+/*
+ * In order to soft-boot, we need to insert a 1:1 mapping in place of
+ * the user-mode pages. This will then ensure that we have predictable
+ * results when turning the mmu off
+ */
+void setup_mm_for_reboot(char mode)
+{
+ pgd_t *pgd = current->mm->pgd;
+ pmd_t pmd;
+ int i;
+
+ for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
+ pmd_val(pmd) = (i << PGDIR_SHIFT) |
+ PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
+ PMD_TYPE_SECT;
+ set_pmd(pmd_offset(pgd + i, i << PGDIR_SHIFT), pmd);
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)