[ARM] nommu: Move hardware page table definitions to pgtable-hwdef.h

Move the hardware PMD and PTE page table definitions from pgtable.h
into pgtable-hwdef.h, and include pgtable-hwdef.h as necessary.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
74945c86 0f44ba1d

+108 -80
+1
arch/arm/mach-sa1100/assabet.c
··· 26 26 #include <asm/irq.h> 27 27 #include <asm/setup.h> 28 28 #include <asm/page.h> 29 + #include <asm/pgtable-hwdef.h> 29 30 #include <asm/pgtable.h> 30 31 #include <asm/tlbflush.h> 31 32
+1
arch/arm/mm/proc-arm1020.S
··· 29 29 #include <linux/init.h> 30 30 #include <asm/assembler.h> 31 31 #include <asm/asm-offsets.h> 32 + #include <asm/pgtable-hwdef.h> 32 33 #include <asm/pgtable.h> 33 34 #include <asm/procinfo.h> 34 35 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm1020e.S
··· 29 29 #include <linux/init.h> 30 30 #include <asm/assembler.h> 31 31 #include <asm/asm-offsets.h> 32 + #include <asm/pgtable-hwdef.h> 32 33 #include <asm/pgtable.h> 33 34 #include <asm/procinfo.h> 34 35 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm1022.S
··· 18 18 #include <linux/init.h> 19 19 #include <asm/assembler.h> 20 20 #include <asm/asm-offsets.h> 21 + #include <asm/pgtable-hwdef.h> 21 22 #include <asm/pgtable.h> 22 23 #include <asm/procinfo.h> 23 24 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm1026.S
··· 18 18 #include <linux/init.h> 19 19 #include <asm/assembler.h> 20 20 #include <asm/asm-offsets.h> 21 + #include <asm/pgtable-hwdef.h> 21 22 #include <asm/pgtable.h> 22 23 #include <asm/procinfo.h> 23 24 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm6_7.S
··· 14 14 #include <linux/init.h> 15 15 #include <asm/assembler.h> 16 16 #include <asm/asm-offsets.h> 17 + #include <asm/pgtable-hwdef.h> 17 18 #include <asm/pgtable.h> 18 19 #include <asm/procinfo.h> 19 20 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm720.S
··· 34 34 #include <linux/init.h> 35 35 #include <asm/assembler.h> 36 36 #include <asm/asm-offsets.h> 37 + #include <asm/pgtable-hwdef.h> 37 38 #include <asm/pgtable.h> 38 39 #include <asm/procinfo.h> 39 40 #include <asm/ptrace.h>
+1
arch/arm/mm/proc-arm920.S
··· 28 28 #include <linux/config.h> 29 29 #include <linux/init.h> 30 30 #include <asm/assembler.h> 31 + #include <asm/pgtable-hwdef.h> 31 32 #include <asm/pgtable.h> 32 33 #include <asm/procinfo.h> 33 34 #include <asm/hardware.h>
+1
arch/arm/mm/proc-arm922.S
··· 29 29 #include <linux/config.h> 30 30 #include <linux/init.h> 31 31 #include <asm/assembler.h> 32 + #include <asm/pgtable-hwdef.h> 32 33 #include <asm/pgtable.h> 33 34 #include <asm/procinfo.h> 34 35 #include <asm/hardware.h>
+1
arch/arm/mm/proc-arm925.S
··· 51 51 #include <linux/config.h> 52 52 #include <linux/init.h> 53 53 #include <asm/assembler.h> 54 + #include <asm/pgtable-hwdef.h> 54 55 #include <asm/pgtable.h> 55 56 #include <asm/procinfo.h> 56 57 #include <asm/hardware.h>
+1
arch/arm/mm/proc-arm926.S
··· 28 28 #include <linux/config.h> 29 29 #include <linux/init.h> 30 30 #include <asm/assembler.h> 31 + #include <asm/pgtable-hwdef.h> 31 32 #include <asm/pgtable.h> 32 33 #include <asm/procinfo.h> 33 34 #include <asm/hardware.h>
+1
arch/arm/mm/proc-sa110.S
··· 18 18 #include <asm/asm-offsets.h> 19 19 #include <asm/procinfo.h> 20 20 #include <asm/hardware.h> 21 + #include <asm/pgtable-hwdef.h> 21 22 #include <asm/pgtable.h> 22 23 #include <asm/ptrace.h> 23 24
+1
arch/arm/mm/proc-sa1100.S
··· 23 23 #include <asm/asm-offsets.h> 24 24 #include <asm/procinfo.h> 25 25 #include <asm/hardware.h> 26 + #include <asm/pgtable-hwdef.h> 26 27 #include <asm/pgtable.h> 27 28 28 29 /*
+1
arch/arm/mm/proc-v6.S
··· 14 14 #include <asm/asm-offsets.h> 15 15 #include <asm/hardware/arm_scu.h> 16 16 #include <asm/procinfo.h> 17 + #include <asm/pgtable-hwdef.h> 17 18 #include <asm/pgtable.h> 18 19 19 20 #include "proc-macros.S"
+1
arch/arm/mm/proc-xscale.S
··· 25 25 #include <asm/assembler.h> 26 26 #include <asm/procinfo.h> 27 27 #include <asm/hardware.h> 28 + #include <asm/pgtable-hwdef.h> 28 29 #include <asm/pgtable.h> 29 30 #include <asm/page.h> 30 31 #include <asm/ptrace.h>
+5
include/asm-arm/pgalloc.h
··· 10 10 #ifndef _ASMARM_PGALLOC_H 11 11 #define _ASMARM_PGALLOC_H 12 12 13 + #include <asm/domain.h> 14 + #include <asm/pgtable-hwdef.h> 13 15 #include <asm/processor.h> 14 16 #include <asm/cacheflush.h> 15 17 #include <asm/tlbflush.h> 18 + 19 + #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) 20 + #define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) 16 21 17 22 /* 18 23 * Since we have only two-level page tables, these are trivial
+88
include/asm-arm/pgtable-hwdef.h
··· 1 + /* 2 + * linux/include/asm-arm/pgtable-hwdef.h 3 + * 4 + * Copyright (C) 1995-2002 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef _ASMARM_PGTABLE_HWDEF_H 11 + #define _ASMARM_PGTABLE_HWDEF_H 12 + 13 + /* 14 + * Hardware page table definitions. 15 + * 16 + * + Level 1 descriptor (PMD) 17 + * - common 18 + */ 19 + #define PMD_TYPE_MASK (3 << 0) 20 + #define PMD_TYPE_FAULT (0 << 0) 21 + #define PMD_TYPE_TABLE (1 << 0) 22 + #define PMD_TYPE_SECT (2 << 0) 23 + #define PMD_BIT4 (1 << 4) 24 + #define PMD_DOMAIN(x) ((x) << 5) 25 + #define PMD_PROTECTION (1 << 9) /* v5 */ 26 + /* 27 + * - section 28 + */ 29 + #define PMD_SECT_BUFFERABLE (1 << 2) 30 + #define PMD_SECT_CACHEABLE (1 << 3) 31 + #define PMD_SECT_AP_WRITE (1 << 10) 32 + #define PMD_SECT_AP_READ (1 << 11) 33 + #define PMD_SECT_TEX(x) ((x) << 12) /* v5 */ 34 + #define PMD_SECT_APX (1 << 15) /* v6 */ 35 + #define PMD_SECT_S (1 << 16) /* v6 */ 36 + #define PMD_SECT_nG (1 << 17) /* v6 */ 37 + #define PMD_SECT_SUPER (1 << 18) /* v6 */ 38 + 39 + #define PMD_SECT_UNCACHED (0) 40 + #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) 41 + #define PMD_SECT_WT (PMD_SECT_CACHEABLE) 42 + #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 43 + #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) 44 + #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 45 + #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) 46 + 47 + /* 48 + * - coarse table (not used) 49 + */ 50 + 51 + /* 52 + * + Level 2 descriptor (PTE) 53 + * - common 54 + */ 55 + #define PTE_TYPE_MASK (3 << 0) 56 + #define PTE_TYPE_FAULT (0 << 0) 57 + #define PTE_TYPE_LARGE (1 << 0) 58 + #define PTE_TYPE_SMALL (2 << 0) 59 + #define PTE_TYPE_EXT (3 << 0) /* v5 */ 60 + #define PTE_BUFFERABLE (1 << 2) 61 + #define PTE_CACHEABLE (1 << 3) 62 + 63 + /* 64 + * - extended small page/tiny page 65 + */ 66 + #define PTE_EXT_XN (1 << 0) /* v6 */ 67 + #define PTE_EXT_AP_MASK (3 << 4) 68 + #define PTE_EXT_AP0 (1 << 4) 69 + #define PTE_EXT_AP1 (2 << 4) 70 + #define PTE_EXT_AP_UNO_SRO (0 << 4) 71 + #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) 72 + #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) 73 + #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 74 + #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 75 + #define PTE_EXT_APX (1 << 9) /* v6 */ 76 + #define PTE_EXT_SHARED (1 << 10) /* v6 */ 77 + #define PTE_EXT_NG (1 << 11) /* v6 */ 78 + 79 + /* 80 + * - small page 81 + */ 82 + #define PTE_SMALL_AP_MASK (0xff << 4) 83 + #define PTE_SMALL_AP_UNO_SRO (0x00 << 4) 84 + #define PTE_SMALL_AP_UNO_SRW (0x55 << 4) 85 + #define PTE_SMALL_AP_URO_SRW (0xaa << 4) 86 + #define PTE_SMALL_AP_URW_SRW (0xff << 4) 87 + 88 + #endif
-80
include/asm-arm/pgtable.h
··· 137 137 #define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1)) 138 138 139 139 /* 140 - * Hardware page table definitions. 141 - * 142 - * + Level 1 descriptor (PMD) 143 - * - common 144 - */ 145 - #define PMD_TYPE_MASK (3 << 0) 146 - #define PMD_TYPE_FAULT (0 << 0) 147 - #define PMD_TYPE_TABLE (1 << 0) 148 - #define PMD_TYPE_SECT (2 << 0) 149 - #define PMD_BIT4 (1 << 4) 150 - #define PMD_DOMAIN(x) ((x) << 5) 151 - #define PMD_PROTECTION (1 << 9) /* v5 */ 152 - /* 153 - * - section 154 - */ 155 - #define PMD_SECT_BUFFERABLE (1 << 2) 156 - #define PMD_SECT_CACHEABLE (1 << 3) 157 - #define PMD_SECT_AP_WRITE (1 << 10) 158 - #define PMD_SECT_AP_READ (1 << 11) 159 - #define PMD_SECT_TEX(x) ((x) << 12) /* v5 */ 160 - #define PMD_SECT_APX (1 << 15) /* v6 */ 161 - #define PMD_SECT_S (1 << 16) /* v6 */ 162 - #define PMD_SECT_nG (1 << 17) /* v6 */ 163 - #define PMD_SECT_SUPER (1 << 18) /* v6 */ 164 - 165 - #define PMD_SECT_UNCACHED (0) 166 - #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) 167 - #define PMD_SECT_WT (PMD_SECT_CACHEABLE) 168 - #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 169 - #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) 170 - #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 171 - #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) 172 - 173 - /* 174 - * - coarse table (not used) 175 - */ 176 - 177 - /* 178 - * + Level 2 descriptor (PTE) 179 - * - common 180 - */ 181 - #define PTE_TYPE_MASK (3 << 0) 182 - #define PTE_TYPE_FAULT (0 << 0) 183 - #define PTE_TYPE_LARGE (1 << 0) 184 - #define PTE_TYPE_SMALL (2 << 0) 185 - #define PTE_TYPE_EXT (3 << 0) /* v5 */ 186 - #define PTE_BUFFERABLE (1 << 2) 187 - #define PTE_CACHEABLE (1 << 3) 188 - 189 - /* 190 - * - extended small page/tiny page 191 - */ 192 - #define PTE_EXT_XN (1 << 0) /* v6 */ 193 - #define PTE_EXT_AP_MASK (3 << 4) 194 - #define PTE_EXT_AP0 (1 << 4) 195 - #define PTE_EXT_AP1 (2 << 4) 196 - #define PTE_EXT_AP_UNO_SRO (0 << 4) 197 - #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) 198 - #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) 199 - #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 200 - #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 201 - #define PTE_EXT_APX (1 << 9) /* v6 */ 202 - #define PTE_EXT_SHARED (1 << 10) /* v6 */ 203 - #define PTE_EXT_NG (1 << 11) /* v6 */ 204 - 205 - /* 206 - * - small page 207 - */ 208 - #define PTE_SMALL_AP_MASK (0xff << 4) 209 - #define PTE_SMALL_AP_UNO_SRO (0x00 << 4) 210 - #define PTE_SMALL_AP_UNO_SRW (0x55 << 4) 211 - #define PTE_SMALL_AP_URO_SRW (0xaa << 4) 212 - #define PTE_SMALL_AP_URW_SRW (0xff << 4) 213 - 214 - /* 215 140 * "Linux" PTE definitions. 216 141 * 217 142 * We keep two sets of PTEs - the hardware and the linux version. ··· 160 235 #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ 161 236 162 237 #ifndef __ASSEMBLY__ 163 - 164 - #include <asm/domain.h> 165 - 166 - #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) 167 - #define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) 168 238 169 239 /* 170 240 * The following macros handle the cache and bufferable bits...