machcpuvar.h revision 349b53dd4e695e3d833b5380540385145b2d3ae8
/*
* 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
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_MACHCPUVAR_H
#define _SYS_MACHCPUVAR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/inttypes.h>
#include <sys/segments.h>
#include <sys/rm_platter.h>
#ifndef _ASM
/*
* On a virtualized platform a virtual cpu may not be actually
* on a physical cpu, especially in situations where a configuration has
* more vcpus than pcpus. This function tells us (if it's able) if the
* specified vcpu is currently running on a pcpu. Note if it is not
* known or not able to determine, it will return the unknown state.
*/
#define VCPU_STATE_UNKNOWN 0
#define VCPU_ON_PCPU 1
#define VCPU_NOT_ON_PCPU 2
extern int vcpu_on_pcpu(processorid_t);
/*
* Machine specific fields of the cpu struct
*
* Note: This is kinda kludgy but seems to be the best
* of our alternatives.
*/
typedef void *cpu_pri_lev_t;
struct cpuid_info;
struct cpu_ucode_info;
/*
* A note about the hypervisor affinity bits: a one bit in the affinity mask
* means the corresponding event channel is allowed to be serviced
* by this cpu.
*/
struct xen_evt_data {
};
struct machcpu {
/*
* x_call fields - used for interprocessor cross calls
*/
volatile uint32_t xc_work_cnt;
int mcpu_nodeid; /* node-id */
int mcpu_pri; /* CPU priority */
/* data for setting priority */
/* level */
struct hat_cpu_info *mcpu_hat_info;
volatile ulong_t mcpu_tlb_info;
/* i86 hardware table addresses that cannot be shared */
struct softint mcpu_softinfo;
struct cpuid_info *mcpu_cpi;
#if defined(__amd64)
#endif
struct vcpu_info *mcpu_vcpu_info;
void (*mcpu_idle_cpu)(void); /* idle function */
struct cpu_ucode_info *mcpu_ucode_info;
void *mcpu_pm_mach_state;
};
#define MWAIT_RUNNING (0) /* mcpu_mwait set to wakeup */
#endif /* _ASM */
/* Please DON'T add any more of this namespace-poisoning sewage here */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MACHCPUVAR_H */