genode/repos/base-hw/src/include/base/internal/parent_cap.h
Norman Feske d71f0a9606 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
2016-07-11 13:05:27 +02:00

31 lines
718 B
C++

/*
* \brief Interface to obtain the parent capability for the component
* \author Stefan Kalkowski
* \date 2015-04-27
*/
/*
* Copyright (C) 2015-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__BASE__INTERNAL__PARENT_CAP_H_
#define _INCLUDE__BASE__INTERNAL__PARENT_CAP_H_
/* Genode includes */
#include <parent/capability.h>
namespace Hw { extern Genode::Untyped_capability _parent_cap; }
namespace Genode {
static inline Parent_capability parent_cap()
{
return reinterpret_cap_cast<Parent>(Hw::_parent_cap);
}
}
#endif /* _INCLUDE__BASE__INTERNAL__PARENT_CAP_H_ */