summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/highmem.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-07-11 20:45:51 +0000
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 19:31:42 +0100
commit60080265a13ea43f0ebdcd25671dcab05ed01308 (patch)
tree5172178f73d65bb8cbb129ad3e49a04af7e0b7ce /arch/mips/mm/highmem.c
parent129bc8f78b468df6824dd1584829f10aa3a69c27 (diff)
Define kmap_atomic_pfn() for MIPS.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/highmem.c')
-rw-r--r--arch/mips/mm/highmem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index dd5e2e31885..1f7b37b38f5 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -83,6 +83,25 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
preempt_check_resched();
}
+/*
+ * This is the same as kmap_atomic() but can map memory that doesn't
+ * have a struct page associated with it.
+ */
+void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
+{
+ enum fixed_addresses idx;
+ unsigned long vaddr;
+
+ inc_preempt_count();
+
+ idx = type + KM_TYPE_NR*smp_processor_id();
+ vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+ set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
+ flush_tlb_one(vaddr);
+
+ return (void*) vaddr;
+}
+
struct page *__kmap_atomic_to_page(void *ptr)
{
unsigned long idx, vaddr = (unsigned long)ptr;