xref: /titanic_41/usr/src/uts/intel/sys/cpu.h (revision 2e02daeede04af58a9d4f18f8dfed1fda3ececa1)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_CPU_H
27 #define	_SYS_CPU_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * WARNING:
33  *	This header file is Obsolete and may be deleted in a
34  *	future release of Solaris.
35  */
36 
37 /*
38  * Include generic bustype cookies.
39  */
40 #include <sys/bustypes.h>
41 #include <sys/inttypes.h>
42 
43 #if defined(_KERNEL)
44 #if defined(__xpv)
45 #include <sys/hypervisor.h>
46 #endif
47 #if defined(__GNUC__) && defined(_ASM_INLINES)
48 #include <asm/cpu.h>
49 #endif
50 #endif	/* _KERNEL */
51 
52 #ifdef	__cplusplus
53 extern "C" {
54 #endif
55 
56 #if defined(_KERNEL)
57 extern void ht_pause(void);
58 extern void cli(void);
59 extern void sti(void);
60 extern void i86_halt(void);
61 extern void i86_monitor(volatile uint32_t *addr, uint32_t extensions,
62     uint32_t hints);
63 extern void i86_mwait(uint32_t data, uint32_t extensions);
64 
65 /*
66  * Used to insert cpu-dependent instructions into spin loops
67  */
68 #define	SMT_PAUSE()		ht_pause()
69 
70 /*
71  *
72  * C-state defines for the idle_state_transition DTrace probe
73  *
74  * The probe fires when the CPU undergoes an idle state change (e.g. C-state)
75  * The agument passed is the C-state to which the CPU is transitioning.
76  *
77  * The states are defined here.
78  */
79 #define	IDLE_STATE_C0 0
80 #define	IDLE_STATE_C1 1
81 
82 #endif	/* _KERNEL */
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif	/* _SYS_CPU_H */
89