cmd_state.c revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Case management and saved state restoration
*/
#include <cmd_state.h>
#include <cmd_cpu.h>
#include <cmd_mem.h>
#include <cmd_page.h>
#include <cmd_dimm.h>
#ifdef sun4u
#include <cmd_dp.h>
#include <cmd_dp_page.h>
#endif
#include <cmd_bank.h>
#include <cmd.h>
#include <string.h>
#ifdef sun4u
#include <cmd_opl.h>
#endif
/* Must be in sync with cmd_ptrsubtype_t */
static cmd_case_closer_f *const cmd_case_closers[] = {
NULL,
cmd_cpuerr_close, /* CMD_PTR_CPU_ICACHE */
cmd_cpuerr_close, /* CMD_PTR_CPU_DCACHE */
cmd_cpuerr_close, /* CMD_PTR_CPU_PCACHE */
cmd_cpuerr_close, /* CMD_PTR_CPU_ITLB */
cmd_cpuerr_close, /* CMD_PTR_CPU_DTLB */
cmd_cpuerr_close, /* CMD_PTR_CPU_L2DATA */
cmd_cpuerr_close, /* CMD_PTR_CPU_L2DATA_UERETRY */
cmd_cpuerr_close, /* CMD_PTR_CPU_L2TAG */
cmd_cpuerr_close, /* CMD_PTR_CPU_L3DATA */
cmd_cpuerr_close, /* CMD_PTR_CPU_L3DATA_UERETRY */
cmd_cpuerr_close, /* CMD_PTR_CPU_L3TAG */
cmd_dimm_close, /* CMD_PTR_DIMM_CASE */
cmd_bank_close, /* CMD_PTR_BANK_CASE */
cmd_page_close, /* CMD_PTR_PAGE_CASE */
cmd_cpuerr_close, /* CMD_PTR_CPU_FPU */
NULL, /* CMD_PTR_CPU_XR_RETRY */
cmd_cpuerr_close, /* CMD_PTR_CPU_IREG */
cmd_cpuerr_close, /* CMD_PTR_CPU_FREG */
cmd_cpuerr_close, /* CMD_PTR_CPU_MAU */
cmd_cpuerr_close, /* CMD_PTR_CPU_L2CTL */
#ifdef sun4u
cmd_dp_close, /* CMD_PTR_DP_CASE */
#else
NULL, /* CMD_PTR_DP_CASE */
#endif
NULL, /* CMD_PTR_DP_PAGE_DEFER */
cmd_cpuerr_close, /* CMD_PTR_CPU_INV_SFSR */
cmd_cpuerr_close, /* CMD_PTR_CPU_UE_DET_CPU */
cmd_cpuerr_close, /* CMD_PTR_CPU_UE_DET_IO */
cmd_cpuerr_close, /* CMD_PTR_CPU_MTLB */
cmd_cpuerr_close, /* CMD_PTR_CPU_TLBP */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_INV_URG */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_CRE */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_TSB_CTX */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_TSBP */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_PSTATE */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_TSTATE */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_IUG_F */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_IUG_R */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_SDC */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_WDT */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_DTLB */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_ITLB */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_CORE_ERR */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_DAE */
cmd_cpuerr_close, /* CMD_PTR_CPU_UGESR_IAE */
cmd_cpuerr_close /* CMD_PTR_CPU_UGESR_UGE */
};
const char **uuidp)
{
fmd_case_t *cp;
return (cp);
}
void
{
}
void
{
if (close) {
}
}
/* Must be in sync with cmd_nodetype_t */
static cmd_case_restorer_f *const cmd_case_restorers[] = {
NULL,
cmd_cpu_restore, /* CMD_NT_CPU */
cmd_dimm_restore, /* CMD_NT_DIMM */
cmd_bank_restore, /* CMD_NT_BANK */
cmd_page_restore, /* CMD_NT_PAGE */
#ifdef sun4u
cmd_dp_restore /* CMD_NT_DP */
#endif
};
int
{
void *thing;
continue;
else if (sz != sizeof (cmd_case_ptr_t))
return (cmd_set_errno(EINVAL));
sizeof (cmd_case_ptr_t));
sizeof (cmd_case_restorers) /
sizeof (cmd_case_restorer_f *))
return (cmd_set_errno(EINVAL));
return (-1); /* errno is set for us */
}
#ifdef sun4u
/*
* cmd_dp_page_validate() must be done before cmd_dp_validate()
* and cmd_page_validate()
*/
#endif
return (0);
}
void
{
}
}