Unify policy name for Native_capability_tpl.

This commit unifies the policy name for the template argument for
Native_capability_tpl to Cap_dst_policy, like suggested by Norman in the
discussion resulting from issue #145. Moreover, it takes the memcpy
operation for copying a Native_capability out of the template, which is
included by a significant bunch of files, and separates it in a library,
analog to the suggestion in issue #145.
This commit is contained in:
Stefan Kalkowski
2012-03-09 11:39:46 +01:00
committed by Norman Feske
parent 35384faa7a
commit 42b7c01685
25 changed files with 101 additions and 54 deletions

View File

@@ -78,14 +78,15 @@ namespace Genode {
*/
typedef struct { } Native_utcb;
struct Thread_id_checker
struct Cap_dst_policy
{
typedef Okl4::L4_ThreadId_t Dst;
static bool valid(Dst tid) { return !Okl4::L4_IsNilThread(tid); }
static Dst invalid() { return Okl4::L4_nilthread; }
static void copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src);
};
typedef Native_capability_tpl<Thread_id_checker> Native_capability;
typedef Native_capability_tpl<Cap_dst_policy> Native_capability;
typedef Okl4::L4_ThreadId_t Native_connection_state;
}

View File

@@ -1,3 +1,4 @@
SRC_CC = ipc.cc pager.cc
LIBS = cap_copy
vpath %.cc $(REP_DIR)/src/base/ipc