Browse Source

Revert "Core: exit with child exit value"

Not actually useful, and causes a null deference on NOVA.
unlabeled-log
Emery Hemingway 2 years ago
parent
commit
b20ca5f254
  1. 2
      repos/base-fiasco/src/core/include/platform.h
  2. 2
      repos/base-fiasco/src/core/platform.cc
  3. 2
      repos/base-foc/src/core/include/platform.h
  4. 2
      repos/base-foc/src/core/platform.cc
  5. 2
      repos/base-hw/src/include/platform.h
  6. 4
      repos/base-linux/src/core/include/platform.h
  7. 6
      repos/base-linux/src/core/platform.cc
  8. 2
      repos/base-nova/src/core/include/platform.h
  9. 2
      repos/base-nova/src/core/platform.cc
  10. 2
      repos/base-okl4/src/core/include/platform.h
  11. 2
      repos/base-okl4/src/core/platform.cc
  12. 2
      repos/base-pistachio/src/core/include/platform.h
  13. 2
      repos/base-pistachio/src/core/platform.cc
  14. 2
      repos/base-sel4/src/core/include/platform.h
  15. 2
      repos/base-sel4/src/core/platform.cc
  16. 7
      repos/base/src/core/include/platform_generic.h
  17. 23
      repos/base/src/core/main.cc

2
repos/base-fiasco/src/core/include/platform.h

@ -167,7 +167,7 @@ namespace Genode {
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
};
}

2
repos/base-fiasco/src/core/platform.cc

@ -483,7 +483,7 @@ Platform::Platform() :
** 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.

2
repos/base-foc/src/core/include/platform.h

@ -183,7 +183,7 @@ namespace Genode {
Cap_id_allocator &cap_id_alloc() { return _cap_id_alloc; }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
};
}

2
repos/base-foc/src/core/platform.cc

@ -582,7 +582,7 @@ Platform::Platform() :
** 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.

2
repos/base-hw/src/include/platform.h

@ -128,7 +128,7 @@ class Genode::Platform : public Genode::Platform_generic
size_t vm_size() const override { return Hw::Mm::user().size; }
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(); } };
bool supports_direct_unmap() const override { return true; }

4
repos/base-linux/src/core/include/platform.h

@ -129,9 +129,7 @@ namespace Genode {
*/
size_t max_caps() const override { return 10000; }
void wait_for_exit(int const &) override;
void child_exit() override;
void wait_for_exit() override;
};
}

6
repos/base-linux/src/core/platform.cc

@ -113,7 +113,7 @@ Platform::Platform()
}
void Platform::wait_for_exit(int const &exit_value)
void Platform::wait_for_exit()
{
for (;;) {
@ -145,11 +145,9 @@ void Platform::wait_for_exit(int const &exit_value)
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 **

2
repos/base-nova/src/core/include/platform.h

@ -82,7 +82,7 @@ namespace Genode {
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
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; }

2
repos/base-nova/src/core/platform.cc

@ -990,5 +990,5 @@ bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t, unsigned size)
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &) { sleep_forever(); }
void Platform::wait_for_exit() { sleep_forever(); }

2
repos/base-okl4/src/core/include/platform.h

@ -139,7 +139,7 @@ namespace Genode {
Rom_fs &rom_fs() override { return _rom_fs; }
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; }

2
repos/base-okl4/src/core/platform.cc

@ -215,7 +215,7 @@ Platform::Platform()
** 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.

2
repos/base-pistachio/src/core/include/platform.h

@ -153,7 +153,7 @@ namespace Genode {
Rom_fs &rom_fs() override { return _rom_fs; }
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
{

2
repos/base-pistachio/src/core/platform.cc

@ -640,7 +640,7 @@ Platform::Platform()
** 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.

2
repos/base-sel4/src/core/include/platform.h

@ -274,7 +274,7 @@ class Genode::Platform : public Platform_generic
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

2
repos/base-sel4/src/core/platform.cc

@ -661,7 +661,7 @@ void Platform::reset_sel(unsigned sel)
}
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
sleep_forever();
}

7
repos/base/src/core/include/platform_generic.h

@ -77,12 +77,7 @@ namespace Genode {
/**
* Wait for exit condition
*/
virtual void wait_for_exit(int const &exit_value) = 0;
/**
* Handle exit of child
*/
virtual void child_exit() { };
virtual void wait_for_exit() = 0;
/**
* Return true if platform supports direct unmap (no mapping db)

23
repos/base/src/core/main.cc

@ -119,8 +119,6 @@ class Core_child : public Child_policy
Child _child;
int &_exit_value;
public:
/**
@ -130,16 +128,14 @@ class Core_child : public Child_policy
Pd_session &core_pd, Capability<Pd_session> core_pd_cap,
Cpu_session &core_cpu, Capability<Cpu_session> core_cpu_cap,
Cap_quota cap_quota, Ram_quota ram_quota,
Rpc_entrypoint &ep,
int &exit_value)
Rpc_entrypoint &ep)
:
_services(services),
_core_pd_cap (core_pd_cap), _core_pd (core_pd),
_core_cpu_cap(core_cpu_cap), _core_cpu(core_cpu),
_cap_quota(Child::effective_quota(cap_quota)),
_ram_quota(Child::effective_quota(ram_quota)),
_child(local_rm, ep, *this),
_exit_value(exit_value)
_child(local_rm, ep, *this)
{ }
@ -178,13 +174,6 @@ class Core_child : public Child_policy
_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_capability ref_pd_cap() const override { return _core_pd_cap; }
@ -232,8 +221,6 @@ namespace Genode {
int main()
{
static int exit_value { 0 };
/**
* Disable tracing within core because it is currently not fully implemented.
*/
@ -322,10 +309,10 @@ int main()
static Reconstructible<Core_child>
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();
return exit_value;
return 0;
}

Loading…
Cancel
Save