CBMEM ACPI: Move resume handler

Handler is ACPI/x86 specific so move details out of cbmem code.

With static CBMEM initialisation, ramstage will need to test for
S3 wakeup condition so publish also acpi_is_wakeup().

Change-Id: If591535448cdd24a54262b534c1a828fc13da759
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/4619
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@google.com>
diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c
index bdc695c..0152018 100644
--- a/src/arch/x86/boot/cbmem.c
+++ b/src/arch/x86/boot/cbmem.c
@@ -17,6 +17,7 @@
 
 #include <console/console.h>
 #include <cbmem.h>
+#include <arch/acpi.h>
 
 #if !CONFIG_DYNAMIC_CBMEM
 void get_cbmem_table(uint64_t *base, uint64_t *size)
@@ -64,3 +65,17 @@
 }
 
 #endif /* DYNAMIC_CBMEM */
+
+#if !defined(__PRE_RAM__)
+
+/* ACPI resume needs to be cleared in the fail-to-recover case, but that
+ * condition is only handled during ramstage. */
+void cbmem_fail_resume(void)
+{
+#if CONFIG_HAVE_ACPI_RESUME
+	/* Something went wrong, our high memory area got wiped */
+	acpi_fail_wakeup();
+#endif
+}
+
+#endif /* !__PRE_RAM__ */