L4Re Operating System Framework
Interface and Usage Documentation
|
Name-space interface. More...
#include <namespace>
Public Types | |
enum | Register_flags { Ro = L4_CAP_FPAGE_RO , Rw = L4_CAP_FPAGE_RW , Rs = L4_CAP_FPAGE_RS , Rws = L4_CAP_FPAGE_RWS , Strong = L4_CAP_FPAGE_S , Trusted = 0x008 , Cap_flags = Ro | Rw | Strong | Trusted , Link = 0x100 , Overwrite = 0x200 } |
Flags for registering name spaces. More... | |
enum | Query_result_flags { Partly_resolved = 0x020 } |
Flags returned by query IPC, only used internally. More... | |
enum | Query_timeout { To_default = 3600000 , To_non_blocking = 0 } |
Timeout values for query operation. More... | |
Public Member Functions | |
long | query (char const *name, L4::Cap< void > const &cap, int timeout=To_default, l4_umword_t *local_id=0, bool iterate=true) const noexcept |
Query the name space for a named object. | |
long | query (char const *name, unsigned len, L4::Cap< void > const &cap, int timeout=To_default, l4_umword_t *local_id=0, bool iterate=true) const noexcept |
Query the name space for a named object. | |
long | register_obj (char const *name, L4::Ipc::Cap< void > obj, unsigned flags=Rw) const noexcept |
Register an object with a name. | |
long | unlink (char const *name) |
Remove an entry from the name space. | |
Public Member Functions inherited from L4::Kobject | |
l4_msgtag_t | dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb()) |
Decrement the in kernel reference counter for the object. | |
Additional Inherited Members | |
Protected Types inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > > | |
typedef Namespace | Class |
The target interface type (inheriting from Kobject_t) | |
typedef Typeid::Iface< PROTO, Namespace > | __Iface |
The interface description for the derived class. | |
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Base::__Iface_list > | __Iface_list |
The list of all RPC interfaces provided directly or through inheritance. | |
Protected Member Functions inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > > | |
L4::Cap< Class > | c () const noexcept |
Get the capability to ourselves. | |
Protected Member Functions inherited from L4::Kobject | |
l4_cap_idx_t | cap () const noexcept |
Return capability selector. | |
Static Protected Member Functions inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > > | |
static void | __check_protocols__ () noexcept |
Helper to check for protocol conflicts. | |
Name-space interface.
All name space objects must provide this interface. However, it is not mandatory that a name space object allows to register new capabilities.
The name lookup is done iteratively, this means the hierarchical names are resolved component wise by the client itself.
|
noexcept |
Query the name space for a named object.
[in] | name | String to query (without any leading slashes). |
[out] | cap | Capability slot where the received capability will be put. |
[in] | timeout | Timeout of query in milliseconds. The client will only wait if a name has already been registered with the server but no object has yet been attached. |
[out] | local_id | If given, L4_RCV_ITEM_LOCAL_ID will be set for the IPC from the name space, so that if the capability that was received is a local item, the capability ID will be returned with this parameter. |
[in] | iterate | If true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved. |
0 | Name could be fully resolved. |
>0 | Name could only be partly resolved. The number of remaining characters is returned. |
-L4_ENOENT | Entry could not be found. |
-L4_EAGAIN | Entry exists but no object is yet attached. Try again later. |
<0 | IPC errors, see l4_error_code_t. |
Definition at line 125 of file namespace_impl.h.
|
noexcept |
Query the name space for a named object.
The query string does not necessarily need to be null-terminated.
[in] | len | Length of the string to query without any terminating null characters. |
[in] | name | String to query (without any leading slashes). |
[out] | cap | Capability slot where the received capability will be put. |
[in] | timeout | Timeout of query in milliseconds. The client will only wait if a name has already been registered with the server but no object has yet been attached. |
[out] | local_id | If given, L4_RCV_ITEM_LOCAL_ID will be set for the IPC from the name space, so that if the capability that was received is a local item, the capability ID will be returned with this parameter. |
[in] | iterate | If true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved. |
0 | Name could be fully resolved. |
>0 | Name could only be partly resolved. The number of remaining characters is returned. |
-L4_ENOENT | Entry could not be found. |
-L4_EAGAIN | Entry exists but no object is yet attached. Try again later. |
<0 | IPC errors, see l4_error_code_t. |
Definition at line 77 of file namespace_impl.h.
References L4_EAGAIN, L4_EINVAL, l4_sleep(), and L4_UNLIKELY.
|
inlinenoexcept |
Register an object with a name.
name | Name under which the object should be registered. |
obj | Capability to object to register. An invalid capability may be given to only reserve the name for later use. |
flags | Flags to assign to the entry, see L4Re::Namespace::Register_flags. Note that the rights that are assigned to a capability are not only determined by the rights given in these flags but also by the rights with which the obj capability was mapped to the name space. |
0 | Object was successfully registered with name. |
-L4_EEXIST | Name already registered. |
-L4_EPERM | Caller does not have L4_CAP_FPAGE_W right on the invoked capability. |
-L4_ENOMEM | Server has insufficient resources. |
-L4_EINVAL | Invalid parameter. |
<0 | IPC errors, see l4_error_code_t. |
|
inline |
Remove an entry from the name space.
name | Name of the entry to remove. |
0 | Entry successfully removed. |
-L4_ENOENT | Given name does not exist. |
-L4_EPERM | Caller does not have L4_CAP_FPAGE_W right on the invoked capability. |
-L4_EACCESS | Name cannot be removed. |
<0 | IPC errors, see l4_error_code_t. |