genode/repos/base-sel4/include/base/native_types.h

85 lines
1.8 KiB
C
Raw Normal View History

2014-10-15 14:48:45 +02:00
/*
* \brief Platform-specific type definitions
* \author Norman Feske
* \date 2014-10-14
*/
/*
* Copyright (C) 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 _INCLUDE__BASE__NATIVE_TYPES_H_
#define _INCLUDE__BASE__NATIVE_TYPES_H_
#include <base/stdint.h>
#include <base/native_capability.h>
namespace Genode {
struct Cap_dst_policy
{
typedef int Dst;
static bool valid(Dst tid) { return false; }
static Dst invalid() { return true; }
static void copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src);
};
class Platform_thread;
typedef int Native_thread_id;
struct Native_thread
{
2015-05-07 13:33:06 +02:00
unsigned tcb_sel = 0;
2014-10-15 14:48:45 +02:00
/**
* Only used in core
*
* For 'Thread' objects created within core, 'pt' points to
* the physical thread object, which is going to be destroyed
* on destruction of the 'Thread'.
*/
2015-05-07 13:33:06 +02:00
Platform_thread *pt = nullptr;
2014-10-15 14:48:45 +02:00
};
typedef Native_capability_tpl<Cap_dst_policy> Native_capability;
2015-05-07 13:33:06 +02:00
class Native_utcb
{
private:
/**
* On seL4 the UTCB is called IPC buffer. We use one page
* for each IPC buffer.
*/
enum { IPC_BUFFER_SIZE = 4096 };
addr_t _utcb[IPC_BUFFER_SIZE/sizeof(addr_t)];
};
2014-10-15 14:48:45 +02:00
struct Native_config
{
/**
* Thread-context area configuration.
*/
static constexpr addr_t context_area_virtual_base() {
return 0x40000000UL; }
static constexpr addr_t context_area_virtual_size() {
return 0x10000000UL; }
/**
* Size of virtual address region holding the context of one thread
*/
static constexpr addr_t context_virtual_size() { return 0x00100000UL; }
};
struct Native_pd_args { };
typedef int Native_connection_state;
}
#endif /* _INCLUDE__BASE__NATIVE_TYPES_H_ */