base: add platform_info to microkernel platforms

Add to older platforms also the info ROM to avoid confusion/red messages.

Issue #4016
This commit is contained in:
Alexander Boettcher
2021-05-25 08:27:11 +02:00
committed by Christian Helmuth
parent 509e5aa776
commit 933de21339
4 changed files with 76 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
#include <base/sleep.h>
#include <base/capability.h>
#include <util/misc_math.h>
#include <util/xml_generator.h>
/* base-internal includes */
#include <base/internal/crt0.h>
@@ -626,6 +627,29 @@ Platform::Platform()
init_core_log(Core_log_range { core_local_addr, log_size } );
}
/* export platform specific infos */
{
void * phys_ptr = nullptr;
size_t const size = 1 << get_page_size_log2();
if (ram_alloc().alloc_aligned(size, &phys_ptr,
get_page_size_log2()).ok()) {
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = phys_addr;
region_alloc().remove_range(core_local_addr, size);
Genode::Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
size, "platform_info", [&] () {
xml.node("kernel", [&] () { xml.attribute("name", "pistachio"); });
});
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"platform_info"));
}
}
}