Revert "Core: exit with child exit value"
Not actually useful, and causes a null deference on NOVA.
This commit is contained in:
parent
4287419392
commit
b20ca5f254
|
@ -167,7 +167,7 @@ namespace Genode {
|
||||||
|
|
||||||
size_t max_caps() const override { return Capability_space::max_caps(); }
|
size_t max_caps() const override { return Capability_space::max_caps(); }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -483,7 +483,7 @@ Platform::Platform() :
|
||||||
** Generic platform interface **
|
** Generic platform interface **
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* On Fiasco, Core never exits. So let us sleep forever.
|
* On Fiasco, Core never exits. So let us sleep forever.
|
||||||
|
|
|
@ -183,7 +183,7 @@ namespace Genode {
|
||||||
|
|
||||||
Cap_id_allocator &cap_id_alloc() { return _cap_id_alloc; }
|
Cap_id_allocator &cap_id_alloc() { return _cap_id_alloc; }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,7 @@ Platform::Platform() :
|
||||||
** Generic platform interface **
|
** Generic platform interface **
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* On Fiasco, Core never exits. So let us sleep forever.
|
* On Fiasco, Core never exits. So let us sleep forever.
|
||||||
|
|
|
@ -128,7 +128,7 @@ class Genode::Platform : public Genode::Platform_generic
|
||||||
size_t vm_size() const override { return Hw::Mm::user().size; }
|
size_t vm_size() const override { return Hw::Mm::user().size; }
|
||||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override {
|
void wait_for_exit() override {
|
||||||
while (1) { Kernel::stop_thread(); } };
|
while (1) { Kernel::stop_thread(); } };
|
||||||
|
|
||||||
bool supports_direct_unmap() const override { return true; }
|
bool supports_direct_unmap() const override { return true; }
|
||||||
|
|
|
@ -129,9 +129,7 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
size_t max_caps() const override { return 10000; }
|
size_t max_caps() const override { return 10000; }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
|
|
||||||
void child_exit() override;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ Platform::Platform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &exit_value)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
|
@ -145,11 +145,9 @@ void Platform::wait_for_exit(int const &exit_value)
|
||||||
Platform_thread::submit_exception(pid);
|
Platform_thread::submit_exception(pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lx_exit_group(exit_value);
|
lx_exit_group(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::child_exit() { sigint_handler(0); }
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************
|
/*****************************
|
||||||
** Support for IPC library **
|
** Support for IPC library **
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace Genode {
|
||||||
size_t vm_size() const override { return _vm_size; }
|
size_t vm_size() const override { return _vm_size; }
|
||||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||||
size_t max_caps() const override { return _max_caps; }
|
size_t max_caps() const override { return _max_caps; }
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
|
|
||||||
bool supports_direct_unmap() const override { return true; }
|
bool supports_direct_unmap() const override { return true; }
|
||||||
|
|
||||||
|
|
|
@ -990,5 +990,5 @@ bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t, unsigned size)
|
||||||
** Generic platform interface **
|
** Generic platform interface **
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &) { sleep_forever(); }
|
void Platform::wait_for_exit() { sleep_forever(); }
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ namespace Genode {
|
||||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||||
size_t max_caps() const override { return Capability_space::max_caps(); }
|
size_t max_caps() const override { return Capability_space::max_caps(); }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
|
|
||||||
bool supports_direct_unmap() const override { return true; }
|
bool supports_direct_unmap() const override { return true; }
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ Platform::Platform()
|
||||||
** Generic platform interface **
|
** Generic platform interface **
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* On OKL4, core never exits. So let us sleep forever.
|
* On OKL4, core never exits. So let us sleep forever.
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace Genode {
|
||||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||||
size_t max_caps() const override { return Capability_space::max_caps(); }
|
size_t max_caps() const override { return Capability_space::max_caps(); }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
|
|
||||||
Affinity::Space affinity_space() const override
|
Affinity::Space affinity_space() const override
|
||||||
{
|
{
|
||||||
|
|
|
@ -640,7 +640,7 @@ Platform::Platform()
|
||||||
** Generic platform interface **
|
** Generic platform interface **
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* On Pistachio, core never exits. So let us sleep forever.
|
* On Pistachio, core never exits. So let us sleep forever.
|
||||||
|
|
|
@ -274,7 +274,7 @@ class Genode::Platform : public Platform_generic
|
||||||
|
|
||||||
Cap_sel asid_pool() const { return _asid_pool_sel; }
|
Cap_sel asid_pool() const { return _asid_pool_sel; }
|
||||||
|
|
||||||
void wait_for_exit(int const &) override;
|
void wait_for_exit() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine size of a core local mapping required for a
|
* Determine size of a core local mapping required for a
|
||||||
|
|
|
@ -661,7 +661,7 @@ void Platform::reset_sel(unsigned sel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Platform::wait_for_exit(int const &)
|
void Platform::wait_for_exit()
|
||||||
{
|
{
|
||||||
sleep_forever();
|
sleep_forever();
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,12 +77,7 @@ namespace Genode {
|
||||||
/**
|
/**
|
||||||
* Wait for exit condition
|
* Wait for exit condition
|
||||||
*/
|
*/
|
||||||
virtual void wait_for_exit(int const &exit_value) = 0;
|
virtual void wait_for_exit() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle exit of child
|
|
||||||
*/
|
|
||||||
virtual void child_exit() { };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if platform supports direct unmap (no mapping db)
|
* Return true if platform supports direct unmap (no mapping db)
|
||||||
|
|
|
@ -119,8 +119,6 @@ class Core_child : public Child_policy
|
||||||
|
|
||||||
Child _child;
|
Child _child;
|
||||||
|
|
||||||
int &_exit_value;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,16 +128,14 @@ class Core_child : public Child_policy
|
||||||
Pd_session &core_pd, Capability<Pd_session> core_pd_cap,
|
Pd_session &core_pd, Capability<Pd_session> core_pd_cap,
|
||||||
Cpu_session &core_cpu, Capability<Cpu_session> core_cpu_cap,
|
Cpu_session &core_cpu, Capability<Cpu_session> core_cpu_cap,
|
||||||
Cap_quota cap_quota, Ram_quota ram_quota,
|
Cap_quota cap_quota, Ram_quota ram_quota,
|
||||||
Rpc_entrypoint &ep,
|
Rpc_entrypoint &ep)
|
||||||
int &exit_value)
|
|
||||||
:
|
:
|
||||||
_services(services),
|
_services(services),
|
||||||
_core_pd_cap (core_pd_cap), _core_pd (core_pd),
|
_core_pd_cap (core_pd_cap), _core_pd (core_pd),
|
||||||
_core_cpu_cap(core_cpu_cap), _core_cpu(core_cpu),
|
_core_cpu_cap(core_cpu_cap), _core_cpu(core_cpu),
|
||||||
_cap_quota(Child::effective_quota(cap_quota)),
|
_cap_quota(Child::effective_quota(cap_quota)),
|
||||||
_ram_quota(Child::effective_quota(ram_quota)),
|
_ram_quota(Child::effective_quota(ram_quota)),
|
||||||
_child(local_rm, ep, *this),
|
_child(local_rm, ep, *this)
|
||||||
_exit_value(exit_value)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,13 +174,6 @@ class Core_child : public Child_policy
|
||||||
_core_cpu.transfer_quota(cap, Cpu_session::quota_lim_upscale(100, 100));
|
_core_cpu.transfer_quota(cap, Cpu_session::quota_lim_upscale(100, 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
void exit(int exit_value) override
|
|
||||||
{
|
|
||||||
_exit_value = exit_value;
|
|
||||||
Child_policy::exit(exit_value);
|
|
||||||
platform().child_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
Pd_session &ref_pd() override { return _core_pd; }
|
Pd_session &ref_pd() override { return _core_pd; }
|
||||||
Pd_session_capability ref_pd_cap() const override { return _core_pd_cap; }
|
Pd_session_capability ref_pd_cap() const override { return _core_pd_cap; }
|
||||||
|
|
||||||
|
@ -232,8 +221,6 @@ namespace Genode {
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
static int exit_value { 0 };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable tracing within core because it is currently not fully implemented.
|
* Disable tracing within core because it is currently not fully implemented.
|
||||||
*/
|
*/
|
||||||
|
@ -322,10 +309,10 @@ int main()
|
||||||
|
|
||||||
static Reconstructible<Core_child>
|
static Reconstructible<Core_child>
|
||||||
init(services, local_rm, core_pd, core_pd_cap, core_cpu, core_cpu_cap,
|
init(services, local_rm, core_pd, core_pd_cap, core_cpu, core_cpu_cap,
|
||||||
init_cap_quota, init_ram_quota, ep, exit_value);
|
init_cap_quota, init_ram_quota, ep);
|
||||||
|
|
||||||
platform().wait_for_exit(exit_value);
|
platform().wait_for_exit();
|
||||||
|
|
||||||
init.destruct();
|
init.destruct();
|
||||||
return exit_value;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue