cmd_state.c revision d00f0155af9a9a671eb08a0dc30f5ea0a379c36c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 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>
/* 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 */
};
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
{
}
}