mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
After exiting UEFI, the bootloader had no way of displaying status to the user. Now it will display a series of small boxes as a progress bar along the bottom of the screen if a framebuffer exists. Errors or warnings during a step will cause that step's box to turn red or orange, and display bars above it to signal the error code. This caused the simplification of the error handling system (which was mostly just calling status_line::fail) and added different types of status objects.
34 lines
738 B
C++
34 lines
738 B
C++
/// \file error.h
|
|
/// Error handling definitions
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <uefi/types.h>
|
|
|
|
namespace boot {
|
|
|
|
class console;
|
|
|
|
namespace error {
|
|
|
|
/// Halt or exit the program with the given error status/message
|
|
[[ noreturn ]] void raise(uefi::status status, const wchar_t *message);
|
|
|
|
const wchar_t * message(uefi::status status);
|
|
|
|
} // namespace error
|
|
} // namespace boot
|
|
|
|
/// Debugging psuedo-breakpoint.
|
|
void debug_break();
|
|
|
|
/// Helper macro to raise an error if an operation fails.
|
|
/// \arg s An expression evaluating to a UEFI status
|
|
/// \arg m The error message to use on failure
|
|
#define try_or_raise(s, m) \
|
|
do { \
|
|
uefi::status _s = (s); \
|
|
if (uefi::is_error(_s)) ::boot::error::raise(_s, (m)); \
|
|
} while(0)
|
|
|