diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-04-21 04:59:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-04-21 15:35:44 -0400 |
commit | 2497f0a8125e307cf1fd4222bab53f66305eba27 (patch) | |
tree | 44973e86c9b5c4f471586acf0207ab13ccb1f6d8 | |
parent | 235b185ce47ce64793362bd3ae4bcd8afc6b57b8 (diff) |
[ARM] mm 1: Combine mem_type domain into prot_* at init time
Rather than combining the domain for a particular memory type with
the protection information each time we want to use it, do so when
we fix up the mem_type array at initialisation time.
Rename struct mem_types to be mem_type - each structure is one
memory type description, not several.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mm/mmu.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 94fd4bf5cb9e..6178be0242f2 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -176,14 +176,14 @@ void adjust_cr(unsigned long mask, unsigned long set) | |||
176 | } | 176 | } |
177 | #endif | 177 | #endif |
178 | 178 | ||
179 | struct mem_types { | 179 | struct mem_type { |
180 | unsigned int prot_pte; | 180 | unsigned int prot_pte; |
181 | unsigned int prot_l1; | 181 | unsigned int prot_l1; |
182 | unsigned int prot_sect; | 182 | unsigned int prot_sect; |
183 | unsigned int domain; | 183 | unsigned int domain; |
184 | }; | 184 | }; |
185 | 185 | ||
186 | static struct mem_types mem_types[] __initdata = { | 186 | static struct mem_type mem_types[] __initdata = { |
187 | [MT_DEVICE] = { | 187 | [MT_DEVICE] = { |
188 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 188 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | |
189 | L_PTE_WRITE, | 189 | L_PTE_WRITE, |
@@ -368,6 +368,14 @@ static void __init build_mem_type_table(void) | |||
368 | } | 368 | } |
369 | printk("Memory policy: ECC %sabled, Data cache %s\n", | 369 | printk("Memory policy: ECC %sabled, Data cache %s\n", |
370 | ecc_mask ? "en" : "dis", cp->policy); | 370 | ecc_mask ? "en" : "dis", cp->policy); |
371 | |||
372 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { | ||
373 | struct mem_type *t = &mem_types[i]; | ||
374 | if (t->prot_l1) | ||
375 | t->prot_l1 |= PMD_DOMAIN(t->domain); | ||
376 | if (t->prot_sect) | ||
377 | t->prot_sect |= PMD_DOMAIN(t->domain); | ||
378 | } | ||
371 | } | 379 | } |
372 | 380 | ||
373 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) | 381 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) |
@@ -458,8 +466,8 @@ void __init create_mapping(struct map_desc *md) | |||
458 | 466 | ||
459 | domain = mem_types[md->type].domain; | 467 | domain = mem_types[md->type].domain; |
460 | prot_pte = __pgprot(mem_types[md->type].prot_pte); | 468 | prot_pte = __pgprot(mem_types[md->type].prot_pte); |
461 | prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain); | 469 | prot_l1 = mem_types[md->type].prot_l1; |
462 | prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain); | 470 | prot_sect = mem_types[md->type].prot_sect; |
463 | 471 | ||
464 | /* | 472 | /* |
465 | * Catch 36-bit addresses | 473 | * Catch 36-bit addresses |