From 555a4470c7e6373cb6d5397ea5e9278317bcb008 Mon Sep 17 00:00:00 2001 From: You-Cheng Syu Date: Tue, 9 Apr 2019 13:04:34 +0800 Subject: include: Move RESET_FLAG_* into ec_commands.h as EC_RESET_FLAG_* RESET_FLAGS_* are used when setting/reading the field ec_reset_flags of struct ec_response_uptime_info, which is defined in ec_commands.h. So it might be better to put those macros there. To be consistent with the other macros in the file, add "EC_" prefixes to them. BUG=b:109900671,b:118654976 BRANCH=none TEST=make buildall -j Cq-Depend: chrome-internal:1054910, chrome-internal:1054911, chrome-internal:1045539 Change-Id: If72ec25f1b34d8d46b74479fb4cd09252102aafa Signed-off-by: You-Cheng Syu Reviewed-on: https://chromium-review.googlesource.com/1520574 Tested-by: Yu-Ping Wu Commit-Ready: Yu-Ping Wu Legacy-Commit-Queue: Commit Bot Reviewed-by: Yilun Lin Reviewed-by: Daisuke Nojiri --- common/system.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'common/system.c') diff --git a/common/system.c b/common/system.c index db12aa5535..c7918b96f6 100644 --- a/common/system.c +++ b/common/system.c @@ -234,17 +234,18 @@ void system_encode_save_flags(int reset_flags, uint32_t *save_flags) /* Save current reset reasons if necessary */ if (reset_flags & SYSTEM_RESET_PRESERVE_FLAGS) - *save_flags = system_get_reset_flags() | RESET_FLAG_PRESERVED; + *save_flags = system_get_reset_flags() | + EC_RESET_FLAG_PRESERVED; /* Add in AP off flag into saved flags. */ if (reset_flags & SYSTEM_RESET_LEAVE_AP_OFF) - *save_flags |= RESET_FLAG_AP_OFF; + *save_flags |= EC_RESET_FLAG_AP_OFF; /* Save reset flag */ if (reset_flags & (SYSTEM_RESET_HARD | SYSTEM_RESET_WAIT_EXT)) - *save_flags |= RESET_FLAG_HARD; + *save_flags |= EC_RESET_FLAG_HARD; else - *save_flags |= RESET_FLAG_SOFT; + *save_flags |= EC_RESET_FLAG_SOFT; } uint32_t system_get_reset_flags(void) @@ -782,7 +783,7 @@ void system_common_pre_init(void) * was not already logged. This must happen before calculating * jump_data address because it might change panic pointer. */ - if (system_get_reset_flags() & RESET_FLAG_WATCHDOG) { + if (system_get_reset_flags() & EC_RESET_FLAG_WATCHDOG) { uint32_t reason; uint32_t info; uint8_t exception; @@ -818,7 +819,7 @@ void system_common_pre_init(void) /* Yes, we jumped to this image */ jumped_to_image = 1; /* Restore the reset flags */ - reset_flags = jdata->reset_flags | RESET_FLAG_SYSJUMP; + reset_flags = jdata->reset_flags | EC_RESET_FLAG_SYSJUMP; /* * If the jump data structure isn't the same size as the @@ -904,8 +905,8 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd) if (IS_ENABLED(CONFIG_POWER_BUTTON_INIT_IDLE)) { CPRINTS("Clearing AP_OFF"); - chip_save_reset_flags( - chip_read_reset_flags() & ~RESET_FLAG_AP_OFF); + chip_save_reset_flags(chip_read_reset_flags() & + ~EC_RESET_FLAG_AP_OFF); } /* Intentional fall-through */ case EC_REBOOT_HIBERNATE: -- cgit v1.2.1