Add get_memory_map and copy_mem to boot_services

This commit is contained in:
Justin C. Miller
2020-05-06 00:18:33 -07:00
parent 6bd8448387
commit 9064567e4a
2 changed files with 17 additions and 6 deletions

View File

@@ -13,12 +13,14 @@
namespace uefi { namespace uefi {
namespace bs_impl { namespace bs_impl {
using allocate_pages = status (*)(allocate_type, memory_type, uint64_t, void**); using allocate_pages = status (*)(allocate_type, memory_type, size_t, void**);
using get_memory_map = status (*)(size_t*, memory_descriptor*, size_t*, size_t*, uint32_t*);
using allocate_pool = status (*)(memory_type, uint64_t, void**); using allocate_pool = status (*)(memory_type, uint64_t, void**);
using handle_protocol = status (*)(handle, const guid *, void **); using handle_protocol = status (*)(handle, const guid*, void**);
using create_event = status (*)(evt, tpl, event_notify, void*, event*); using create_event = status (*)(evt, tpl, event_notify, void*, event*);
using locate_protocol = status (*)(const guid *, void *, void **); using locate_protocol = status (*)(const guid*, void*, void**);
using set_mem = void (*)(void *, uint64_t, uint8_t); using copy_mem = void (*)(void*, void*, size_t);
using set_mem = void (*)(void*, uint64_t, uint8_t);
} }
struct boot_services { struct boot_services {
@@ -33,7 +35,7 @@ struct boot_services {
// Memory Services // Memory Services
bs_impl::allocate_pages allocate_pages; bs_impl::allocate_pages allocate_pages;
void *free_pages; void *free_pages;
void *get_memory_map; bs_impl::get_memory_map get_memory_map;
bs_impl::allocate_pool allocate_pool; bs_impl::allocate_pool allocate_pool;
void *free_pool; void *free_pool;
@@ -88,7 +90,7 @@ struct boot_services {
void *calculate_crc32; void *calculate_crc32;
// Miscellaneous Services // Miscellaneous Services
void *copy_mem; bs_impl::copy_mem copy_mem;
bs_impl::set_mem set_mem; bs_impl::set_mem set_mem;
void *create_event_ex; void *create_event_ex;
}; };

View File

@@ -84,6 +84,15 @@ enum class allocate_type : uint32_t
address address
}; };
struct memory_descriptor
{
memory_type type;
uintptr_t physical_start;
uintptr_t virtual_start;
uint64_t number_of_pages;
uint64_t attribute;
};
// //
// Event handling defitions // Event handling defitions