mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 01:06:49 +07:00
39af22a792
Since commit3e4d3af501
"mm: stack based kmap_atomic()", it is no longer necessary to carry an ad hoc version of kmap_atomic() added in commit7e5a69e83b
"ARM: 6007/1: fix highmem with VIPT cache and DMA" to cope with reentrancy. In fact, it is now actively wrong to rely on fixed kmap type indices (namely KM_L1_CACHE) as kmap_atomic() totally ignores them now and a concurrent instance of it may reuse any slot for any purpose. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
#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
|
|
|
|
#define flush_cache_kmaps() \
|
|
do { \
|
|
if (cache_is_vivt()) \
|
|
flush_cache_all(); \
|
|
} while (0)
|
|
|
|
extern pte_t *pkmap_page_table;
|
|
|
|
#define ARCH_NEEDS_KMAP_HIGH_GET
|
|
|
|
extern void *kmap_high(struct page *page);
|
|
extern void *kmap_high_get(struct page *page);
|
|
extern void kunmap_high(struct page *page);
|
|
|
|
/*
|
|
* The following functions are already defined by <linux/highmem.h>
|
|
* when CONFIG_HIGHMEM is not set.
|
|
*/
|
|
#ifdef CONFIG_HIGHMEM
|
|
extern void *kmap(struct page *page);
|
|
extern void kunmap(struct page *page);
|
|
extern void *__kmap_atomic(struct page *page);
|
|
extern void __kunmap_atomic(void *kvaddr);
|
|
extern void *kmap_atomic_pfn(unsigned long pfn);
|
|
extern struct page *kmap_atomic_to_page(const void *ptr);
|
|
#endif
|
|
|
|
#endif
|