mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 23:12:24 +00:00
88b358c5ef
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
64 lines
2.0 KiB
C++
64 lines
2.0 KiB
C++
/*
|
|
* \brief Kernel-specific thread meta data
|
|
* \author Norman Feske
|
|
* \date 2016-03-11
|
|
*
|
|
* On most platforms, the 'Genode::Native_thread' type is private to the
|
|
* base framework. However, on NOVA, we make the type publicly available to
|
|
* expose the low-level thread-specific capability selectors to user-level
|
|
* virtual-machine monitors (Seoul or VirtualBox).
|
|
*/
|
|
|
|
/*
|
|
* 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__NOVA__NATIVE_THREAD_H_
|
|
#define _INCLUDE__NOVA__NATIVE_THREAD_H_
|
|
|
|
#include <base/stdint.h>
|
|
#include <nova/receive_window.h>
|
|
|
|
namespace Genode { struct Native_thread; }
|
|
|
|
struct Genode::Native_thread
|
|
{
|
|
enum { INVALID_INDEX = ~0UL };
|
|
|
|
addr_t ec_sel; /* selector for execution context */
|
|
addr_t exc_pt_sel; /* base of event portal window */
|
|
bool vcpu; /* true if thread is a virtual CPU */
|
|
addr_t initial_ip; /* initial IP of local thread */
|
|
|
|
/* receive window for capability selectors received at the server side */
|
|
Receive_window server_rcv_window;
|
|
|
|
/*
|
|
* Designated selector to populate with the result of an IPC call
|
|
*
|
|
* By default, the client-side receive window for delegated selectors
|
|
* is automatically allocated within the component's selector space.
|
|
* However, in special cases such as during the initialization of a
|
|
* user-level VMM (ports/include/vmm/vcpu_dispatcher.h), the targeted
|
|
* selector is defined manually. The 'client_rcv_sel' provides the
|
|
* hook for such a manual allocation. If it contains a valid selector
|
|
* value, the value is used as the basis of the receive window of an
|
|
* 'ipc_call'.
|
|
*/
|
|
addr_t client_rcv_sel = INVALID_INDEX;
|
|
|
|
void reset_client_rcv_sel() { client_rcv_sel = INVALID_INDEX; }
|
|
|
|
Native_capability pager_cap;
|
|
|
|
Native_thread() : ec_sel(INVALID_INDEX),
|
|
exc_pt_sel(INVALID_INDEX),
|
|
vcpu(false),
|
|
initial_ip(0) { }
|
|
};
|
|
|
|
#endif /* _INCLUDE__NOVA__NATIVE_THREAD_H_ */
|