mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-17 22:58:26 +00:00
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:
committed by
Norman Feske
parent
35384faa7a
commit
42b7c01685
@ -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 */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user