Message ID | 20210813213539.546368-1-alex.hung@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] lib: fwts_acpi_tables: add a function to get FADT versions | expand |
On 8/14/21 5:35 AM, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@canonical.com> > --- > src/lib/include/fwts_acpi_tables.h | 1 + > src/lib/src/fwts_acpi_tables.c | 14 ++++++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h > index 2ac649bb..6b768d79 100644 > --- a/src/lib/include/fwts_acpi_tables.h > +++ b/src/lib/include/fwts_acpi_tables.h > @@ -92,5 +92,6 @@ void fwts_acpi_space_id(fwts_framework *fw, const char *table, const char *field > const uint8_t actual, const uint8_t num_type, ...); > > uint32_t fwts_get_acpi_version(fwts_framework *fw); > +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor); > > #endif > diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c > index b08cbdfd..9f12539f 100644 > --- a/src/lib/src/fwts_acpi_tables.c > +++ b/src/lib/src/fwts_acpi_tables.c > @@ -1829,3 +1829,17 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw) > > return acpi_version; > } > + > +/* > + * fwts_get_fadt_version() > + * get fadt major and minor versions > + */ > +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor) > +{ > + uint32_t acpi_version; > + > + /* ACPI version = FADT major & minor versions */ > + acpi_version = fwts_get_acpi_version(fw); > + *major = (acpi_version & 0xF00) >> 8; > + *minor = (acpi_version & 0xFF) >> 4; > +} > Acked-by: Ivan Hu <ivan.hu@canonical.com>
On 13/08/2021 22:35, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@canonical.com> > --- > src/lib/include/fwts_acpi_tables.h | 1 + > src/lib/src/fwts_acpi_tables.c | 14 ++++++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h > index 2ac649bb..6b768d79 100644 > --- a/src/lib/include/fwts_acpi_tables.h > +++ b/src/lib/include/fwts_acpi_tables.h > @@ -92,5 +92,6 @@ void fwts_acpi_space_id(fwts_framework *fw, const char *table, const char *field > const uint8_t actual, const uint8_t num_type, ...); > > uint32_t fwts_get_acpi_version(fwts_framework *fw); > +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor); > > #endif > diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c > index b08cbdfd..9f12539f 100644 > --- a/src/lib/src/fwts_acpi_tables.c > +++ b/src/lib/src/fwts_acpi_tables.c > @@ -1829,3 +1829,17 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw) > > return acpi_version; > } > + > +/* > + * fwts_get_fadt_version() > + * get fadt major and minor versions > + */ > +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor) > +{ > + uint32_t acpi_version; > + > + /* ACPI version = FADT major & minor versions */ > + acpi_version = fwts_get_acpi_version(fw); > + *major = (acpi_version & 0xF00) >> 8; > + *minor = (acpi_version & 0xFF) >> 4; > +} > Acked-by: Colin Ian King <colin.king@canonical.com>
diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h index 2ac649bb..6b768d79 100644 --- a/src/lib/include/fwts_acpi_tables.h +++ b/src/lib/include/fwts_acpi_tables.h @@ -92,5 +92,6 @@ void fwts_acpi_space_id(fwts_framework *fw, const char *table, const char *field const uint8_t actual, const uint8_t num_type, ...); uint32_t fwts_get_acpi_version(fwts_framework *fw); +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor); #endif diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index b08cbdfd..9f12539f 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1829,3 +1829,17 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw) return acpi_version; } + +/* + * fwts_get_fadt_version() + * get fadt major and minor versions + */ +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor) +{ + uint32_t acpi_version; + + /* ACPI version = FADT major & minor versions */ + acpi_version = fwts_get_acpi_version(fw); + *major = (acpi_version & 0xF00) >> 8; + *minor = (acpi_version & 0xFF) >> 4; +}
Signed-off-by: Alex Hung <alex.hung@canonical.com> --- src/lib/include/fwts_acpi_tables.h | 1 + src/lib/src/fwts_acpi_tables.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+)