genode/repos/base-foc/include/foc/receive_window.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

57 lines
1.0 KiB
C++

/*
* \brief Receive window for capability selectors
* \author Norman Feske
* \date 2016-03-22
*/
/*
* Copyright (C) 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__FOC__RECEIVE_WINDOW_H_
#define _INCLUDE__FOC__RECEIVE_WINDOW_H_
/* Genode includes */
#include <base/stdint.h>
#include <base/ipc_msgbuf.h>
namespace Genode { struct Receive_window; }
class Genode::Receive_window
{
private:
/**
* Base of capability receive window.
*/
Native_capability::Data * _rcv_idx_base = nullptr;
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
public:
Receive_window() { }
~Receive_window();
void init();
/**
* Return address of capability receive window
*/
addr_t rcv_cap_sel_base();
/**
* Return received selector with index i
*
* \return capability selector, or 0 if index is invalid
*/
addr_t rcv_cap_sel(unsigned i);
};
#endif /* _INCLUDE__FOC__RECEIVE_WINDOW_H_ */