blob: 7f36d00600b43da38ba4fda7fa59aa61da7d60ab [file] [log] [blame]
Nicolas Pitred73cd422008-09-15 16:44:55 -04001#ifndef _ASM_HIGHMEM_H
2#define _ASM_HIGHMEM_H
3
4#include <asm/kmap_types.h>
5
6#define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE)
7#define LAST_PKMAP PTRS_PER_PTE
8#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
9#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
10#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
11
12#define kmap_prot PAGE_KERNEL
13
14#define flush_cache_kmaps() flush_cache_all()
15
16extern pte_t *pkmap_page_table;
17
Nicolas Pitre43377452009-03-12 22:52:09 -040018#define ARCH_NEEDS_KMAP_HIGH_GET
19
Nicolas Pitred73cd422008-09-15 16:44:55 -040020extern void *kmap_high(struct page *page);
Nicolas Pitre43377452009-03-12 22:52:09 -040021extern void *kmap_high_get(struct page *page);
Nicolas Pitred73cd422008-09-15 16:44:55 -040022extern void kunmap_high(struct page *page);
23
24extern void *kmap(struct page *page);
25extern void kunmap(struct page *page);
26extern void *kmap_atomic(struct page *page, enum km_type type);
27extern void kunmap_atomic(void *kvaddr, enum km_type type);
28extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
29extern struct page *kmap_atomic_to_page(const void *ptr);
30
31#endif