xref: /openbmc/linux/arch/x86/include/asm/coco.h (revision 06ba8020)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_COCO_H
3 #define _ASM_X86_COCO_H
4 
5 #include <asm/types.h>
6 
7 enum cc_vendor {
8 	CC_VENDOR_NONE,
9 	CC_VENDOR_AMD,
10 	CC_VENDOR_INTEL,
11 };
12 
13 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM
14 extern enum cc_vendor cc_vendor;
15 
16 static inline enum cc_vendor cc_get_vendor(void)
17 {
18 	return cc_vendor;
19 }
20 
21 static inline void cc_set_vendor(enum cc_vendor vendor)
22 {
23 	cc_vendor = vendor;
24 }
25 
26 void cc_set_mask(u64 mask);
27 u64 cc_mkenc(u64 val);
28 u64 cc_mkdec(u64 val);
29 #else
30 static inline enum cc_vendor cc_get_vendor(void)
31 {
32 	return CC_VENDOR_NONE;
33 }
34 
35 static inline void cc_set_vendor(enum cc_vendor vendor) { }
36 
37 static inline u64 cc_mkenc(u64 val)
38 {
39 	return val;
40 }
41 
42 static inline u64 cc_mkdec(u64 val)
43 {
44 	return val;
45 }
46 #endif
47 
48 #endif /* _ASM_X86_COCO_H */
49