xref: /illumos-gate/usr/src/uts/intel/sys/smt_machcpu.h (revision 7c8c0b8227679b4684566e408ccc96d6ef7175e9)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2019 Joyent, Inc.
14  * Copyright 2022 Oxide Computer Company
15  */
16 
17 #ifndef	_SYS_SMT_MACHCPU_H
18 #define	_SYS_SMT_MACHCPU_H
19 
20 #include <sys/types.h>
21 
22 #ifdef	__cplusplus
23 extern "C" {
24 #endif
25 
26 /*
27  * The SMT exclusion logic requires `struct cpu_smt` be present in
28  * `struct machcpu` as the field `mcpu_smt`.  It is defined here, on its own, so
29  * it may be easily included by the relevant machine architecture(s).
30  */
31 typedef struct cpu_smt {
32 	lock_t cs_lock;
33 	char cs_pad[56];
34 	struct cpu *cs_sib;
35 	volatile uint64_t cs_intr_depth;
36 	volatile uint64_t cs_state;
37 	volatile uint64_t cs_sibstate;
38 } cpu_smt_t;
39 
40 #ifdef	__cplusplus
41 }
42 #endif
43 
44 #endif	/* _SYS_SMT_MACHCPU_H */
45