memtype.h (899B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_X86_MEMTYPE_H 3#define _ASM_X86_MEMTYPE_H 4 5#include <linux/types.h> 6#include <asm/pgtable_types.h> 7 8extern bool pat_enabled(void); 9extern void pat_disable(const char *reason); 10extern void pat_init(void); 11extern void init_cache_modes(void); 12 13extern int memtype_reserve(u64 start, u64 end, 14 enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm); 15extern int memtype_free(u64 start, u64 end); 16 17extern int memtype_kernel_map_sync(u64 base, unsigned long size, 18 enum page_cache_mode pcm); 19 20extern int memtype_reserve_io(resource_size_t start, resource_size_t end, 21 enum page_cache_mode *pcm); 22 23extern void memtype_free_io(resource_size_t start, resource_size_t end); 24 25extern bool pat_pfn_immune_to_uc_mtrr(unsigned long pfn); 26 27bool x86_has_pat_wp(void); 28enum page_cache_mode pgprot2cachemode(pgprot_t pgprot); 29 30#endif /* _ASM_X86_MEMTYPE_H */