diff options
-rw-r--r-- | board/zinger/runtime.c | 1 | ||||
-rw-r--r-- | chip/g/system.c | 3 | ||||
-rw-r--r-- | chip/host/reboot.c | 3 | ||||
-rw-r--r-- | chip/host/reboot.h | 1 | ||||
-rw-r--r-- | chip/mec1322/system.c | 1 | ||||
-rw-r--r-- | include/panic.h | 4 | ||||
-rw-r--r-- | include/system.h | 2 |
7 files changed, 11 insertions, 4 deletions
diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c index 6267100b0c..11b1643d30 100644 --- a/board/zinger/runtime.c +++ b/board/zinger/runtime.c @@ -236,6 +236,7 @@ uint32_t task_wait_event_mask(uint32_t event_mask, int timeout_us) return evt & event_mask; } +__attribute__((noreturn)) void __keep cpu_reset(void) { /* Disable interrupts */ diff --git a/chip/g/system.c b/chip/g/system.c index 473343e555..012d5372cb 100644 --- a/chip/g/system.c +++ b/chip/g/system.c @@ -158,7 +158,8 @@ void system_reset(int flags) #endif /* ^^^^^^^ CHIP_FAMILY_CR50 Not defined */ /* Wait for reboot; should never return */ - asm("wfi"); + while (1) + asm("wfi"); } const char *system_get_chip_vendor(void) diff --git a/chip/host/reboot.c b/chip/host/reboot.c index 526276aede..7fdb6f7f8e 100644 --- a/chip/host/reboot.c +++ b/chip/host/reboot.c @@ -12,9 +12,12 @@ #include "reboot.h" #include "test_util.h" +__attribute__((noreturn)) void emulator_reboot(void) { char *argv[] = {strdup(__get_prog_name()), NULL}; emulator_flush(); execv(__get_prog_name(), argv); + while (1) + ; } diff --git a/chip/host/reboot.h b/chip/host/reboot.h index e391866497..113569bb9b 100644 --- a/chip/host/reboot.h +++ b/chip/host/reboot.h @@ -8,6 +8,7 @@ #ifndef __CROS_EC_REBOOT_H #define __CROS_EC_REBOOT_H +__attribute__((noreturn)) void emulator_reboot(void); #endif diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index 4b2738e969..57e1f8816a 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -98,6 +98,7 @@ void chip_save_reset_flags(int flags) MEC1322_VBAT_RAM(HIBDATA_INDEX_SAVED_RESET_FLAGS) = flags; } +__attribute__((noreturn)) void _system_reset(int flags, int wake_from_hibernate) { uint32_t save_flags = 0; diff --git a/include/panic.h b/include/panic.h index 57eaf6788f..e5e16dd190 100644 --- a/include/panic.h +++ b/include/panic.h @@ -129,12 +129,12 @@ void panic_assert_fail(const char *msg, const char *func, const char *fname, * * @param msg Panic message */ -void panic(const char *msg); +void panic(const char *msg) __attribute__((noreturn)); /** * Display a default message and reset */ -void panic_reboot(void); +void panic_reboot(void) __attribute__((noreturn)); #ifdef CONFIG_SOFTWARE_PANIC /** diff --git a/include/system.h b/include/system.h index 0d94fc0fe0..5587446ff9 100644 --- a/include/system.h +++ b/include/system.h @@ -267,7 +267,7 @@ const char *system_get_build_info(void); * * @param flags Reset flags; see SYSTEM_RESET_* above. */ -void system_reset(int flags); +void system_reset(int flags) __attribute__((noreturn)); /** * Set a scratchpad register to the specified value. |