error.h revision 3cac8019b3348d73726cdcdce300b35ef15e156a
229N/A/*
229N/A * CDDL HEADER START
229N/A *
229N/A * The contents of this file are subject to the terms of the
229N/A * Common Development and Distribution License, Version 1.0 only
229N/A * (the "License"). You may not use this file except in compliance
229N/A * with the License.
229N/A *
229N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
229N/A * or http://www.opensolaris.org/os/licensing.
229N/A * See the License for the specific language governing permissions
229N/A * and limitations under the License.
229N/A *
229N/A * When distributing Covered Code, include this CDDL HEADER in each
229N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
229N/A * If applicable, add the following below this CDDL HEADER, with the
229N/A * fields enclosed by brackets "[]" replaced with your own identifying
229N/A * information: Portions Copyright [yyyy] [name of copyright owner]
229N/A *
229N/A * CDDL HEADER END
3817N/A */
229N/A/*
229N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
229N/A * Use is subject to license terms.
1244N/A */
229N/A
229N/A#ifndef _ERROR_H
618N/A#define _ERROR_H
229N/A
1258N/A#pragma ident "%Z%%M% %I% %E% SMI"
229N/A
2899N/A#ifdef __cplusplus
2899N/Aextern "C" {
4194N/A#endif
3817N/A
3817N/A#define CPU_RQ_ENTRIES 64
229N/A#define CPU_NRQ_ENTRIES 64
229N/A
229N/A
229N/A/*
229N/A * Resumable and Non-resumable queues
229N/A */
229N/A#define CPU_RQ 0x3e
229N/A#define CPU_NRQ 0x3f
229N/A#define Q_ENTRY_SIZE 64
1938N/A#define CPU_RQ_SIZE (CPU_RQ_ENTRIES * Q_ENTRY_SIZE)
1938N/A#define CPU_NRQ_SIZE (CPU_NRQ_ENTRIES * Q_ENTRY_SIZE)
718N/A
718N/A/*
718N/A * Sun4v Error Report error Descriptor describes the type of the error
229N/A */
229N/A#define ERRH_DESC_UNDEFINED 0 /* Undefined */
229N/A#define ERRH_DESC_UCOR_RE 1 /* Uncorrected resumable error */
229N/A#define ERRH_DESC_PR_NRE 2 /* Precise non-resumable error */
229N/A#define ERRH_DESC_DEF_NRE 3 /* Deferred non-resumalbe error */
229N/A#define ERRH_DESC_WARN_RE 4 /* Power-off for vBSC HostShutdown() */
229N/A
229N/A/*
3817N/A * Sun4v Error Report Error Attributes specifies the attributes of the error
3817N/A */
3817N/A#define ERRH_ATTR_CPU 0x00000001
#define ERRH_ATTR_MEM 0x00000002
#define ERRH_ATTR_PIO 0x00000004
#define ERRH_ATTR_IRF 0x00000008 /* Integer register file */
/* Floating-point register file */
#define ERRH_ATTR_FRF 0x00000010
#define ERRH_ATTR_RQF 0x80000000 /* Resumablee Queue Full */
/*
* For Excution mode
*/
#define ERRH_MODE_MASK 0x03000000
#define ERRH_MODE_SHIFT 24
#define ERRH_MODE_UNKNOWN 0
#define ERRH_MODE_USER 1
#define ERRH_MODE_PRIV 2
#ifndef _ASM
/*
* For debug print out
*/
#define ER_SZ_IN_EXT_WORD (Q_ENTRY_SIZE / sizeof (uint64_t))
/*
* Sun4v Error Report record
*/
typedef struct {
uint64_t ehdl; /* Unique error handle */
uint64_t stick; /* Value of the %STICK register */
uint32_t desc; /* Error Descriptor */
uint32_t attr; /* error attributes bit field */
uint64_t ra; /* Real address */
uint32_t sz; /* Size of affected mem region */
uint16_t cpuid; /* Virtual ID of the affected CPU */
} errh_er_t;
typedef struct errh_async_flt {
struct async_flt cmn_asyncflt; /* common fault structure */
errh_er_t errh_er; /* sun4v er record */
} errh_async_flt_t;
/*
* Global functions
*/
void mem_scrub(uint64_t, uint64_t);
void errh_cpu_run_bus_error_handlers(struct async_flt *, int);
void error_init(void);
void cpu_async_log_err(void *);
void cpu_ce_log_err(struct async_flt *);
void cpu_ue_log_err(struct async_flt *);
void mem_sync(caddr_t, size_t);
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _ERROR_H */