From 6874bd722d4d526886e583dbaef0bb53feeaad1a Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Apr 2007 09:59:44 +0100 Subject: [PATCH] --- yaml --- r: 53974 b: refs/heads/master c: 2497f0a8125e307cf1fd4222bab53f66305eba27 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mm/mmu.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7507393573f7..0cf1d5eb73a2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8 +refs/heads/master: 2497f0a8125e307cf1fd4222bab53f66305eba27 diff --git a/trunk/arch/arm/mm/mmu.c b/trunk/arch/arm/mm/mmu.c index 94fd4bf5cb9e..6178be0242f2 100644 --- a/trunk/arch/arm/mm/mmu.c +++ b/trunk/arch/arm/mm/mmu.c @@ -176,14 +176,14 @@ void adjust_cr(unsigned long mask, unsigned long set) } #endif -struct mem_types { +struct mem_type { unsigned int prot_pte; unsigned int prot_l1; unsigned int prot_sect; unsigned int domain; }; -static struct mem_types mem_types[] __initdata = { +static struct mem_type mem_types[] __initdata = { [MT_DEVICE] = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE, @@ -368,6 +368,14 @@ static void __init build_mem_type_table(void) } printk("Memory policy: ECC %sabled, Data cache %s\n", ecc_mask ? "en" : "dis", cp->policy); + + for (i = 0; i < ARRAY_SIZE(mem_types); i++) { + struct mem_type *t = &mem_types[i]; + if (t->prot_l1) + t->prot_l1 |= PMD_DOMAIN(t->domain); + if (t->prot_sect) + t->prot_sect |= PMD_DOMAIN(t->domain); + } } #define vectors_base() (vectors_high() ? 0xffff0000 : 0) @@ -458,8 +466,8 @@ void __init create_mapping(struct map_desc *md) domain = mem_types[md->type].domain; prot_pte = __pgprot(mem_types[md->type].prot_pte); - prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain); - prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain); + prot_l1 = mem_types[md->type].prot_l1; + prot_sect = mem_types[md->type].prot_sect; /* * Catch 36-bit addresses