Cleanup of parent-cap handling

This patch alleviates the need for a Native_capability::Dst at the API
level. The former use case of this type as argument to
Deprecated_env::reinit uses the opaque Native_capability::Raw type
instead. The 'Raw' type contains the portion of the capability that is
transferred as-is when delegating the capability (i.e., when installing
the parent capability into a new component, or when installing a new
parent capability into a new forked Noux process). This information can
be retrieved via the new Native_capability::raw method.

Furthermore, this patch moves the functions for retriving the parent
capability to base/internal/parent_cap.h, which is meant to be
implemented in platform-specific ways. It replaces the former set of
startup/internal/_main_parent_cap.h headers.

Issue #1993
This commit is contained in:
Norman Feske
2016-06-13 15:14:32 +02:00
parent f7bdd383e2
commit d71f0a9606
29 changed files with 185 additions and 190 deletions

View File

@@ -30,16 +30,7 @@ namespace Genode {
typedef Nova::Obj_crd Dst;
struct Raw
{
Dst dst;
/*
* It is obsolete and unused in NOVA, however still used by
* generic base part
*/
addr_t local_name;
};
struct Raw { };
private:
@@ -169,6 +160,8 @@ namespace Genode {
{
return Native_capability();
}
Raw raw() const { return Raw(); }
};
}

View File

@@ -1,5 +1,5 @@
/*
* \brief Obtain parent capability
* \brief Interface to obtain the parent capability for the component
* \author Norman Feske
* \author Alexander Boettcher
* \date 2010-01-26
@@ -9,32 +9,29 @@
*/
/*
* Copyright (C) 2010-2013 Genode Labs GmbH
* Copyright (C) 2010-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__STARTUP__INTERNAL___MAIN_PARENT_CAP_H_
#define _INCLUDE__STARTUP__INTERNAL___MAIN_PARENT_CAP_H_
#ifndef _INCLUDE__BASE__INTERNAL__PARENT_CAP_H_
#define _INCLUDE__BASE__INTERNAL__PARENT_CAP_H_
/* Genode includes */
#include <util/string.h>
#include <parent/capability.h>
/* NOVA includes */
#include <nova/syscalls.h>
namespace Genode {
/**
* Return constructed parent capability
*/
Parent_capability parent_cap()
static inline Parent_capability parent_cap()
{
/* assemble parent capability */
return reinterpret_cap_cast<Parent>(
Native_capability(Nova::PT_SEL_PARENT));
}
}
#endif /* _INCLUDE__STARTUP__INTERNAL___MAIN_PARENT_CAP_H_ */
#endif /* _INCLUDE__BASE__INTERNAL__PARENT_CAP_H_ */