/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _GMEM_STATE_H
#define _GMEM_STATE_H
/*
* Case management and saved state restoration
*/
#include <gmem_util.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Our maximum persistent buffer name length, used to allocate fixed-size
* arrays for name storage.
*/
/*
* The current name DIMM_+serial number
*/
/* gmem_evdisp_t, gmem_evdisp_stat_t, and gmem_evdisp_names must be in sync */
typedef enum gmem_evdisp {
/*
* Each handled ereport type has four statistics, designed to indicate the
* eventual disposition of the ereport.
*/
typedef struct gmem_evdisp_stat {
/* Must be in sync with gmem_case_restorers */
typedef enum gmem_nodetype {
/*
* Must be in sync with gmem_case_closers. Additional types must be
* appended to this enum otherwise interpretation of existing logs
* and checkpoints will be confused.
*/
typedef enum gmem_ptrsubtype {
/*
* There are three types of general-purpose buffers, used to track DIMMs,
* and pages. Created on-demand as ereports arrive, one buffer is created for
* each thing tracked. The general-purpose buffers are used to track common
* state, and are used to support case-specific buffers. Each open case has
* a case-specific pointer buffer, used to aid in the rediscovery of the
* associated general-purpose buffer. When restoration begins, we iterate
* through each of the open cases, restoring the case-specific pointer buffers
* for each. The pointer buffers are then used to restore the general-purpose
* buffers.
*/
typedef struct gmem_case_ptr {
/*
* All general-purpose buffers begin with a common header. This header contains
* identification information used in the construction of new cases.
*
* Note that versioned structs depend upon the size of
* this struct remaining fixed.
*/
typedef struct gmem_header {
/*
* Per-case-subtype case closing routines. Stored in per-case state when the
* case is generated, and regenerated from saved state upon restore.
*/
gmem_case_ptr_t *);
typedef struct gmem_case_closer {
void *cl_arg;
typedef struct gmem_case {
char *cc_serdnm;
} gmem_case_t;
/*
* Utility functions which ease the management of cases.
*/
gmem_ptrsubtype_t, const char **);
extern int gmem_state_restore(fmd_hdl_t *);
#ifdef __cplusplus
}
#endif
#endif /* _GMEM_STATE_H */