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>
This commit is contained in:
Martin Roth 2021-08-14 11:10:50 -06:00 committed by Felix Held
parent d3b6d84e11
commit 96f26d15ee
1 changed files with 3 additions and 2 deletions

View File

@ -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 */