mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[boot] Save commented-out mem map dumping code
This is often needed, so I'm commiting it commented out.
This commit is contained in:
@@ -36,6 +36,15 @@ static const wchar_t *memory_type_names[] = {
|
|||||||
L"persistent memory"
|
L"persistent memory"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const wchar_t *kernel_memory_type_names[] = {
|
||||||
|
L"free",
|
||||||
|
L"pending",
|
||||||
|
L"acpi",
|
||||||
|
L"uefi_runtime",
|
||||||
|
L"mmio",
|
||||||
|
L"persistent"
|
||||||
|
};
|
||||||
|
|
||||||
static const wchar_t *
|
static const wchar_t *
|
||||||
memory_type_name(uefi::memory_type t)
|
memory_type_name(uefi::memory_type t)
|
||||||
{
|
{
|
||||||
@@ -45,6 +54,12 @@ memory_type_name(uefi::memory_type t)
|
|||||||
return L"Bad Type Value";
|
return L"Bad Type Value";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const wchar_t *
|
||||||
|
kernel_memory_type_name(kernel::args::mem_type t)
|
||||||
|
{
|
||||||
|
return kernel_memory_type_names[static_cast<uint32_t>(t)];
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
update_marked_addresses(uefi::event, void *context)
|
update_marked_addresses(uefi::event, void *context)
|
||||||
{
|
{
|
||||||
@@ -144,6 +159,7 @@ build_kernel_mem_map(kernel::args::header *args, uefi::boot_services *bs)
|
|||||||
bool first = true;
|
bool first = true;
|
||||||
for (auto desc : map) {
|
for (auto desc : map) {
|
||||||
/*
|
/*
|
||||||
|
// EFI map dump
|
||||||
console::print(L" Range %lx (%lx) %x(%s) [%lu]\r\n",
|
console::print(L" Range %lx (%lx) %x(%s) [%lu]\r\n",
|
||||||
desc->physical_start, desc->attribute, desc->type, memory_type_name(desc->type), desc->number_of_pages);
|
desc->physical_start, desc->attribute, desc->type, memory_type_name(desc->type), desc->number_of_pages);
|
||||||
*/
|
*/
|
||||||
@@ -217,6 +233,15 @@ build_kernel_mem_map(kernel::args::header *args, uefi::boot_services *bs)
|
|||||||
args->mem_map = kernel_map;
|
args->mem_map = kernel_map;
|
||||||
args->map_count = i;
|
args->map_count = i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
// kernel map dump
|
||||||
|
for (unsigned i = 0; i < args->map_count; ++i) {
|
||||||
|
const kernel::args::mem_entry &e = kernel_map[i];
|
||||||
|
console::print(L" Range %lx (%lx) %x(%s) [%lu]\r\n",
|
||||||
|
e.start, e.attr, e.type, kernel_memory_type_name(e.type), e.pages);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user