File Index
Files and directories
Sign in
FILE

coco.h

File preview with syntax highlighting.

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