Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6070
-gerrit
commit 828072ec9beb4408717d29240e35ad5b9d503dbd Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Thu Jun 19 19:45:40 2014 +0300
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 --- src/arch/x86/boot/acpi.c | 5 +++++ 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 6c1788d..012c101 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 a4cde20..362e1c0 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 */