~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/ia64/kernel/mca_drv.h

Version: ~ [ linux-5.14-rc1 ] ~ [ linux-5.13.1 ] ~ [ linux-5.12.16 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.49 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.131 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.197 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.239 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.275 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.275 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * File:        mca_drv.h
  3  * Purpose:     Define helpers for Generic MCA handling
  4  *
  5  * Copyright (C) 2004 FUJITSU LIMITED
  6  * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
  7  */
  8 /*
  9  * Processor error section:
 10  *
 11  *  +-sal_log_processor_info_t *info-------------+
 12  *  | sal_log_section_hdr_t header;              |
 13  *  | ...                                        |
 14  *  | sal_log_mod_error_info_t info[0];          |
 15  *  +-+----------------+-------------------------+
 16  *    | CACHE_CHECK    |  ^ num_cache_check v
 17  *    +----------------+
 18  *    | TLB_CHECK      |  ^ num_tlb_check v
 19  *    +----------------+
 20  *    | BUS_CHECK      |  ^ num_bus_check v
 21  *    +----------------+
 22  *    | REG_FILE_CHECK |  ^ num_reg_file_check v
 23  *    +----------------+
 24  *    | MS_CHECK       |  ^ num_ms_check v
 25  *  +-struct cpuid_info *id----------------------+
 26  *  | regs[5];                                   |
 27  *  | reserved;                                  |
 28  *  +-sal_processor_static_info_t *regs----------+
 29  *  | valid;                                     |
 30  *  | ...                                        |
 31  *  | fr[128];                                   |
 32  *  +--------------------------------------------+
 33  */
 34 
 35 /* peidx: index of processor error section */
 36 typedef struct peidx_table {
 37         sal_log_processor_info_t        *info;
 38         struct sal_cpuid_info           *id;
 39         sal_processor_static_info_t     *regs;
 40 } peidx_table_t;
 41 
 42 #define peidx_head(p)   (((p)->info))
 43 #define peidx_mid(p)    (((p)->id))
 44 #define peidx_bottom(p) (((p)->regs))
 45 
 46 #define peidx_psp(p)           (&(peidx_head(p)->proc_state_parameter))
 47 #define peidx_field_valid(p)   (&(peidx_head(p)->valid))
 48 #define peidx_minstate_area(p) (&(peidx_bottom(p)->min_state_area))
 49 
 50 #define peidx_cache_check_num(p)    (peidx_head(p)->valid.num_cache_check)
 51 #define peidx_tlb_check_num(p)      (peidx_head(p)->valid.num_tlb_check)
 52 #define peidx_bus_check_num(p)      (peidx_head(p)->valid.num_bus_check)
 53 #define peidx_reg_file_check_num(p) (peidx_head(p)->valid.num_reg_file_check)
 54 #define peidx_ms_check_num(p)       (peidx_head(p)->valid.num_ms_check)
 55 
 56 #define peidx_cache_check_idx(p, n)    (n)
 57 #define peidx_tlb_check_idx(p, n)      (peidx_cache_check_idx(p, peidx_cache_check_num(p)) + n)
 58 #define peidx_bus_check_idx(p, n)      (peidx_tlb_check_idx(p, peidx_tlb_check_num(p)) + n)
 59 #define peidx_reg_file_check_idx(p, n) (peidx_bus_check_idx(p, peidx_bus_check_num(p)) + n)
 60 #define peidx_ms_check_idx(p, n)       (peidx_reg_file_check_idx(p, peidx_reg_file_check_num(p)) + n)
 61 
 62 #define peidx_mod_error_info(p, name, n) \
 63 ({      int __idx = peidx_##name##_idx(p, n); \
 64         sal_log_mod_error_info_t *__ret = NULL; \
 65         if (peidx_##name##_num(p) > n) /*BUG*/ \
 66                 __ret = &(peidx_head(p)->info[__idx]); \
 67         __ret; })
 68 
 69 #define peidx_cache_check(p, n)    peidx_mod_error_info(p, cache_check, n)
 70 #define peidx_tlb_check(p, n)      peidx_mod_error_info(p, tlb_check, n)
 71 #define peidx_bus_check(p, n)      peidx_mod_error_info(p, bus_check, n)
 72 #define peidx_reg_file_check(p, n) peidx_mod_error_info(p, reg_file_check, n)
 73 #define peidx_ms_check(p, n)       peidx_mod_error_info(p, ms_check, n)
 74 
 75 #define peidx_check_info(proc, name, n) \
 76 ({ \
 77         sal_log_mod_error_info_t *__info = peidx_mod_error_info(proc, name, n);\
 78         u64 __temp = __info && __info->valid.check_info \
 79                 ? __info->check_info : 0; \
 80         __temp; })
 81 
 82 /* slidx: index of SAL log error record */
 83 
 84 typedef struct slidx_list {
 85         struct list_head list;
 86         sal_log_section_hdr_t *hdr;
 87 } slidx_list_t;
 88 
 89 typedef struct slidx_table {
 90         sal_log_record_header_t *header;
 91         int n_sections;                 /* # of section headers */
 92         struct list_head proc_err;
 93         struct list_head mem_dev_err;
 94         struct list_head sel_dev_err;
 95         struct list_head pci_bus_err;
 96         struct list_head smbios_dev_err;
 97         struct list_head pci_comp_err;
 98         struct list_head plat_specific_err;
 99         struct list_head host_ctlr_err;
100         struct list_head plat_bus_err;
101         struct list_head unsupported;   /* list of unsupported sections */
102 } slidx_table_t;
103 
104 #define slidx_foreach_entry(pos, head) \
105         list_for_each_entry(pos, head, list)
106 #define slidx_first_entry(head) \
107         (((head)->next != (head)) ? list_entry((head)->next, typeof(slidx_list_t), list) : NULL)
108 #define slidx_count(slidx, sec) \
109 ({      int __count = 0; \
110         slidx_list_t *__pos; \
111         slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\
112         __count; })
113 
114 struct mca_table_entry {
115         int start_addr; /* location-relative starting address of MCA recoverable range */
116         int end_addr;   /* location-relative ending address of MCA recoverable range */
117 };
118 
119 extern const struct mca_table_entry *search_mca_tables (unsigned long addr);
120 extern int mca_recover_range(unsigned long);
121 extern void ia64_mlogbuf_dump(void);
122 
123 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp