mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-17 14:48:20 +00:00
Make local capability interface explicit. Fix #139.
Introduce a factory-, and dereference method for local capabilities. These are capabilities that reference objects of services, which are known to be used protection-domain internally only. To support the new Capability class methods a protected constructor and accessor to the local object's pointer is needed in the platform's capability base-classes. For further discussion details please refer issue #139.
This commit is contained in:
committed by
Norman Feske
parent
56586ae7b0
commit
fa377f0df5
@ -112,6 +112,11 @@ namespace Genode {
|
||||
Native_thread_id _tid; /* global thread ID */
|
||||
int _local_name; /* global unique object ID */
|
||||
|
||||
protected:
|
||||
|
||||
Native_capability(void* ptr) : _local_name((int)ptr) {
|
||||
_tid.tid = Codezero::NILTHREAD; }
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -131,6 +136,7 @@ namespace Genode {
|
||||
bool valid() const { return _tid.tid != Codezero::NILTHREAD; }
|
||||
|
||||
int local_name() const { return _local_name; }
|
||||
void* local() const { return (void*)_local_name; }
|
||||
int dst() const { return _tid.tid; }
|
||||
|
||||
Native_thread_id tid() const { return _tid; }
|
||||
|
Reference in New Issue
Block a user