Clean and document header files.

- Add missing doc comments to header files
- Move allocate_kernel_args to main.cpp
- Split functions out into pointer_manipulation.h
This commit is contained in:
Justin C. Miller
2020-05-10 01:42:22 -07:00
parent 9aa749e877
commit 10c8f6e4b5
11 changed files with 191 additions and 102 deletions

View File

@@ -1,3 +1,5 @@
/// \file console.h
/// Text output and status message handling
#pragma once
#include <stdarg.h>
#include <stddef.h>
@@ -6,6 +8,7 @@
namespace boot {
/// Object providing basic output functionality to the UEFI console
class console
{
public:
@@ -32,16 +35,30 @@ private:
static console *s_console;
};
/// Scoped status line reporter. Prints a message and an "OK" if no errors
/// or warnings were reported before destruction, otherwise reports the
/// error or warning.
class status_line
{
public:
/// Constructor.
/// \arg message Description of the operation in progress
/// \arg context If non-null, printed after `message` and a colon
status_line(const wchar_t *message, const wchar_t *context = nullptr);
~status_line();
/// Set the state to warning, and print a message. If the state is already at
/// warning or error, the state is unchanged but the message is still printed.
/// \arg message The warning message to print
/// \arg error If non-null, printed after `message`
inline static void warn(const wchar_t *message, const wchar_t *error = nullptr) {
if (s_current) s_current->do_warn(message, error);
}
/// Set the state to error, and print a message. If the state is already at
/// error, the state is unchanged but the message is still printed.
/// \arg message The error message to print
/// \arg error If non-null, printed after `message`
inline static void fail(const wchar_t *message, const wchar_t *error = nullptr) {
if (s_current) s_current->do_fail(message, error);
}
@@ -60,15 +77,4 @@ private:
static status_line *s_current;
};
uefi::status
con_get_framebuffer(
uefi::boot_services *bs,
void **buffer,
size_t *buffer_size,
uint32_t *hres,
uint32_t *vres,
uint32_t *rmask,
uint32_t *gmask,
uint32_t *bmask);
} // namespace boot