mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
sandbox: add Pd_intrinsics::start_initial_thread
This hook allows for intercepting the creation of initial threads whenever a new child is started. Issue #4917
This commit is contained in:
parent
0d5571a820
commit
add6dbac4e
@ -66,6 +66,11 @@ class Genode::Sandbox : Noncopyable
|
||||
* Call 'Fn' with the 'Intrinsics' that apply for the specified PD
|
||||
*/
|
||||
virtual void with_intrinsics(Capability<Pd_session>, Pd_session &, Fn const &) = 0;
|
||||
|
||||
/**
|
||||
* Start the initial thread of new PD at the given instruction pointer
|
||||
*/
|
||||
virtual void start_initial_thread(Capability<Cpu_thread>, addr_t ip) = 0;
|
||||
};
|
||||
|
||||
private:
|
||||
|
@ -782,6 +782,11 @@ class Sandbox::Child : Child_policy, Routed_service::Wakeup
|
||||
fn.call(intrinsics.address_space); });
|
||||
}
|
||||
|
||||
void start_initial_thread(Capability<Cpu_thread> cap, addr_t ip) override
|
||||
{
|
||||
_pd_intrinsics.start_initial_thread(cap, ip);
|
||||
}
|
||||
|
||||
void yield_response() override
|
||||
{
|
||||
apply_downgrade();
|
||||
|
@ -268,6 +268,11 @@ struct Genode::Sandbox::Library : ::Sandbox::State_reporter::Producer,
|
||||
fn.call(intrinsics);
|
||||
}
|
||||
|
||||
void start_initial_thread(Capability<Cpu_thread> cap, addr_t ip) override
|
||||
{
|
||||
Cpu_thread_client(cap).start(ip, 0);
|
||||
}
|
||||
|
||||
Default_pd_intrinsics(Env &env) : _env(env) { }
|
||||
|
||||
} _default_pd_intrinsics { _env };
|
||||
|
Loading…
Reference in New Issue
Block a user