/*
* 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.
*/
#ifndef _SYS_ERRCLASSIFY_H
#define _SYS_ERRCLASSIFY_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
/*
* Note that the order in the following must be kept in sync with that
* in the sun4u DE cmd_memerr.c and with the cetypes array of us3_common.c
*/
typedef enum {
/*
* The first byte (256 values) is for type and can be sequential.
*/
/*
* The next byte encodes the next action as a bitmask
*/
/*
* Keep this as the last entry. Not all entries of the type lookup
* table are used and this value is the "uninitialized" pattern.
*/
} ce_dispact_t;
/*
* Extract disposition or action from a ce_dispact_t
*/
(dispact & 0xff)
(dispact & 0xff00)
/*
* Short string names for classification types.
*/
/*
* Various sun4u CPU types use different Ecache state encodings.
* For CE classification the following unified scheme is used.
*/
/*
* Macros to generate the initial CE classification table (in both kernel and
* userland). An array size CE_INITDISPTBL_SIZE of ce_dispact_t should be
* defined and passed by name to ECC_INITDISPTBL_POPULATE which will populate
* the array slots that are use and set the unused ones to CE_DISP_BAD.
*
* To perform a lookup use CE_DISPACT passing the name of the same
* array and the afarmatch, ecstate, ce1 and ce2 information.
*
* Other macros defined here should not be used directly.
*
* CE_INITDISPTBL_INDEX will generate an index as follows:
*
* <5> afar match
* <4:2> line state
* <1> ce2 - CE seen on lddphys of scrub algorithm (after writeback)
* <0> ce1 - CE seen on CASXA of scrub algorithm (before writeback)
*
* When the afar does not match line state must be zero.
*/
#define CE_INITDISPTBL_POPULATE(a) \
{ \
int i; \
for (i = 0; i < CE_INITDISPTBL_SIZE; ++i) \
a[i] = CE_DISP_BAD; \
/* \
* afar ec ce1 ce2 initial disp and next action \
* match state \
*/ \
}
#endif /* !_ASM */
/*
* Legacy error type names corresponding to the flt_status bits
*/
/*
* flt_disp for a CE will record all scrub test data for the extended
* classification attempt.
*
* --------------------------------------------------------------------------
* | | partner | | | leaky | partner | detector |
* | partner id | type | - | skipcode | results | results | results |
* |63 32|31 30| |27 24|23 16|15 8|7 0|
* --------------------------------------------------------------------------
*/
/*
* Given a CE flt_disp set the given field
*/
/*
* Given a CE flt_disp extract the requested component
*/
/*
* in the detector case indicates that the extended classification algorithm
* has been applied; common code uses this to distinguish between old and new.
* In the partner check and leaky check cases CE_XDIAG_EXTALG is used to
* indicate that the given test has run and recorded its results in its
* result field.
*/
/*
* a value from one of CE_XDIAG_{DTCR,PTNR,LKY}_INFO.
*/
((c) & CE_XDIAG_STATE_MASK) : 0)
/*
* A leaky or partner test is considered valid if the line was not present
* in cache, or was present but Invalid, at the time of the additional scrub.
*/
/*
* Skipcodes - reasons for not applying extended diags; 4 bits
*/
/*
* Partner type information.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ERRCLASSIFY_H */