/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.6*/7#ifndef _ASM_IA64_SN_IOERROR_H8#define _ASM_IA64_SN_IOERROR_H910/*11* IO error structure.12*13* This structure would expand to hold the information retrieved from14* all IO related error registers.15*16* This structure is defined to hold all system specific17* information related to a single error.18*19* This serves a couple of purpose.20* - Error handling often involves translating one form of address to other21* form. So, instead of having different data structures at each level,22* we have a single structure, and the appropriate fields get filled in23* at each layer.24* - This provides a way to dump all error related information in any layer25* of erorr handling (debugging aid).26*27* A second possibility is to allow each layer to define its own error28* data structure, and fill in the proper fields. This has the advantage29* of isolating the layers.30* A big concern is the potential stack usage (and overflow), if each layer31* defines these structures on stack (assuming we don't want to do kmalloc.32*33* Any layer wishing to pass extra information to a layer next to it in34* error handling hierarchy, can do so as a separate parameter.35*/3637typedef struct io_error_s {38/* Bit fields indicating which structure fields are valid */39union {40struct {41unsigned ievb_errortype:1;42unsigned ievb_widgetnum:1;43unsigned ievb_widgetdev:1;44unsigned ievb_srccpu:1;45unsigned ievb_srcnode:1;46unsigned ievb_errnode:1;47unsigned ievb_sysioaddr:1;48unsigned ievb_xtalkaddr:1;49unsigned ievb_busspace:1;50unsigned ievb_busaddr:1;51unsigned ievb_vaddr:1;52unsigned ievb_memaddr:1;53unsigned ievb_epc:1;54unsigned ievb_ef:1;55unsigned ievb_tnum:1;56} iev_b;57unsigned iev_a;58} ie_v;5960short ie_errortype; /* error type: extra info about error */61short ie_widgetnum; /* Widget number that's in error */62short ie_widgetdev; /* Device within widget in error */63cpuid_t ie_srccpu; /* CPU on srcnode generating error */64cnodeid_t ie_srcnode; /* Node which caused the error */65cnodeid_t ie_errnode; /* Node where error was noticed */66iopaddr_t ie_sysioaddr; /* Sys specific IO address */67iopaddr_t ie_xtalkaddr; /* Xtalk (48bit) addr of Error */68iopaddr_t ie_busspace; /* Bus specific address space */69iopaddr_t ie_busaddr; /* Bus specific address */70caddr_t ie_vaddr; /* Virtual address of error */71iopaddr_t ie_memaddr; /* Physical memory address */72caddr_t ie_epc; /* pc when error reported */73caddr_t ie_ef; /* eframe when error reported */74short ie_tnum; /* Xtalk TNUM field */75} ioerror_t;7677#define IOERROR_INIT(e) do { (e)->ie_v.iev_a = 0; } while (0)78#define IOERROR_SETVALUE(e,f,v) do { (e)->ie_ ## f = (v); (e)->ie_v.iev_b.ievb_ ## f = 1; } while (0)7980#endif /* _ASM_IA64_SN_IOERROR_H */818283