Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56978 )
Change subject: arch/x86: Make sure compiler knows we're stopping in hlt() ......................................................................
arch/x86: Make sure compiler knows we're stopping in hlt()
Currently, static analyzers don't recognize that hlt() doesn't return, so they show errors like uninitialized variables assuming that it does return. This takes care of that problem.
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: Ia2325700b10fe1f89d749edfe5aee72b47d02f2e --- M src/arch/x86/include/arch/hlt.h 1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/56978/1
diff --git a/src/arch/x86/include/arch/hlt.h b/src/arch/x86/include/arch/hlt.h index 3709df2..887c737 100644 --- a/src/arch/x86/include/arch/hlt.h +++ b/src/arch/x86/include/arch/hlt.h @@ -3,9 +3,10 @@ #ifndef ARCH_HLT_H #define ARCH_HLT_H
-static __always_inline void hlt(void) +static __noreturn __always_inline void hlt(void) { - asm("hlt"); + while (1) + asm("hlt"); }
#endif /* ARCH_HLT_H */