10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 54481Sbholler * Common Development and Distribution License (the "License"). 64481Sbholler * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*9637SRandy.Fishel@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_CPU_H 270Sstevel@tonic-gate #define _SYS_CPU_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate /* 300Sstevel@tonic-gate * WARNING: 310Sstevel@tonic-gate * This header file is Obsolete and may be deleted in a 320Sstevel@tonic-gate * future release of Solaris. 330Sstevel@tonic-gate */ 340Sstevel@tonic-gate 350Sstevel@tonic-gate /* 360Sstevel@tonic-gate * Include generic bustype cookies. 370Sstevel@tonic-gate */ 380Sstevel@tonic-gate #include <sys/bustypes.h> 394481Sbholler #include <sys/inttypes.h> 405084Sjohnlev 415084Sjohnlev #if defined(_KERNEL) 425084Sjohnlev #if defined(__xpv) 435084Sjohnlev #include <sys/hypervisor.h> 445084Sjohnlev #endif 455084Sjohnlev #if defined(__GNUC__) && defined(_ASM_INLINES) 460Sstevel@tonic-gate #include <asm/cpu.h> 470Sstevel@tonic-gate #endif 485084Sjohnlev #endif /* _KERNEL */ 490Sstevel@tonic-gate 500Sstevel@tonic-gate #ifdef __cplusplus 510Sstevel@tonic-gate extern "C" { 520Sstevel@tonic-gate #endif 530Sstevel@tonic-gate 540Sstevel@tonic-gate #if defined(_KERNEL) 550Sstevel@tonic-gate extern void ht_pause(void); 560Sstevel@tonic-gate extern void cli(void); 570Sstevel@tonic-gate extern void sti(void); 580Sstevel@tonic-gate extern void i86_halt(void); 594481Sbholler extern void i86_monitor(volatile uint32_t *addr, uint32_t extensions, 604481Sbholler uint32_t hints); 614481Sbholler extern void i86_mwait(uint32_t data, uint32_t extensions); 620Sstevel@tonic-gate 630Sstevel@tonic-gate /* 640Sstevel@tonic-gate * Used to insert cpu-dependent instructions into spin loops 650Sstevel@tonic-gate */ 660Sstevel@tonic-gate #define SMT_PAUSE() ht_pause() 670Sstevel@tonic-gate 685864Sesaxe /* 695864Sesaxe * 705864Sesaxe * C-state defines for the idle_state_transition DTrace probe 715864Sesaxe * 725864Sesaxe * The probe fires when the CPU undergoes an idle state change (e.g. C-state) 73*9637SRandy.Fishel@Sun.COM * The argument passed is the C-state to which the CPU is transitioning. 745864Sesaxe * 75*9637SRandy.Fishel@Sun.COM * These states will be shared by cpupm subsystem, so they should be kept in 76*9637SRandy.Fishel@Sun.COM * consistence with ACPI defined C states. 775864Sesaxe */ 785864Sesaxe #define IDLE_STATE_C0 0 795864Sesaxe #define IDLE_STATE_C1 1 80*9637SRandy.Fishel@Sun.COM #define IDLE_STATE_C2 2 81*9637SRandy.Fishel@Sun.COM #define IDLE_STATE_C3 3 825864Sesaxe 830Sstevel@tonic-gate #endif /* _KERNEL */ 840Sstevel@tonic-gate 850Sstevel@tonic-gate #ifdef __cplusplus 860Sstevel@tonic-gate } 870Sstevel@tonic-gate #endif 880Sstevel@tonic-gate 890Sstevel@tonic-gate #endif /* _SYS_CPU_H */ 90