cmd_dimm.h revision d4ac42a1cd3016618a9ba0330862d410f0058f89
/*
* 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
*/
/*
*/
#ifndef _CMD_DIMM_H
#define _CMD_DIMM_H
/*
* 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>
#include <values.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* CMD_MAX_CKWDS denotes the highest number, across all covered
* SPARC architectures, of checkwords per cache line.
*/
#define CMD_MAX_CKWDS 4
/*
* 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_2
typedef struct cmd_dimm_0 {
const char *dimm0_unum; /* This DIMM's name */
} cmd_dimm_0_t;
typedef struct cmd_dimm_1 {
} cmd_dimm_1_t;
typedef struct cmd_dimm_pers {
/*
* Index block for MQSC rules 4A and 4B correlation of memory CEs
* on a single DIMM. "Unit Position" refers to bit or nibble depending
* on the memory ECC. This structure is not persisted.
*/
typedef struct cmd_mq {
char *mq_serdnm; /* serd eng to retain CE events */
} cmd_mq_t;
typedef struct tstamp {
} tstamp_t;
struct cmd_dimm {
const char *dimm_unum; /* This DIMM's name */
};
/* page addrss */
#define CMD_DIMM_MAXSIZE \
#define CMD_DIMM_MINSIZE \
uint_t);
#ifdef sun4v
#endif /* sun4v */
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 */