base: provide core_ram_allocator via platform_add_local_services()

This is a prerequisite to rework the allocation of core data structures
for VM sessions in hw.

Issue #5221
This commit is contained in:
Benjamin Lamowski 2024-11-28 16:42:09 +01:00 committed by Christian Helmuth
parent d5f3cc6ec2
commit b21c8729ea
12 changed files with 26 additions and 14 deletions

View File

@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap, Sliced_heap &heap,
Registry<Service> &services, Registry<Service> &services,
Trace::Source_registry &trace_sources) Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
static Vm_root vm_root(ep, heap, core_env().ram_allocator(), static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources); core_env().local_rm(), trace_sources);

View File

@ -35,7 +35,8 @@ extern addr_t hypervisor_exception_vector;
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sh, Sliced_heap &sh,
Registry<Service> &services, Registry<Service> &services,
Core::Trace::Source_registry &trace_sources) Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
map_local(Platform::core_phys_addr((addr_t)&hypervisor_exception_vector), map_local(Platform::core_phys_addr((addr_t)&hypervisor_exception_vector),
Hw::Mm::hypervisor_exception_vector().base, Hw::Mm::hypervisor_exception_vector().base,

View File

@ -32,7 +32,8 @@ extern int monitor_mode_exception_vector;
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sliced_heap, Sliced_heap &sliced_heap,
Registry<Service> &local_services, Registry<Service> &local_services,
Core::Trace::Source_registry &trace_sources) Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
static addr_t const phys_base = static addr_t const phys_base =
Platform::core_phys_addr((addr_t)&monitor_mode_exception_vector); Platform::core_phys_addr((addr_t)&monitor_mode_exception_vector);

View File

@ -27,9 +27,10 @@
* Add x86 specific ioport and virtualization service * Add x86 specific ioport and virtualization service
*/ */
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sliced_heap, Sliced_heap &sliced_heap,
Registry<Service> &local_services, Registry<Service> &local_services,
Trace::Source_registry &trace_sources) Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
static Io_port_root io_port_root(*core_env().pd_session(), static Io_port_root io_port_root(*core_env().pd_session(),
platform().io_port_alloc(), sliced_heap); platform().io_port_alloc(), sliced_heap);

View File

@ -22,5 +22,6 @@
void Core::platform_add_local_services(Rpc_entrypoint &, void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &, Sliced_heap &,
Registry<Service> &, Registry<Service> &,
Trace::Source_registry &) Trace::Source_registry &,
Ram_allocator &)
{ } { }

View File

@ -28,7 +28,8 @@ using namespace Core;
void Core::platform_add_local_services(Rpc_entrypoint &, void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &md, Sliced_heap &md,
Registry<Service> &reg, Registry<Service> &reg,
Core::Trace::Source_registry &) Core::Trace::Source_registry &,
Ram_allocator &)
{ {
if (!lx_iopl(3)) { if (!lx_iopl(3)) {
static Io_port_root io_port_root(*core_env().pd_session(), static Io_port_root io_port_root(*core_env().pd_session(),

View File

@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap, Sliced_heap &heap,
Registry<Service> &services, Registry<Service> &services,
Trace::Source_registry &trace_sources) Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
static Vm_root vm_root(ep, heap, core_env().ram_allocator(), static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources); core_env().local_rm(), trace_sources);

View File

@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep, void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap, Sliced_heap &heap,
Registry<Service> &services, Registry<Service> &services,
Core::Trace::Source_registry &trace_sources) Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{ {
static Vm_root vm_root(ep, heap, core_env().ram_allocator(), static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources); core_env().local_rm(), trace_sources);

View File

@ -15,6 +15,7 @@
#define _CORE__INCLUDE__PLATFORM_SERVICES_H_ #define _CORE__INCLUDE__PLATFORM_SERVICES_H_
/* core includes */ /* core includes */
#include "base/ram_allocator.h"
#include <core_service.h> #include <core_service.h>
#include <trace/source_registry.h> #include <trace/source_registry.h>
@ -38,7 +39,8 @@ namespace Core {
void platform_add_local_services(Rpc_entrypoint &ep, void platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &md, Sliced_heap &md,
Registry<Service> &reg, Registry<Service> &reg,
Trace::Source_registry &trace); Trace::Source_registry &trace,
Ram_allocator &core_ram_alloc);
} }
#endif /* _CORE__INCLUDE__PLATFORM_SERVICES_H_ */ #endif /* _CORE__INCLUDE__PLATFORM_SERVICES_H_ */

View File

@ -289,7 +289,7 @@ void Genode::bootstrap_component(Genode::Platform &)
static Core_service<Trace_session_component> trace_service (services, trace_root); static Core_service<Trace_session_component> trace_service (services, trace_root);
/* make platform-specific services known to service pool */ /* make platform-specific services known to service pool */
platform_add_local_services(ep, sliced_heap, services, Core::Trace::sources()); platform_add_local_services(ep, sliced_heap, services, Core::Trace::sources(), core_ram_alloc);
size_t const avail_ram_quota = core_pd.avail_ram().value; size_t const avail_ram_quota = core_pd.avail_ram().value;
size_t const avail_cap_quota = core_pd.avail_caps().value; size_t const avail_cap_quota = core_pd.avail_caps().value;

View File

@ -17,4 +17,5 @@
void Core::platform_add_local_services(Rpc_entrypoint &, Sliced_heap &, void Core::platform_add_local_services(Rpc_entrypoint &, Sliced_heap &,
Registry<Service> &, Registry<Service> &,
Trace::Source_registry &) { } Trace::Source_registry &,
Ram_allocator &) { }

View File

@ -27,7 +27,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &, void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &sliced_heap, Sliced_heap &sliced_heap,
Registry<Service> &local_services, Registry<Service> &local_services,
Trace::Source_registry &) Trace::Source_registry &,
Ram_allocator &)
{ {
static Io_port_root io_port_root(*core_env().pd_session(), static Io_port_root io_port_root(*core_env().pd_session(),
platform().io_port_alloc(), sliced_heap); platform().io_port_alloc(), sliced_heap);