gcpu.h revision 521f69c05c5de4e5f848122e2fc5b8f1c6a9e0c6
/*
* 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 _GCPU_H
#define _GCPU_H
#include <sys/cpu_module_impl.h>
#include <sys/cpu_module_ms.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct gcpu_data gcpu_data_t;
#define GCPU_ERRCODE_MASK_ALL 0xffff
typedef struct gcpu_error_disp {
const char *ged_class_fmt; /* ereport class formatter (last bit) */
const char *ged_compound_fmt; /* compound error formatter */
/*
* For errorq_dispatch we need to have a single contiguous structure
* capturing all our logout data. We do not know in advance how many
* error detector banks there are in this cpu model, so we'll manually
* allocate additional space for the gcl_banks array below.
*/
typedef struct gcpu_bank_logout {
/*
* The data structure we "logout" all error telemetry from all banks of
* a cpu to. The gcl_data array declared with 1 member below will actually
* have gcl_nbanks members - variable with the actual cpu model present.
* After the gcl_data array there is a further model-specific array that
* may be allocated, and gcl_ms_logout will point to that if present.
* This cpu logout data must form one contiguous chunk of memory for
* dispatch with errorq_dispatch.
*/
typedef struct gcpu_logout {
int gcl_stackdepth; /* saved stack trace depth */
int gcl_nbanks; /* number of banks in array below */
void *gcl_ms_logout; /* Model-specific area after gcl_data */
/*
* gcl_flag values
*/
struct gcpu_bios_bankcfg {
};
struct gcpu_bios_cfg {
struct gcpu_bios_bankcfg *bios_bankcfg;
};
/*
* Events types in poll trace records. Keep these in sync with
* the generic cpu mdb module names for each (see gcpu_mpt_dump in mdb).
*/
#define GCPU_MPT_WHAT_CYC_ERR 0 /* cyclic-induced poll */
typedef struct gcpu_poll_trace {
typedef struct gcpu_poll_trace_ctl {
/*
* For counting some of the important number or time for runtime
*/
typedef struct gcpu_mca_cmci {
/* Index for gcpu_mca_logout array below */
#define GCPU_MCA_LOGOUT_EXCEPTION 0 /* area for #MC */
#define GCPU_MCA_LOGOUT_NUM 3
typedef struct gcpu_mca {
struct gcpu_bios_cfg gcpu_mca_bioscfg;
} gcpu_mca_t;
typedef struct gcpu_mce_status {
/*
* Flags for gcpu_mca_flags
*/
/*
* State shared by all cpus on a chip
*/
struct gcpu_chipshared {
};
struct gcpu_data {
};
#ifdef _KERNEL
struct regs;
/*
* CMI implementation
*/
extern void gcpu_post_startup(cmi_hdl_t);
extern void gcpu_post_mpstartup(cmi_hdl_t);
extern void gcpu_faulted_enter(cmi_hdl_t);
extern void gcpu_faulted_exit(cmi_hdl_t);
extern void gcpu_mca_init(cmi_hdl_t);
#ifndef __xpv
extern void gcpu_cmci_trap(cmi_hdl_t);
extern void gcpu_hdl_poke(cmi_hdl_t);
#else
extern void gcpu_xpv_panic_callback(void);
#endif
/*
* CMI global variable
*/
extern int cmi_enable_cmci;
/*
* Local functions
*/
extern void gcpu_mca_poll_init(cmi_hdl_t);
extern void gcpu_mca_poll_start(cmi_hdl_t);
extern void gcpu_poll_trace_init(gcpu_poll_trace_ctl_t *);
gcpu_mce_status_t *, boolean_t, int);
#ifdef __xpv
extern void gcpu_xpv_mca_init(int);
#endif /* __xpv */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _GCPU_H */