diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-20 10:48:28 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-20 10:48:31 +0100 |
commit | c032a2de4c1a82187e9a754511043be47c8a92b5 (patch) | |
tree | 6d20bfcff683555b641a376ffdffb2dbc1f1599a /arch/sh/mm/pg-sh4.c | |
parent | 722024dbb74f3ea316c285c0a71a4512e113b0c4 (diff) | |
parent | cbe9ee00cea58d1f77b172fe22a51080e90877f2 (diff) | |
download | op-kernel-dev-c032a2de4c1a82187e9a754511043be47c8a92b5.zip op-kernel-dev-c032a2de4c1a82187e9a754511043be47c8a92b5.tar.gz |
Merge branch 'x86/cleanups' into x86/irq
[ merged x86/cleanups into x86/irq to enable a wider IRQ entry code
patch to be applied, which depends on a cleanup patch in x86/cleanups. ]
Diffstat (limited to 'arch/sh/mm/pg-sh4.c')
-rw-r--r-- | arch/sh/mm/pg-sh4.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 38870e0..2fe14da 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c @@ -7,6 +7,7 @@ * Released under the terms of the GNU GPL v2.0. */ #include <linux/mm.h> +#include <linux/init.h> #include <linux/mutex.h> #include <linux/fs.h> #include <linux/highmem.h> @@ -16,6 +17,20 @@ #define CACHE_ALIAS (current_cpu_data.dcache.alias_mask) +#define kmap_get_fixmap_pte(vaddr) \ + pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) + +static pte_t *kmap_coherent_pte; + +void __init kmap_coherent_init(void) +{ + unsigned long vaddr; + + /* cache the first coherent kmap pte */ + vaddr = __fix_to_virt(FIX_CMAP_BEGIN); + kmap_coherent_pte = kmap_get_fixmap_pte(vaddr); +} + static inline void *kmap_coherent(struct page *page, unsigned long addr) { enum fixed_addresses idx; @@ -34,6 +49,8 @@ static inline void *kmap_coherent(struct page *page, unsigned long addr) update_mmu_cache(NULL, vaddr, pte); + set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte); + return (void *)vaddr; } |