2 * include/asm-xtensa/highmem.h
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 * Copyright (C) 2014 Cadence Design Systems Inc.
12 #ifndef _XTENSA_HIGHMEM_H
13 #define _XTENSA_HIGHMEM_H
15 #include <asm/cacheflush.h>
16 #include <asm/fixmap.h>
17 #include <asm/kmap_types.h>
18 #include <asm/pgtable.h>
20 #define PKMAP_BASE (FIXADDR_START - PMD_SIZE)
21 #define LAST_PKMAP PTRS_PER_PTE
22 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
23 #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
24 #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
26 #define kmap_prot PAGE_KERNEL
28 extern pte_t *pkmap_page_table;
30 void *kmap_high(struct page *page);
31 void kunmap_high(struct page *page);
33 static inline void *kmap(struct page *page)
35 BUG_ON(in_interrupt());
36 if (!PageHighMem(page))
37 return page_address(page);
38 return kmap_high(page);
41 static inline void kunmap(struct page *page)
43 BUG_ON(in_interrupt());
44 if (!PageHighMem(page))
49 static inline void flush_cache_kmaps(void)
54 void *kmap_atomic(struct page *page);
55 void __kunmap_atomic(void *kvaddr);