From 95c4344a2092bd9fd5eca74d23d0c270628f66d2 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 13 Jul 2016 12:08:33 -0500 Subject: arch/x86: provide common ACPI_Sx constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of open coding the literal values provide more semantic symbol to be used. This will allow for aligning chipset code with this as well to reduce duplication. BUG=chrome-os-partner:54977 Change-Id: I022bf1eb258f7244f2e5aa2fb72b7b82e1900a5c Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/15663 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Furquan Shaikh Reviewed-by: Duncan Laurie --- src/arch/x86/include/arch/acpi.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index 7434000560..03cd70948e 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -615,7 +615,16 @@ void acpi_prepare_resume_backup(void); void mainboard_suspend_resume(void); void *acpi_find_wakeup_vector(void); -/* Returns 0 = S0, 1 = S1 ... */ +enum { + ACPI_S0, + ACPI_S1, + ACPI_S2, + ACPI_S3, + ACPI_S4, + ACPI_S5, +}; + +/* Returns ACPI_Sx values. */ int acpi_get_sleep_type(void); static inline int acpi_s3_resume_allowed(void) @@ -629,7 +638,7 @@ extern int acpi_slp_type; #ifdef __PRE_RAM__ static inline int acpi_is_wakeup_s3(void) { - return (acpi_get_sleep_type() == 3); + return (acpi_get_sleep_type() == ACPI_S3); } #else int acpi_is_wakeup(void); @@ -639,7 +648,7 @@ int acpi_is_wakeup_s4(void); void acpi_prepare_for_resume(void); #else -#define acpi_slp_type 0 +#define acpi_slp_type ACPI_S0 static inline int acpi_is_wakeup(void) { return 0; } static inline int acpi_is_wakeup_s3(void) { return 0; } static inline int acpi_is_wakeup_s4(void) { return 0; } -- cgit v1.2.3