Replace 'Native_capability::copy_to' by accessor

The 'copy_to' function turned out to be not flexible enough to
accommodate the Noux fork mechanism. This patch removes the function,
adds an accessor for the capability destination and a compound type
'Native_capability::Raw' to be used wherever plain capability
information must be communicated.
This commit is contained in:
Norman Feske
2012-03-26 14:32:16 +02:00
parent 22084dbfa5
commit d6e30c19de
18 changed files with 119 additions and 87 deletions

View File

@@ -15,7 +15,8 @@
#include <base/crt0.h>
void Genode::Platform_env::reload_parent_cap(Capability<Parent> parent_cap)
void Genode::Platform_env::reload_parent_cap(Native_capability::Dst dst,
long local_name)
{
/*
* This function is unused during the normal operation of Genode. It is
@@ -35,7 +36,10 @@ void Genode::Platform_env::reload_parent_cap(Capability<Parent> parent_cap)
* Patch new parent capability into the original location as specified by
* the linker script.
*/
*(Capability<Parent> *)(&_parent_cap) = parent_cap;
Native_capability::Raw *raw = (Native_capability::Raw *)(&_parent_cap);
raw->dst = dst;
raw->local_name = local_name;
/*
* Re-initialize 'Platform_env' members

View File

@@ -122,7 +122,11 @@ static addr_t _setup_elf(Parent_capability parent_cap,
* data segment
*/
if (!parent_info) {
parent_cap.copy_to(ptr);
Native_capability::Raw *raw = (Native_capability::Raw *)ptr;
raw->dst = parent_cap.dst();
raw->local_name = parent_cap.local_name();
parent_info = true;
}