diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-28 23:24:12 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-28 23:24:12 +0100 |
commit | d00ab2fdd4dc4361c97777bc1fef7234329d4659 (patch) | |
tree | b8d8f98c1af633bbc1570b4270b39727737beebf /arch/sh/mm/pmb-fixed.c | |
parent | 88f502fedba82eff252b6420e8b8328e4ae25c67 (diff) | |
parent | 7c730ccdc1188b97f5c8cb690906242c7ed75c22 (diff) |
Merge branch 'linus' into core/futexes
Diffstat (limited to 'arch/sh/mm/pmb-fixed.c')
-rw-r--r-- | arch/sh/mm/pmb-fixed.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/sh/mm/pmb-fixed.c b/arch/sh/mm/pmb-fixed.c new file mode 100644 index 00000000000..43c8eac4d8a --- /dev/null +++ b/arch/sh/mm/pmb-fixed.c @@ -0,0 +1,45 @@ +/* + * arch/sh/mm/fixed_pmb.c + * + * Copyright (C) 2009 Renesas Solutions Corp. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include <linux/init.h> +#include <linux/mm.h> +#include <linux/io.h> +#include <asm/mmu.h> +#include <asm/mmu_context.h> + +static int __uses_jump_to_uncached fixed_pmb_init(void) +{ + int i; + unsigned long addr, data; + + jump_to_uncached(); + + for (i = 0; i < PMB_ENTRY_MAX; i++) { + addr = PMB_DATA + (i << PMB_E_SHIFT); + data = ctrl_inl(addr); + if (!(data & PMB_V)) + continue; + + if (data & PMB_C) { +#if defined(CONFIG_CACHE_WRITETHROUGH) + data |= PMB_WT; +#elif defined(CONFIG_CACHE_WRITEBACK) + data &= ~PMB_WT; +#else + data &= ~(PMB_C | PMB_WT); +#endif + } + ctrl_outl(data, addr); + } + + back_to_cached(); + + return 0; +} +arch_initcall(fixed_pmb_init); |