diff --git a/repos/os/include/sandbox/sandbox.h b/repos/os/include/sandbox/sandbox.h index 54548611b5..c04420a6aa 100644 --- a/repos/os/include/sandbox/sandbox.h +++ b/repos/os/include/sandbox/sandbox.h @@ -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: diff --git a/repos/os/src/lib/sandbox/child.h b/repos/os/src/lib/sandbox/child.h index 674d7c8f8a..263c9fb81b 100644 --- a/repos/os/src/lib/sandbox/child.h +++ b/repos/os/src/lib/sandbox/child.h @@ -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(); diff --git a/repos/os/src/lib/sandbox/library.cc b/repos/os/src/lib/sandbox/library.cc index ab1e7f00d6..846c9f39d9 100644 --- a/repos/os/src/lib/sandbox/library.cc +++ b/repos/os/src/lib/sandbox/library.cc @@ -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 };