From ea794ac751d70663977cdf65024effac3298e6f4 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Fri, 16 Apr 2021 18:46:05 +0800 Subject: [PATCH] add noreturn attribute for LOS_Panic Change-Id: Id2c76e3282d72bce18cf0925e12afaa0c3b06a90 --- arch/arm/arm/src/los_exc.c | 1 + arch/arm/include/los_exc.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 58f66577..46468548 100755 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -1138,6 +1138,7 @@ __attribute__((noinline)) VOID LOS_Panic(const CHAR *fmt, ...) UartVprintf(fmt, ap); va_end(ap); __asm__ __volatile__("swi 0"); + while (1); } /* stack protector */ diff --git a/arch/arm/include/los_exc.h b/arch/arm/include/los_exc.h index 807bcb2f..980e7af1 100755 --- a/arch/arm/include/los_exc.h +++ b/arch/arm/include/los_exc.h @@ -183,7 +183,7 @@ extern UINT32 LOS_ExcRegHook(EXC_PROC_FUNC excHook); * los_exc.h: the header file that contains the API declaration. * @see None. */ -VOID LOS_Panic(const CHAR *fmt, ...); +VOID LOS_Panic(const CHAR *fmt, ...) __attribute__ ((noreturn)); /** * @ingroup los_exc