16 #include <linux/module.h>
20 #define kmap_get_pte(vaddr) \
21 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\
32 if (!PageHighMem(page))
53 if (!PageHighMem(page))
96 static void kmap_atomic_register(
struct page *
page,
int type,
103 spin_lock(&_lock);
115 list_add(&->
list, &_list);
119 spin_unlock(&_lock);
130 static void kmap_atomic_unregister(
struct page *page,
unsigned long va)
137 if (amp->
page == page && amp->
cpu == cpu && amp->
va == va)
142 spin_unlock_irqrestore(&_lock, flags);
181 if (amp->
page == page)
182 kmap_atomic_fix_one_kpte(amp, finished);
184 spin_unlock_irqrestore(&_lock, flags);
211 if (!PageHighMem(page))
214 type = kmap_atomic_idx_push();
221 kmap_atomic_register(page, type, vaddr, pte,
mk_pte(page, prot));
223 return (
void *)
vaddr;
244 type = kmap_atomic_idx();
253 kmap_atomic_unregister(
pte_page(pteval), vaddr);
255 kmap_atomic_idx_pop();
283 unsigned long vaddr = (
unsigned long)ptr;