Follow-up tweaks for issue #145

Because we use to pass a policy class to 'Native_capability_tpl'
we can pass the dst type as part of the policy instead of as
a separate template argument. This patch also adds documentation
of the POLICY interface as expected by 'Native_capability_tpl'.
This commit is contained in:
Norman Feske
2012-03-08 19:28:32 +01:00
parent c9c21ad39c
commit 35384faa7a
10 changed files with 85 additions and 55 deletions

View File

@ -94,8 +94,9 @@ namespace Genode {
return (t1.tid != t2.tid) || (t1.pid != t2.pid); }
struct Thread_id_check {
static bool valid(long id) { return id != 0; }
static long invalid() { return 0; }
typedef long Dst;
static bool valid(Dst id) { return id != 0; }
static Dst invalid() { return 0; }
};
/**
@ -103,7 +104,7 @@ namespace Genode {
*/
typedef struct { } Native_utcb;
typedef Native_capability_tpl<long, Thread_id_check> Native_capability;
typedef Native_capability_tpl<Thread_id_check> Native_capability;
typedef int Native_connection_state; /* socket descriptor */
}