mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-07 11:50:24 +00:00
parent
04e8ba716c
commit
b87e21a392
@ -31,8 +31,12 @@ class Genode::Multiboot2_info : Mmio
|
|||||||
struct Type : Register <0x00, 32>
|
struct Type : Register <0x00, 32>
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
END = 0, MEMORY = 6, FRAMEBUFFER = 8,
|
END = 0,
|
||||||
ACPI_RSDP_V1 = 14, ACPI_RSDP_V2 = 15
|
MEMORY = 6,
|
||||||
|
FRAMEBUFFER = 8,
|
||||||
|
EFI_SYSTEM_TABLE_64 = 12,
|
||||||
|
ACPI_RSDP_V1 = 14,
|
||||||
|
ACPI_RSDP_V2 = 15,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
struct Size : Register <0x04, 32> { };
|
struct Size : Register <0x04, 32> { };
|
||||||
@ -40,6 +44,13 @@ class Genode::Multiboot2_info : Mmio
|
|||||||
Tag(addr_t addr) : Mmio(addr) { }
|
Tag(addr_t addr) : Mmio(addr) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Efi_system_table_64 : Tag
|
||||||
|
{
|
||||||
|
struct Pointer : Register <0x08, 64> { };
|
||||||
|
|
||||||
|
Efi_system_table_64(addr_t addr) : Tag(addr) { }
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum { MAGIC = 0x36d76289UL };
|
enum { MAGIC = 0x36d76289UL };
|
||||||
@ -56,8 +67,14 @@ class Genode::Multiboot2_info : Mmio
|
|||||||
|
|
||||||
Multiboot2_info(addr_t mbi) : Mmio(mbi) { }
|
Multiboot2_info(addr_t mbi) : Mmio(mbi) { }
|
||||||
|
|
||||||
template <typename FUNC_MEM, typename FUNC_ACPI, typename FUNC_FB>
|
template <typename FUNC_MEM,
|
||||||
void for_each_tag(FUNC_MEM mem_fn, FUNC_ACPI acpi_fn, FUNC_FB fb_fn)
|
typename FUNC_ACPI,
|
||||||
|
typename FUNC_FB,
|
||||||
|
typename FUNC_SYSTAB64>
|
||||||
|
void for_each_tag(FUNC_MEM mem_fn,
|
||||||
|
FUNC_ACPI acpi_fn,
|
||||||
|
FUNC_FB fb_fn,
|
||||||
|
FUNC_SYSTAB64 systab64_fn)
|
||||||
{
|
{
|
||||||
addr_t const size = read<Multiboot2_info::Size>();
|
addr_t const size = read<Multiboot2_info::Size>();
|
||||||
|
|
||||||
@ -69,6 +86,10 @@ class Genode::Multiboot2_info : Mmio
|
|||||||
if (tag.read<Tag::Type>() == Tag::Type::END)
|
if (tag.read<Tag::Type>() == Tag::Type::END)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (tag.read<Tag::Type>() == Tag::Type::EFI_SYSTEM_TABLE_64) {
|
||||||
|
Efi_system_table_64 const est(tag_addr);
|
||||||
|
systab64_fn(est.read<Efi_system_table_64::Pointer>());
|
||||||
|
}
|
||||||
if (tag.read<Tag::Type>() == Tag::Type::MEMORY) {
|
if (tag.read<Tag::Type>() == Tag::Type::MEMORY) {
|
||||||
addr_t mem_start = tag_addr + (1UL << Tag::LOG2_SIZE) + 8;
|
addr_t mem_start = tag_addr + (1UL << Tag::LOG2_SIZE) + 8;
|
||||||
addr_t const mem_end = tag_addr + tag.read<Tag::Size>();
|
addr_t const mem_end = tag_addr + tag.read<Tag::Size>();
|
||||||
|
@ -119,6 +119,9 @@ Bootstrap::Platform::Board::Board()
|
|||||||
},
|
},
|
||||||
[&] (Hw::Framebuffer const &fb) {
|
[&] (Hw::Framebuffer const &fb) {
|
||||||
info.framebuffer = fb;
|
info.framebuffer = fb;
|
||||||
|
},
|
||||||
|
[&] (uint64_t const efi_sys_tab) {
|
||||||
|
info.efi_system_table = efi_sys_tab;
|
||||||
});
|
});
|
||||||
} else if (__initial_ax == Multiboot_info::MAGIC) {
|
} else if (__initial_ax == Multiboot_info::MAGIC) {
|
||||||
for (unsigned i = 0; true; i++) {
|
for (unsigned i = 0; true; i++) {
|
||||||
|
@ -20,6 +20,11 @@ using namespace Genode;
|
|||||||
|
|
||||||
void Platform::_init_additional_platform_info(Xml_generator &xml)
|
void Platform::_init_additional_platform_info(Xml_generator &xml)
|
||||||
{
|
{
|
||||||
|
if (_boot_info().plat_info.efi_system_table != 0) {
|
||||||
|
xml.node("efi-system-table", [&] () {
|
||||||
|
xml.attribute("address", String<32>(Hex(_boot_info().plat_info.efi_system_table)));
|
||||||
|
});
|
||||||
|
}
|
||||||
xml.node("acpi", [&] () {
|
xml.node("acpi", [&] () {
|
||||||
uint32_t const revision = _boot_info().plat_info.acpi_rsdp.revision;
|
uint32_t const revision = _boot_info().plat_info.acpi_rsdp.revision;
|
||||||
uint32_t const rsdt = _boot_info().plat_info.acpi_rsdp.rsdt;
|
uint32_t const rsdt = _boot_info().plat_info.acpi_rsdp.rsdt;
|
||||||
|
@ -35,6 +35,7 @@ struct Hw::Pc_board::Boot_info
|
|||||||
{
|
{
|
||||||
Acpi_rsdp acpi_rsdp { };
|
Acpi_rsdp acpi_rsdp { };
|
||||||
Framebuffer framebuffer { };
|
Framebuffer framebuffer { };
|
||||||
|
Genode::addr_t efi_system_table { 0 };
|
||||||
|
|
||||||
Boot_info() {}
|
Boot_info() {}
|
||||||
Boot_info(Acpi_rsdp const &acpi_rsdp,
|
Boot_info(Acpi_rsdp const &acpi_rsdp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user