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:
Stefan Kalkowski
2012-03-06 15:55:44 +01:00
committed by Norman Feske
parent 56586ae7b0
commit fa377f0df5
11 changed files with 94 additions and 17 deletions

View File

@ -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; }