xref: /titanic_50/usr/src/uts/intel/sys/cpu.h (revision 34f9b3eef6fdadbda0a846aa4d68691ac40eace5)
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 2009 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 /*
30  * WARNING:
31  *	This header file is Obsolete and may be deleted in a
32  *	future release of Solaris.
33  */
34 
35 /*
36  * Include generic bustype cookies.
37  */
38 #include <sys/bustypes.h>
39 #include <sys/inttypes.h>
40 
41 #if defined(_KERNEL)
42 #if defined(__xpv)
43 #include <sys/hypervisor.h>
44 #endif
45 #if defined(__GNUC__) && defined(_ASM_INLINES)
46 #include <asm/cpu.h>
47 #endif
48 #endif	/* _KERNEL */
49 
50 #ifdef	__cplusplus
51 extern "C" {
52 #endif
53 
54 #if defined(_KERNEL)
55 extern void ht_pause(void);
56 extern void cli(void);
57 extern void sti(void);
58 extern void i86_halt(void);
59 extern void i86_monitor(volatile uint32_t *addr, uint32_t extensions,
60     uint32_t hints);
61 extern void i86_mwait(uint32_t data, uint32_t extensions);
62 
63 /*
64  * Used to insert cpu-dependent instructions into spin loops
65  */
66 #define	SMT_PAUSE()		ht_pause()
67 
68 /*
69  *
70  * C-state defines for the idle_state_transition DTrace probe
71  *
72  * The probe fires when the CPU undergoes an idle state change (e.g. C-state)
73  * The argument passed is the C-state to which the CPU is transitioning.
74  *
75  * These states will be shared by cpupm subsystem, so they should be kept in
76  * consistence with ACPI defined C states.
77  */
78 #define	IDLE_STATE_C0 0
79 #define	IDLE_STATE_C1 1
80 #define	IDLE_STATE_C2 2
81 #define	IDLE_STATE_C3 3
82 
83 #endif	/* _KERNEL */
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_CPU_H */
90