diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-06-19 19:45:40 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-06-20 19:52:40 +0200 |
commit | 4d9b77287e583c89fea4bac9f1c264b01dcab981 (patch) | |
tree | 430fd7d4a7e3c44a75b14d070efea3f9fb7aa838 | |
parent | 6722f8da400ccb5553afe745ff71475c50d60f52 (diff) |
ACPI: Add acpi_is_wakeup_s3()
Test explicitly for S3 resume.
Also switch to use IS_ENABLED().
Change-Id: I17ea729f51f99ea8d6135f2c7a807623f1286238
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/6070
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
-rw-r--r-- | src/arch/x86/boot/acpi.c | 5 | ||||
-rw-r--r-- | src/arch/x86/include/arch/acpi.h | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index 6c1788d524..012c10127f 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -651,6 +651,11 @@ int acpi_is_wakeup(void) return (acpi_slp_type == 3 || acpi_slp_type == 2); } +int acpi_is_wakeup_s3(void) +{ + return (acpi_slp_type == 3); +} + void acpi_fail_wakeup(void) { if (acpi_slp_type == 3 || acpi_slp_type == 2) diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index a4cde20c73..362e1c0b7c 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -554,11 +554,12 @@ unsigned long acpi_fill_hest(acpi_hest_t *hest); void acpi_save_gnvs(u32 gnvs_address); -#if CONFIG_HAVE_ACPI_RESUME +#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) /* 0 = S0, 1 = S1 ...*/ extern u8 acpi_slp_type; int acpi_is_wakeup(void); +int acpi_is_wakeup_s3(void); void acpi_fail_wakeup(void); void acpi_resume(void *wake_vec); void __attribute__((weak)) mainboard_suspend_resume(void); @@ -567,9 +568,7 @@ void *acpi_get_wakeup_rsdp(void); void acpi_jump_to_wakeup(void *wakeup_addr); int acpi_get_sleep_type(void); -#else /* CONFIG_HAVE_ACPI_RESUME */ -#define acpi_slp_type 0 -#endif /* CONFIG_HAVE_ACPI_RESUME */ +#endif /* IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) */ /* northbridge/amd/amdfam10/amdfam10_acpi.c */ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current); @@ -580,7 +579,6 @@ void generate_cpu_entries(void); #else // CONFIG_GENERATE_ACPI_TABLES #define write_acpi_tables(start) (start) -#define acpi_slp_type 0 #endif /* CONFIG_GENERATE_ACPI_TABLES */ @@ -589,4 +587,10 @@ static inline int acpi_s3_resume_allowed(void) return IS_ENABLED(CONFIG_HAVE_ACPI_RESUME); } +#if !IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) +#define acpi_slp_type 0 +static inline int acpi_is_wakeup(void) { return 0; } +static inline int acpi_is_wakeup_s3(void) { return 0; } +#endif + #endif /* __ASM_ACPI_H */ |