X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fmips%2Fmm%2Fhighmem.c;fp=arch%2Fmips%2Fmm%2Fhighmem.c;h=0c544375b856be81235c121c0fca81f0290deeb0;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=dd5e2e31885b8e0e87dab65344248e5ac46dc30a;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c index dd5e2e318..0c544375b 100644 --- a/arch/mips/mm/highmem.c +++ b/arch/mips/mm/highmem.c @@ -83,6 +83,27 @@ void __kunmap_atomic(void *kvaddr, enum km_type type) preempt_check_resched(); } +#ifndef CONFIG_LIMITED_DMA +/* + * 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; +} +#endif /* CONFIG_LIMITED_DMA */ + struct page *__kmap_atomic_to_page(void *ptr) { unsigned long idx, vaddr = (unsigned long)ptr;