2008-09-16 04:44:55 +08:00
|
|
|
#ifndef _ASM_HIGHMEM_H
|
|
|
|
#define _ASM_HIGHMEM_H
|
|
|
|
|
|
|
|
#include <asm/kmap_types.h>
|
|
|
|
|
|
|
|
#define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE)
|
|
|
|
#define LAST_PKMAP PTRS_PER_PTE
|
|
|
|
#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
|
|
|
|
#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
|
|
|
|
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
|
|
|
|
|
|
|
|
#define kmap_prot PAGE_KERNEL
|
|
|
|
|
2010-03-30 04:46:02 +08:00
|
|
|
#define flush_cache_kmaps() \
|
|
|
|
do { \
|
|
|
|
if (cache_is_vivt()) \
|
|
|
|
flush_cache_all(); \
|
|
|
|
} while (0)
|
2008-09-16 04:44:55 +08:00
|
|
|
|
|
|
|
extern pte_t *pkmap_page_table;
|
|
|
|
|
2009-03-13 10:52:09 +08:00
|
|
|
#define ARCH_NEEDS_KMAP_HIGH_GET
|
|
|
|
|
2008-09-16 04:44:55 +08:00
|
|
|
extern void *kmap_high(struct page *page);
|
2009-03-13 10:52:09 +08:00
|
|
|
extern void *kmap_high_get(struct page *page);
|
2008-09-16 04:44:55 +08:00
|
|
|
extern void kunmap_high(struct page *page);
|
|
|
|
|
2010-03-30 04:46:02 +08:00
|
|
|
extern void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte);
|
|
|
|
extern void kunmap_high_l1_vipt(struct page *page, pte_t saved_pte);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The following functions are already defined by <linux/highmem.h>
|
|
|
|
* when CONFIG_HIGHMEM is not set.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_HIGHMEM
|
2008-09-16 04:44:55 +08:00
|
|
|
extern void *kmap(struct page *page);
|
|
|
|
extern void kunmap(struct page *page);
|
|
|
|
extern void *kmap_atomic(struct page *page, enum km_type type);
|
|
|
|
extern void kunmap_atomic(void *kvaddr, enum km_type type);
|
|
|
|
extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
|
|
|
|
extern struct page *kmap_atomic_to_page(const void *ptr);
|
2010-03-30 04:46:02 +08:00
|
|
|
#endif
|
2008-09-16 04:44:55 +08:00
|
|
|
|
|
|
|
#endif
|