genode/repos/base-foc/src/core/include/cap_index.h
Norman Feske 88b358c5ef Unification of native_capability.h
This patch establishes the sole use of generic headers across all
kernels. The common 'native_capability.h' is based on the version of
base-sel4. All traditional L4 kernels and Linux use the same
implementation of the capability-lifetime management. On base-hw, NOVA,
Fiasco.OC, and seL4, custom implementations (based on their original
mechanisms) are used, with the potential to unify them further in the
future.

This change achieves binary compatibility of dynamically linked programs
across all kernels.

Furthermore, the patch introduces a Native_capability::print method,
which allows the easy output of the kernel-specific capability
representation using the base/log.h API.

Issue #1993
2016-07-11 13:07:37 +02:00

53 lines
1.3 KiB
C++

/*
* \brief Core-specific capability index
* \author Stefan Kalkowski
* \date 2012-02-22
*/
/*
* Copyright (C) 2012-2013 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 _CORE__INCLUDE__CAP_INDEX_H_
#define _CORE__INCLUDE__CAP_INDEX_H_
/* base-internal includes */
#include <base/internal/native_thread.h>
#include <base/internal/cap_map.h>
namespace Genode {
class Platform_thread;
class Pd_session_component;
class Core_cap_index;
}
class Genode::Core_cap_index : public Native_capability::Data
{
private:
Pd_session_component *_session;
Platform_thread const *_pt;
Native_thread _gate;
public:
Core_cap_index(Pd_session_component *session = 0,
Platform_thread *pt = 0,
Native_thread gate = Native_thread() )
: _session(session), _pt(pt), _gate(gate) {}
Pd_session_component const *session() const { return _session; }
Platform_thread const *pt() const { return _pt; }
Native_thread gate() const { return _gate; }
void session(Pd_session_component *c) { _session = c; }
void pt(Platform_thread const *t) { _pt = t; }
};
#endif /* _CORE__INCLUDE__CAP_INDEX_H_ */