cmd_dimm.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CMD_DIMM_H
#define _CMD_DIMM_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Memory modules are described by the cmd_dimm general-purpose state structure.
* Whereas banks are primarily used to track UEs, this structure is used to
* track CEs, which can be associated with individual modules. Each memory
* module is part of a bank, and will have a link to the bank if the bank is
* known to the diagnosis engine. Banks will be known if UEs have occurred.
*
* Data structures:
*
* ,--------. ,--------.
* |dimm | <---- |case_ptr| (CMD_PTR_DIMM_CASE)
* | | `--------'
* |,-------| ,-------------.
* ,->||asru_t | ----> |packed nvlist|
* | |`-------| `-------------'
* `--| unum |
* | bank | ----> bank buffer
* `--------'
*
* Data structure P? Case? Notes
* ---------------- --- ----- ----------------------------------------------
* cmd_dimm_t Yes No Name is derived from the unum ("dimm_%s")
* cmd_case_ptr_t Yes Yes Name is case's UUID
* dimm_asru Yes No Name is derived from the unum ("dimm_asru_%d")
* dimm_unum No No Pointer into ASRU - relinked during restore
* dimm_bank No No Recreated during restore
*/
#include <cmd_mem.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The DIMM structure started life without a version number. Making things more
* complicated, the version number in the new struct occupies the space used for
* the case pointer in the non-versioned struct. We therefore have to use
* somewhat unorthodox version numbers so as to allow us to easily tell the
* difference between a version number and a case pointer. Case pointers will
* be zero or (this being SPARC), a value with the bottom two bits clear. Our
* version numbers will begin with 0x11, and will increase by 0x10 each time.
*/
#define CMD_DIMM_VERSION CMD_DIMM_VERSION_1
typedef struct cmd_dimm_0 {
const char *dimm0_unum; /* This DIMM's name */
} cmd_dimm_0_t;
typedef struct cmd_dimm_pers {
struct cmd_dimm {
const char *dimm_unum; /* This DIMM's name */
};
#define CMD_DIMM_MAXSIZE \
#define CMD_DIMM_MINSIZE \
uint_t);
uint64_t);
uint16_t);
extern void cmd_dimm_validate(fmd_hdl_t *);
extern void cmd_dimm_gc(fmd_hdl_t *);
extern void cmd_dimm_fini(fmd_hdl_t *);
extern void cmd_dimmlist_free(fmd_hdl_t *);
#ifdef __cplusplus
}
#endif
#endif /* _CMD_DIMM_H */