mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ras: acpi/apei: cper: add support for generic data v3 structure
The ACPI 6.1 spec adds a new revision of the generic error data entry structure. Add support to handle the new structure as well as properly verify and iterate through the generic data entries. Signed-off-by: Tyler Baicar <[email protected]> CC: Jonathan (Zhixiong) Zhang <[email protected]> Signed-off-by: Will Deacon <[email protected]>
This commit is contained in:
parent
42aa560446
commit
bbcc2e7b64
3 changed files with 63 additions and 21 deletions
|
|
@ -73,3 +73,39 @@ static inline void ghes_edac_unregister(struct ghes *ghes)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int acpi_hest_get_version(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
return gdata->revision >> 8;
|
||||
}
|
||||
|
||||
static inline void *acpi_hest_get_payload(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
if (acpi_hest_get_version(gdata) >= 3)
|
||||
return (void *)(((struct acpi_hest_generic_data_v300 *)(gdata)) + 1);
|
||||
|
||||
return gdata + 1;
|
||||
}
|
||||
|
||||
static inline int acpi_hest_get_error_length(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
return ((struct acpi_hest_generic_data *)(gdata))->error_data_length;
|
||||
}
|
||||
|
||||
static inline int acpi_hest_get_size(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
if (acpi_hest_get_version(gdata) >= 3)
|
||||
return sizeof(struct acpi_hest_generic_data_v300);
|
||||
|
||||
return sizeof(struct acpi_hest_generic_data);
|
||||
}
|
||||
|
||||
static inline int acpi_hest_get_record_size(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
return (acpi_hest_get_size(gdata) + acpi_hest_get_error_length(gdata));
|
||||
}
|
||||
|
||||
static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
|
||||
{
|
||||
return (void *)(gdata) + acpi_hest_get_record_size(gdata);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue