diff options
Diffstat (limited to 'arch/i386/mm/highmem.c')
-rw-r--r-- | arch/i386/mm/highmem.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/i386/mm/highmem.c b/arch/i386/mm/highmem.c index 4b7aaf99d7ea..b6eb4dcb8777 100644 --- a/arch/i386/mm/highmem.c +++ b/arch/i386/mm/highmem.c | |||
@@ -75,6 +75,24 @@ void kunmap_atomic(void *kvaddr, enum km_type type) | |||
75 | preempt_check_resched(); | 75 | preempt_check_resched(); |
76 | } | 76 | } |
77 | 77 | ||
78 | /* This is the same as kmap_atomic() but can map memory that doesn't | ||
79 | * have a struct page associated with it. | ||
80 | */ | ||
81 | void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) | ||
82 | { | ||
83 | enum fixed_addresses idx; | ||
84 | unsigned long vaddr; | ||
85 | |||
86 | inc_preempt_count(); | ||
87 | |||
88 | idx = type + KM_TYPE_NR*smp_processor_id(); | ||
89 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | ||
90 | set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot)); | ||
91 | __flush_tlb_one(vaddr); | ||
92 | |||
93 | return (void*) vaddr; | ||
94 | } | ||
95 | |||
78 | struct page *kmap_atomic_to_page(void *ptr) | 96 | struct page *kmap_atomic_to_page(void *ptr) |
79 | { | 97 | { |
80 | unsigned long idx, vaddr = (unsigned long)ptr; | 98 | unsigned long idx, vaddr = (unsigned long)ptr; |