mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[boot] Centralize where to hlt on error
Searching for `hlt` in disassembly is an easy way to find the error handler. This change centralizes it to just one, to better match disassembly with code.
This commit is contained in:
@@ -63,16 +63,15 @@ uefi_handler::uefi_handler(console &con) :
|
||||
{
|
||||
}
|
||||
|
||||
[[ noreturn ]] void
|
||||
void
|
||||
uefi_handler::handle(uefi::status s, const wchar_t *message)
|
||||
{
|
||||
status_line::fail(message, error_message(s));
|
||||
while (1) asm("hlt");
|
||||
}
|
||||
|
||||
cpu_assert_handler::cpu_assert_handler() : handler() {}
|
||||
|
||||
[[ noreturn ]] void
|
||||
void
|
||||
cpu_assert_handler::handle(uefi::status s, const wchar_t *message)
|
||||
{
|
||||
asm volatile (
|
||||
@@ -83,7 +82,6 @@ cpu_assert_handler::handle(uefi::status s, const wchar_t *message)
|
||||
:
|
||||
: "r"((uint64_t)s)
|
||||
: "rax", "rdx", "r8", "r9");
|
||||
while (1) asm("hlt");
|
||||
}
|
||||
|
||||
} // namespace error
|
||||
|
||||
@@ -39,7 +39,8 @@ class uefi_handler :
|
||||
{
|
||||
public:
|
||||
uefi_handler(console &con);
|
||||
[[ noreturn ]] void handle(uefi::status, const wchar_t*) override;
|
||||
virtual ~uefi_handler() {}
|
||||
void handle(uefi::status, const wchar_t*) override;
|
||||
|
||||
private:
|
||||
console &m_con;
|
||||
@@ -52,7 +53,8 @@ class cpu_assert_handler :
|
||||
{
|
||||
public:
|
||||
cpu_assert_handler();
|
||||
[[ noreturn ]] void handle(uefi::status, const wchar_t*) override;
|
||||
virtual ~cpu_assert_handler() {}
|
||||
void handle(uefi::status, const wchar_t*) override;
|
||||
};
|
||||
|
||||
} // namespace error
|
||||
|
||||
Reference in New Issue
Block a user