/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_CPU_H #define _SYS_CPU_H #pragma ident "%Z%%M% %I% %E% SMI" /* * WARNING: * This header file is Obsolete and may be deleted in a * future release of Solaris. */ /* * Include generic bustype cookies. */ #include #include #if defined(_KERNEL) #if defined(__xpv) #include #endif #if defined(__GNUC__) && defined(_ASM_INLINES) #include #endif #endif /* _KERNEL */ #ifdef __cplusplus extern "C" { #endif #if defined(_KERNEL) extern void ht_pause(void); extern void cli(void); extern void sti(void); extern void i86_halt(void); extern void i86_monitor(volatile uint32_t *addr, uint32_t extensions, uint32_t hints); extern void i86_mwait(uint32_t data, uint32_t extensions); /* * Used to insert cpu-dependent instructions into spin loops */ #if defined(__xpv) extern int xpv_panicking; #define SMT_PAUSE() \ { \ if (IN_XPV_PANIC()) \ ht_pause(); \ else \ (void) HYPERVISOR_yield(); \ } #else #define SMT_PAUSE() ht_pause() #endif /* * * C-state defines for the idle_state_transition DTrace probe * * The probe fires when the CPU undergoes an idle state change (e.g. C-state) * The agument passed is the C-state to which the CPU is transitioning. * * The states are defined here. */ #define IDLE_STATE_C0 0 #define IDLE_STATE_C1 1 #endif /* _KERNEL */ #ifdef __cplusplus } #endif #endif /* _SYS_CPU_H */