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

TOMOYO Linux Cross Reference
Linux/include/acpi/ghes.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/acpi/ghes.h (Version linux-6.12-rc7) and /include/acpi/ghes.h (Version linux-5.13.19)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef GHES_H                                      2 #ifndef GHES_H
  3 #define GHES_H                                      3 #define GHES_H
  4                                                     4 
  5 #include <acpi/apei.h>                              5 #include <acpi/apei.h>
  6 #include <acpi/hed.h>                               6 #include <acpi/hed.h>
  7                                                     7 
  8 /*                                                  8 /*
  9  * One struct ghes is created for each generic      9  * One struct ghes is created for each generic hardware error source.
 10  * It provides the context for APEI hardware e     10  * It provides the context for APEI hardware error timer/IRQ/SCI/NMI
 11  * handler.                                        11  * handler.
 12  *                                                 12  *
 13  * estatus: memory buffer for error status blo     13  * estatus: memory buffer for error status block, allocated during
 14  * HEST parsing.                                   14  * HEST parsing.
 15  */                                                15  */
 16 #define GHES_EXITING            0x0002             16 #define GHES_EXITING            0x0002
 17                                                    17 
 18 struct ghes {                                      18 struct ghes {
 19         union {                                    19         union {
 20                 struct acpi_hest_generic *gene     20                 struct acpi_hest_generic *generic;
 21                 struct acpi_hest_generic_v2 *g     21                 struct acpi_hest_generic_v2 *generic_v2;
 22         };                                         22         };
 23         struct acpi_hest_generic_status *estat     23         struct acpi_hest_generic_status *estatus;
 24         unsigned long flags;                       24         unsigned long flags;
 25         union {                                    25         union {
 26                 struct list_head list;             26                 struct list_head list;
 27                 struct timer_list timer;           27                 struct timer_list timer;
 28                 unsigned int irq;                  28                 unsigned int irq;
 29         };                                         29         };
 30         struct device *dev;                    << 
 31         struct list_head elist;                << 
 32 };                                                 30 };
 33                                                    31 
 34 struct ghes_estatus_node {                         32 struct ghes_estatus_node {
 35         struct llist_node llnode;                  33         struct llist_node llnode;
 36         struct acpi_hest_generic *generic;         34         struct acpi_hest_generic *generic;
 37         struct ghes *ghes;                         35         struct ghes *ghes;
 38                                                    36 
 39         int task_work_cpu;                         37         int task_work_cpu;
 40         struct callback_head task_work;            38         struct callback_head task_work;
 41 };                                                 39 };
 42                                                    40 
 43 struct ghes_estatus_cache {                        41 struct ghes_estatus_cache {
 44         u32 estatus_len;                           42         u32 estatus_len;
 45         atomic_t count;                            43         atomic_t count;
 46         struct acpi_hest_generic *generic;         44         struct acpi_hest_generic *generic;
 47         unsigned long long time_in;                45         unsigned long long time_in;
 48         struct rcu_head rcu;                       46         struct rcu_head rcu;
 49 };                                                 47 };
 50                                                    48 
 51 enum {                                             49 enum {
 52         GHES_SEV_NO = 0x0,                         50         GHES_SEV_NO = 0x0,
 53         GHES_SEV_CORRECTED = 0x1,                  51         GHES_SEV_CORRECTED = 0x1,
 54         GHES_SEV_RECOVERABLE = 0x2,                52         GHES_SEV_RECOVERABLE = 0x2,
 55         GHES_SEV_PANIC = 0x3,                      53         GHES_SEV_PANIC = 0x3,
 56 };                                                 54 };
 57                                                    55 
 58 #ifdef CONFIG_ACPI_APEI_GHES                       56 #ifdef CONFIG_ACPI_APEI_GHES
 59 /**                                                57 /**
 60  * ghes_register_vendor_record_notifier - regi     58  * ghes_register_vendor_record_notifier - register a notifier for vendor
 61  * records that the kernel would otherwise ign     59  * records that the kernel would otherwise ignore.
 62  * @nb: pointer to the notifier_block structur     60  * @nb: pointer to the notifier_block structure of the event handler.
 63  *                                                 61  *
 64  * return 0 : SUCCESS, non-zero : FAIL             62  * return 0 : SUCCESS, non-zero : FAIL
 65  */                                                63  */
 66 int ghes_register_vendor_record_notifier(struc     64 int ghes_register_vendor_record_notifier(struct notifier_block *nb);
 67                                                    65 
 68 /**                                                66 /**
 69  * ghes_unregister_vendor_record_notifier - un     67  * ghes_unregister_vendor_record_notifier - unregister the previously
 70  * registered vendor record notifier.              68  * registered vendor record notifier.
 71  * @nb: pointer to the notifier_block structur     69  * @nb: pointer to the notifier_block structure of the vendor record handler.
 72  */                                                70  */
 73 void ghes_unregister_vendor_record_notifier(st     71 void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
                                                   >>  72 #endif
                                                   >>  73 
                                                   >>  74 int ghes_estatus_pool_init(int num_ghes);
                                                   >>  75 
                                                   >>  76 /* From drivers/edac/ghes_edac.c */
                                                   >>  77 
                                                   >>  78 #ifdef CONFIG_EDAC_GHES
                                                   >>  79 void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err);
 74                                                    80 
 75 struct list_head *ghes_get_devices(void);      !!  81 int ghes_edac_register(struct ghes *ghes, struct device *dev);
                                                   >>  82 
                                                   >>  83 void ghes_edac_unregister(struct ghes *ghes);
 76                                                    84 
 77 void ghes_estatus_pool_region_free(unsigned lo << 
 78 #else                                              85 #else
 79 static inline struct list_head *ghes_get_devic !!  86 static inline void ghes_edac_report_mem_error(int sev,
                                                   >>  87                                        struct cper_sec_mem_err *mem_err)
                                                   >>  88 {
                                                   >>  89 }
 80                                                    90 
 81 static inline void ghes_estatus_pool_region_fr !!  91 static inline int ghes_edac_register(struct ghes *ghes, struct device *dev)
 82 #endif                                         !!  92 {
                                                   >>  93         return -ENODEV;
                                                   >>  94 }
 83                                                    95 
 84 int ghes_estatus_pool_init(unsigned int num_gh !!  96 static inline void ghes_edac_unregister(struct ghes *ghes)
                                                   >>  97 {
                                                   >>  98 }
                                                   >>  99 #endif
 85                                                   100 
 86 static inline int acpi_hest_get_version(struct    101 static inline int acpi_hest_get_version(struct acpi_hest_generic_data *gdata)
 87 {                                                 102 {
 88         return gdata->revision >> 8;              103         return gdata->revision >> 8;
 89 }                                                 104 }
 90                                                   105 
 91 static inline void *acpi_hest_get_payload(stru    106 static inline void *acpi_hest_get_payload(struct acpi_hest_generic_data *gdata)
 92 {                                                 107 {
 93         if (acpi_hest_get_version(gdata) >= 3)    108         if (acpi_hest_get_version(gdata) >= 3)
 94                 return (void *)(((struct acpi_    109                 return (void *)(((struct acpi_hest_generic_data_v300 *)(gdata)) + 1);
 95                                                   110 
 96         return gdata + 1;                         111         return gdata + 1;
 97 }                                                 112 }
 98                                                   113 
 99 static inline int acpi_hest_get_error_length(s    114 static inline int acpi_hest_get_error_length(struct acpi_hest_generic_data *gdata)
100 {                                                 115 {
101         return ((struct acpi_hest_generic_data    116         return ((struct acpi_hest_generic_data *)(gdata))->error_data_length;
102 }                                                 117 }
103                                                   118 
104 static inline int acpi_hest_get_size(struct ac    119 static inline int acpi_hest_get_size(struct acpi_hest_generic_data *gdata)
105 {                                                 120 {
106         if (acpi_hest_get_version(gdata) >= 3)    121         if (acpi_hest_get_version(gdata) >= 3)
107                 return sizeof(struct acpi_hest    122                 return sizeof(struct acpi_hest_generic_data_v300);
108                                                   123 
109         return sizeof(struct acpi_hest_generic    124         return sizeof(struct acpi_hest_generic_data);
110 }                                                 125 }
111                                                   126 
112 static inline int acpi_hest_get_record_size(st    127 static inline int acpi_hest_get_record_size(struct acpi_hest_generic_data *gdata)
113 {                                                 128 {
114         return (acpi_hest_get_size(gdata) + ac    129         return (acpi_hest_get_size(gdata) + acpi_hest_get_error_length(gdata));
115 }                                                 130 }
116                                                   131 
117 static inline void *acpi_hest_get_next(struct     132 static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
118 {                                                 133 {
119         return (void *)(gdata) + acpi_hest_get    134         return (void *)(gdata) + acpi_hest_get_record_size(gdata);
120 }                                                 135 }
121                                                   136 
122 #define apei_estatus_for_each_section(estatus,    137 #define apei_estatus_for_each_section(estatus, section)                 \
123         for (section = (struct acpi_hest_gener    138         for (section = (struct acpi_hest_generic_data *)(estatus + 1);  \
124              (void *)section - (void *)(estatu    139              (void *)section - (void *)(estatus + 1) < estatus->data_length; \
125              section = acpi_hest_get_next(sect    140              section = acpi_hest_get_next(section))
126                                                   141 
127 #ifdef CONFIG_ACPI_APEI_SEA                       142 #ifdef CONFIG_ACPI_APEI_SEA
128 int ghes_notify_sea(void);                        143 int ghes_notify_sea(void);
129 #else                                             144 #else
130 static inline int ghes_notify_sea(void) { retu    145 static inline int ghes_notify_sea(void) { return -ENOENT; }
131 #endif                                            146 #endif
132                                                   147 
133 struct notifier_block;                         << 
134 extern void ghes_register_report_chain(struct  << 
135 extern void ghes_unregister_report_chain(struc << 
136 #endif /* GHES_H */                               148 #endif /* GHES_H */
137                                                   149 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php