]>
cvs.zerfleddert.de Git - ms2-kexec/blob - mmu.c
2 * linux/arch/arm/mm/mmu.c
4 * Copyright (C) 1995-2005 Russell King
5 * This Edition is maintained by Matthew Veety (aliasxerog) <mveety@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/init.h>
15 #include <linux/bootmem.h>
16 #include <linux/mman.h>
17 #include <linux/nodemask.h>
18 #include <linux/ioport.h>
21 #include <asm/cputype.h>
22 #include <asm/mach-types.h>
23 #include <asm/sections.h>
24 #include <asm/setup.h>
25 #include <asm/sizes.h>
27 #include <asm/pgtable.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/map.h>
35 * In order to soft-boot, we need to insert a 1:1 mapping in place of
36 * the user-mode pages. This will then ensure that we have predictable
37 * results when turning the mmu off
39 void setup_mm_for_reboot(char mode
)
41 unsigned long base_pmdval
;
45 pgd
= current
->mm
->pgd
;
47 base_pmdval
= PMD_SECT_AP_WRITE
| PMD_SECT_AP_READ
| PMD_TYPE_SECT
;
49 for (i
= 0; i
< FIRST_USER_PGD_NR
+ USER_PTRS_PER_PGD
; i
++, pgd
++) {
50 unsigned long pmdval
= (i
<< PGDIR_SHIFT
) | base_pmdval
;
53 pmd
= pmd_off(pgd
, i
<< PGDIR_SHIFT
);
54 pmd
[0] = __pmd(pmdval
);
55 pmd
[1] = __pmd(pmdval
+ (1 << (PGDIR_SHIFT
- 1)));
58 my_local_flush_tlb_all();