diff options
author | Martin Roth <martin@coreboot.org> | 2021-08-14 11:10:50 -0600 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-09-28 19:04:50 +0000 |
commit | 96f26d15ee740318b43d196b618a756edad71cdd (patch) | |
tree | 162429fe2725399f947b3969092b7117eb107ed0 /src/arch | |
parent | d3b6d84e11ffa19c7d9f9f9cfaadf1c8256c1d5e (diff) |
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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56978
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/include/arch/hlt.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/x86/include/arch/hlt.h b/src/arch/x86/include/arch/hlt.h index 3709df2807..887c737b9c 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 */ |