mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
parent
223e185b83
commit
441186468c
@ -16,11 +16,12 @@
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_thread.h>
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
/* core includes */
|
||||
#include <types.h>
|
||||
using namespace Genode;
|
||||
|
||||
using namespace Core;
|
||||
|
||||
void Genode::init_rpc_cap_alloc(Parent &) { }
|
||||
|
||||
|
||||
Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session &, Native_capability,
|
||||
|
@ -174,5 +174,7 @@ Platform_env::Platform_env()
|
||||
/* register TID and PID of the main thread at core */
|
||||
Linux_native_cpu_client native_cpu(cpu_session()->native_cpu());
|
||||
native_cpu.thread_id(parent()->main_thread_cap(), lx_getpid(), lx_gettid());
|
||||
|
||||
init_rpc_cap_alloc(_parent());
|
||||
}
|
||||
|
||||
|
@ -14,14 +14,28 @@
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <base/rpc_server.h>
|
||||
#include <deprecated/env.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_thread.h>
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
static Parent *_parent_ptr;
|
||||
static Parent &_parent()
|
||||
{
|
||||
if (_parent_ptr)
|
||||
return *_parent_ptr;
|
||||
|
||||
error("missing call of init_rpc_cap_alloc");
|
||||
for (;;);
|
||||
}
|
||||
|
||||
|
||||
void Genode::init_rpc_cap_alloc(Parent &parent) { _parent_ptr = &parent; }
|
||||
|
||||
|
||||
Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session& pd, Native_capability,
|
||||
addr_t)
|
||||
{
|
||||
@ -34,9 +48,9 @@ Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session& pd, Native_capabili
|
||||
catch (Out_of_ram) { ram_upgrade = Ram_quota { 2*1024*sizeof(long) }; }
|
||||
catch (Out_of_caps) { cap_upgrade = Cap_quota { 4 }; }
|
||||
|
||||
env_deprecated()->parent()->upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
_parent().upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
}
|
||||
|
||||
return Thread::native_thread().epoll.alloc_rpc_cap();
|
||||
|
@ -19,12 +19,18 @@
|
||||
#include <rpc_cap_factory.h>
|
||||
#include <imprint_badge.h>
|
||||
|
||||
using namespace Core;
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
static Rpc_cap_factory &rpc_cap_factory()
|
||||
void Genode::init_rpc_cap_alloc(Parent &) { }
|
||||
|
||||
|
||||
static Core::Rpc_cap_factory &rpc_cap_factory()
|
||||
{
|
||||
static Rpc_cap_factory inst(platform().core_mem_alloc());
|
||||
static Core::Rpc_cap_factory inst(Core::platform().core_mem_alloc());
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <util/retry.h>
|
||||
#include <base/rpc_server.h>
|
||||
#include <pd_session/client.h>
|
||||
#include <deprecated/env.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
@ -27,6 +26,20 @@
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
static Parent *_parent_ptr;
|
||||
static Parent &_parent()
|
||||
{
|
||||
if (_parent_ptr)
|
||||
return *_parent_ptr;
|
||||
|
||||
error("missing call of init_rpc_cap_alloc");
|
||||
for (;;);
|
||||
}
|
||||
|
||||
|
||||
void Genode::init_rpc_cap_alloc(Parent &parent) { _parent_ptr = &parent; }
|
||||
|
||||
|
||||
Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session &pd, Native_capability ep,
|
||||
addr_t entry)
|
||||
{
|
||||
@ -48,9 +61,9 @@ Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session &pd, Native_capabili
|
||||
catch (Out_of_ram) { ram_upgrade = Ram_quota { 2*1024*sizeof(long) }; }
|
||||
catch (Out_of_caps) { cap_upgrade = Cap_quota { 4 }; }
|
||||
|
||||
env_deprecated()->parent()->upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
_parent().upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,12 +18,18 @@
|
||||
#include <platform_generic.h>
|
||||
#include <rpc_cap_factory.h>
|
||||
|
||||
using namespace Core;
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
static Rpc_cap_factory &rpc_cap_factory()
|
||||
void Genode::init_rpc_cap_alloc(Parent &) { }
|
||||
|
||||
|
||||
static Core::Rpc_cap_factory &rpc_cap_factory()
|
||||
{
|
||||
static Rpc_cap_factory inst(platform().core_mem_alloc());
|
||||
static Core::Rpc_cap_factory inst(Core::platform().core_mem_alloc());
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ namespace Genode {
|
||||
void init_root_proxy(Env &);
|
||||
void init_tracing(Env &);
|
||||
void init_log(Parent &);
|
||||
void init_rpc_cap_alloc(Parent &);
|
||||
void init_parent_resource_requests(Env &);
|
||||
void init_heartbeat_monitoring(Env &);
|
||||
void deinit_heartbeat_monitoring();
|
||||
|
@ -16,11 +16,27 @@
|
||||
#include <util/retry.h>
|
||||
#include <base/rpc_server.h>
|
||||
#include <pd_session/client.h>
|
||||
#include <deprecated/env.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
static Parent *_parent_ptr;
|
||||
static Parent &_parent()
|
||||
{
|
||||
if (_parent_ptr)
|
||||
return *_parent_ptr;
|
||||
|
||||
error("missing call of init_rpc_cap_alloc");
|
||||
for (;;);
|
||||
}
|
||||
|
||||
|
||||
void Genode::init_rpc_cap_alloc(Parent &parent) { _parent_ptr = &parent; }
|
||||
|
||||
|
||||
Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session &pd,
|
||||
Native_capability, addr_t)
|
||||
{
|
||||
@ -33,9 +49,9 @@ Native_capability Rpc_entrypoint::_alloc_rpc_cap(Pd_session &pd,
|
||||
catch (Out_of_ram) { ram_upgrade = Ram_quota { 2*1024*sizeof(long) }; }
|
||||
catch (Out_of_caps) { cap_upgrade = Cap_quota { 4 }; }
|
||||
|
||||
env_deprecated()->parent()->upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
_parent().upgrade(Parent::Env::pd(),
|
||||
String<100>("ram_quota=", ram_upgrade, ", "
|
||||
"cap_quota=", cap_upgrade).string());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,7 @@ extern "C" void init_main_thread()
|
||||
*/
|
||||
(void)env_deprecated();
|
||||
init_log(*env_deprecated()->parent());
|
||||
init_rpc_cap_alloc(*env_deprecated()->parent());
|
||||
|
||||
/* create a thread object for the main thread */
|
||||
main_thread();
|
||||
|
Loading…
Reference in New Issue
Block a user