1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 #ifndef _ASM_X86_COCO_H 3 #define _ASM_X86_COCO_H 4 5 #include <asm/asm.h> 6 #include <asm/types.h> 7 8 enum cc_vendor { 9 CC_VENDOR_NONE, 10 CC_VENDOR_AMD, 11 CC_VENDOR_INTEL, 12 }; 13 14 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM 15 extern enum cc_vendor cc_vendor; 16 extern u64 cc_mask; 17 18 static inline void cc_set_mask(u64 mask) 19 { 20 RIP_REL_REF(cc_mask) = mask; 21 } 22 23 u64 cc_mkenc(u64 val); 24 u64 cc_mkdec(u64 val); 25 void cc_random_init(void); 26 #else 27 #define cc_vendor (CC_VENDOR_NONE) 28 static const u64 cc_mask = 0; 29 30 static inline u64 cc_mkenc(u64 val) 31 { 32 return val; 33 } 34 35 static inline u64 cc_mkdec(u64 val) 36 { 37 return val; 38 } 39 static inline void cc_random_init(void) { } 40 #endif 41 42 #endif /* _ASM_X86_COCO_H */ 43
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.