Commit 8a8ae00f authored by David S. Miller's avatar David S. Miller

[SPARC]: Add kmap_atomic_to_page.

parent 007e4bb6
...@@ -148,6 +148,19 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -148,6 +148,19 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
dec_preempt_count(); dec_preempt_count();
} }
static inline struct page *kmap_atomic_to_page(void *ptr)
{
unsigned long idx, vaddr = (unsigned long)ptr;
pte_t *pte;
if (vaddr < FIX_KMAP_BEGIN)
return virt_to_page(ptr);
idx = ((vaddr - FIX_KMAP_BEGIN) >> PAGE_SHIFT);
pte = kmap_pte + idx;
return pte_page(*pte);
}
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_HIGHMEM_H */ #endif /* _ASM_HIGHMEM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment