xref: /openbmc/linux/arch/x86/include/asm/memtype.h (revision adfe7512)
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 
8 extern bool pat_enabled(void);
9 extern void pat_bp_init(void);
10 extern void pat_cpu_init(void);
11 
12 extern int memtype_reserve(u64 start, u64 end,
13 		enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm);
14 extern int memtype_free(u64 start, u64 end);
15 
16 extern int memtype_kernel_map_sync(u64 base, unsigned long size,
17 		enum page_cache_mode pcm);
18 
19 extern int memtype_reserve_io(resource_size_t start, resource_size_t end,
20 			enum page_cache_mode *pcm);
21 
22 extern void memtype_free_io(resource_size_t start, resource_size_t end);
23 
24 extern bool pat_pfn_immune_to_uc_mtrr(unsigned long pfn);
25 
26 bool x86_has_pat_wp(void);
27 enum page_cache_mode pgprot2cachemode(pgprot_t pgprot);
28 
29 #endif /* _ASM_X86_MEMTYPE_H */
30