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

@ -93,10 +93,11 @@ namespace Genode {
inline bool operator != (Native_thread_id t1, Native_thread_id t2) {
return (t1.tid != t2.tid) || (t1.pid != t2.pid); }
struct Thread_id_check {
struct Cap_dst_policy {
typedef long Dst;
static bool valid(Dst id) { return id != 0; }
static Dst invalid() { return 0; }
static void copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src);
};
/**
@ -104,7 +105,7 @@ namespace Genode {
*/
typedef struct { } Native_utcb;
typedef Native_capability_tpl<Thread_id_check> Native_capability;
typedef Native_capability_tpl<Cap_dst_policy> Native_capability;
typedef int Native_connection_state; /* socket descriptor */
}