mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
Let reload_parent_cap take the new cap as agument
This commit is contained in:
parent
decfe7c4bb
commit
3ddf7d2b1b
@ -361,6 +361,14 @@ namespace Genode {
|
||||
*/
|
||||
~Platform_env() { parent()->exit(0); }
|
||||
|
||||
/**
|
||||
* Reload parent capability and reinitialize environment resources
|
||||
*/
|
||||
void reload_parent_cap(Capability<Parent>)
|
||||
{
|
||||
/* not supported on Linux */
|
||||
}
|
||||
|
||||
|
||||
/*******************
|
||||
** Env interface **
|
||||
|
@ -154,7 +154,7 @@ namespace Genode {
|
||||
* meaningful capabilities obtained via its updated parent
|
||||
* capability.
|
||||
*/
|
||||
void reload_parent_cap();
|
||||
void reload_parent_cap(Capability<Parent>);
|
||||
|
||||
|
||||
/*******************
|
||||
|
16
base/src/base/env/reload_parent_cap.cc
vendored
16
base/src/base/env/reload_parent_cap.cc
vendored
@ -12,9 +12,10 @@
|
||||
*/
|
||||
|
||||
#include <base/platform_env.h>
|
||||
#include <base/crt0.h>
|
||||
|
||||
|
||||
void Genode::Platform_env::reload_parent_cap()
|
||||
void Genode::Platform_env::reload_parent_cap(Capability<Parent> parent_cap)
|
||||
{
|
||||
/*
|
||||
* This function is unused during the normal operation of Genode. It is
|
||||
@ -22,14 +23,23 @@ void Genode::Platform_env::reload_parent_cap()
|
||||
* Noux execution environment.
|
||||
*
|
||||
* The function is called by the freshly created process right after the
|
||||
* fork happened. During the fork, the Noux environment is expected to have
|
||||
* updated the '_parent_cap' of the new process.
|
||||
* fork happened.
|
||||
*
|
||||
* The existing 'Platform_env' object contains capabilities that are
|
||||
* meaningful for the forking process but not the new process. Before the
|
||||
* the environment can be used, it must be reinitialized with the resources
|
||||
* provided by the actual parent.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Patch new parent capability into the original location as specified by
|
||||
* the linker script.
|
||||
*/
|
||||
*(Capability<Parent> *)(&_parent_cap) = parent_cap;
|
||||
|
||||
/*
|
||||
* Re-initialize 'Platform_env' members
|
||||
*/
|
||||
_parent_client = Parent_client(Genode::parent_cap());
|
||||
_resources = Resources(_parent_client);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user