diff mbox series

[1/2] lib: fwts_acpi_tables: add a function to get FADT versions

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

Commit Message

Alex Hung Aug. 13, 2021, 9:35 p.m. UTC
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(+)

Comments

Ivan Hu Aug. 16, 2021, 5:41 a.m. UTC | #1
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>
Colin Ian King Aug. 16, 2021, 9:57 a.m. UTC | #2
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 mbox series

Patch

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;
+}