lib: os: add gcc noreturn attribute for sys_reboot

sys_reboot doesn't return so mark it with noreturn

Signed-off-by: Christoph Thurnheer <c.thurnheer@gmx.ch>
This commit is contained in:
Christoph Thurnheer 2021-08-11 13:43:31 +02:00 committed by Christopher Friedt
commit ef97121d74
2 changed files with 5 additions and 2 deletions

View file

@ -14,6 +14,8 @@
#ifndef ZEPHYR_INCLUDE_SYS_REBOOT_H_ #ifndef ZEPHYR_INCLUDE_SYS_REBOOT_H_
#define ZEPHYR_INCLUDE_SYS_REBOOT_H_ #define ZEPHYR_INCLUDE_SYS_REBOOT_H_
#include <toolchain.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -33,7 +35,7 @@ extern "C" {
* @return N/A * @return N/A
*/ */
extern void sys_reboot(int type); extern FUNC_NORETURN void sys_reboot(int type);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -4,13 +4,14 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <sys/reboot.h>
#include <kernel.h> #include <kernel.h>
#include <sys/printk.h> #include <sys/printk.h>
extern void sys_arch_reboot(int type); extern void sys_arch_reboot(int type);
extern void sys_clock_disable(void); extern void sys_clock_disable(void);
void sys_reboot(int type) FUNC_NORETURN void sys_reboot(int type)
{ {
(void)irq_lock(); (void)irq_lock();
#ifdef CONFIG_SYS_CLOCK_EXISTS #ifdef CONFIG_SYS_CLOCK_EXISTS