mirror of
https://github.com/justinian/j6-uefi-headers.git
synced 2025-12-09 16:14:31 -08:00
Add allocate_pages to boot services
This commit is contained in:
@@ -9,10 +9,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <uefi/tables.h>
|
||||
#include <uefi/types.h>
|
||||
|
||||
namespace uefi {
|
||||
namespace bs_impl {
|
||||
using locate_protocol = uefi::status (*)(const uefi::guid *, void *, void **);
|
||||
using allocate_pages = status (*)(allocate_type, memory_type, uint64_t, uintptr_t*);
|
||||
using locate_protocol = status (*)(const guid *, void *, void **);
|
||||
}
|
||||
|
||||
struct boot_services {
|
||||
@@ -25,7 +27,7 @@ struct boot_services {
|
||||
void *restore_tpl;
|
||||
|
||||
// Memory Services
|
||||
void *allocate_pages;
|
||||
bs_impl::allocate_pages allocate_pages;
|
||||
void *free_pages;
|
||||
void *get_memory_map;
|
||||
void *allocate_pool;
|
||||
|
||||
@@ -28,6 +28,34 @@ enum class status : uint64_t
|
||||
};
|
||||
|
||||
inline bool is_error(status s) { return static_cast<uint64_t>(s) & error_bit; }
|
||||
inline bool is_warning(status s) { return !is_error(s) && s != status::success; }
|
||||
|
||||
enum class memory_type : uint32_t
|
||||
{
|
||||
reserved_memory_type,
|
||||
loader_code,
|
||||
loader_data,
|
||||
boot_services_code,
|
||||
boot_services_data,
|
||||
runtime_services_code,
|
||||
runtime_services_data,
|
||||
conventional_memory,
|
||||
unusable_memory,
|
||||
acpi_reclaim_memory,
|
||||
acpi_memory_nvs,
|
||||
memory_mapped_io,
|
||||
memory_mapped_io_port_space,
|
||||
pal_code,
|
||||
persistent_memory,
|
||||
max_memory_type
|
||||
};
|
||||
|
||||
enum class allocate_type : uint32_t
|
||||
{
|
||||
any_pages,
|
||||
max_address,
|
||||
address
|
||||
};
|
||||
|
||||
} // namespace uefi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user