From 23a542566b89d5f00dbd3f5442e63f6d0cbf7477 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Thu, 1 Jul 2021 10:38:06 -0700 Subject: System: Add SYSTEM_IN_MANUAL_RECOVERY flag This patch adds SYSTEM_IN_MANUAL_RECOVERY, which indicates the system is in recovery mode. It's set when EC_HOST_EVENT_KEYBOARD_RECOVERY is set and cleared when the system shuts down (not when the host event flag is cleared). BUG=b:188242794 BRANCH=None TEST=Verify sysinfo command prints 'Recovery: yes' in recovery screen. TEST=Verify sysinfo command prints 'Recovery: no' after shutting down from recovery screen. Change-Id: I357e25fa4072cb4549dbe2c6bd476b0a93ccbb38 Signed-off-by: Daisuke Nojiri Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001190 --- include/system.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/system.h') diff --git a/include/system.h b/include/system.h index deb97b5023..230141fffe 100644 --- a/include/system.h +++ b/include/system.h @@ -63,6 +63,19 @@ void system_common_pre_init(void); */ int system_is_manual_recovery(void); +/** + * Set a flag indicating system is in recovery mode. + */ +void system_enter_manual_recovery(void); + +/** + * Set a flag indicating system left recovery mode. + * + * WARNING: This flag should be cleared right after a shutdown from recovery + * boot. You most likely shouldn't call this elsewhere. + */ +void system_exit_manual_recovery(void); + /** * Make sure AP shutdown completely, before call system_hibernate */ -- cgit v1.2.1