Loading...
Searching...
No Matches
namespace
Go to the documentation of this file.
// -*- Mode: C++ -*-
// vim:ft=cpp
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>,
* Björn Döbel <doebel@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/capability>
#include <l4/re/protocols.h>
#include <l4/sys/cxx/ipc_iface>
#include <l4/sys/cxx/ipc_array>
#include <l4/sys/cxx/ipc_string>
namespace L4Re {
class L4_EXPORT Namespace :
public L4::Kobject_t<Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE,
L4::Type_info::Demand_t<1> >
{
public:
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,
};
enum Query_result_flags
{
Partly_resolved = 0x020,
};
enum Query_timeout
{
To_default = 3600000,
To_non_blocking = 0,
};
L4_RPC_NF(
long, query, (L4::Ipc::Array_ref<char const, unsigned long> name,
L4::Ipc::Small_buf cap,
L4::Ipc::Snd_fpage &snd_cap, L4::Ipc::Opt<L4::Opcode &> dummy,
L4::Ipc::Opt<L4::Ipc::Array_ref<char const, unsigned long> &> out_name));
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;
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;
L4_RPC_NF(long, register_obj, (unsigned flags,
L4::Ipc::Array<char const, unsigned long> name,
L4::Ipc::Opt< L4::Ipc::Cap<void> > obj),
L4::Ipc::Call_t<L4_CAP_FPAGE_W>);
long register_obj(char const *name, L4::Ipc::Cap<void> obj,
unsigned flags = Rw) const noexcept
{
return register_obj_t::call(c(), flags,
L4::Ipc::Array<char const, unsigned long>(
__builtin_strlen(name), name),
obj);
}
L4_RPC_NF_OP(3, // backward compatibility opcode
long, unlink, (L4::Ipc::Array<char const, unsigned long> name),
L4::Ipc::Call_t<L4_CAP_FPAGE_W>);
*/
long unlink(char const* name)
{
return unlink_t::call(c(), L4::Ipc::Array<char const, unsigned long>(
__builtin_strlen(name), name));
}
typedef L4::Typeid::Rpcs<query_t, register_obj_t, unlink_t> Rpcs;
private:
long _query(char const *name, unsigned len,
L4::Cap<void> const &target, l4_umword_t *local_id,
bool iterate) const noexcept;
};
};
capability
L4::Cap related definitions.
L4Re::Namespace
Name-space interface.
Definition namespace:52
L4Re::Namespace::register_obj
long register_obj(char const *name, L4::Ipc::Cap< void > obj, unsigned flags=Rw) const noexcept
Register an object with a name.
Definition namespace:165
L4Re::Namespace::Query_result_flags
Query_result_flags
Flags returned by query IPC, only used internally.
Definition namespace:78
L4Re::Namespace::Partly_resolved
@ Partly_resolved
Name was only partly resolved.
Definition namespace:79
L4Re::Namespace::unlink
long unlink(char const *name)
Remove an entry from the name space.
Definition namespace:191
L4Re::Namespace::Register_flags
Register_flags
Flags for registering name spaces.
Definition namespace:58
L4Re::Namespace::Rs
@ Rs
Read-only + strong.
Definition namespace:61
L4Re::Namespace::Trusted
@ Trusted
Obsolete, do not use.
Definition namespace:64
L4Re::Namespace::Overwrite
@ Overwrite
If entry already exists, overwrite it.
Definition namespace:69
L4Re::Namespace::Strong
@ Strong
Strong.
Definition namespace:63
L4Re::Namespace::Ro
@ Ro
Read-only.
Definition namespace:59
L4Re::Namespace::Rws
@ Rws
Read-write + strong.
Definition namespace:62
L4Re::Namespace::Link
@ Link
Obsolete, do not use.
Definition namespace:68
L4Re::Namespace::Rw
@ Rw
Read-write.
Definition namespace:60
L4Re::Namespace::Query_timeout
Query_timeout
Timeout values for query operation.
Definition namespace:84
L4Re::Namespace::To_non_blocking
@ To_non_blocking
Expect callee to answer immediately.
Definition namespace:86
L4Re::Namespace::To_default
@ To_default
Default timeout.
Definition namespace:85
L4::Cap
C++ interface for capabilities.
Definition capability.h:224
L4::Ipc::Small_buf
A receive item for receiving a single object capability.
Definition ipc_types:258
L4::Ipc::Snd_fpage
Send item or return item.
Definition ipc_types:324
L4::Kobject_t
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:750
L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >::c
L4::Cap< Class > c() const noexcept
Definition __typeinfo.h:769
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
L4_CAP_FPAGE_RO
@ L4_CAP_FPAGE_RO
Read right for capability flexpages.
Definition __l4_fpage.h:176
L4_CAP_FPAGE_RW
@ L4_CAP_FPAGE_RW
Read and interface specific 'W' right for capability flexpages.
Definition __l4_fpage.h:192
L4_CAP_FPAGE_W
@ L4_CAP_FPAGE_W
Interface specific 'W' right for capability flexpages.
Definition __l4_fpage.h:157
L4_CAP_FPAGE_RS
@ L4_CAP_FPAGE_RS
Read and interface specific 'S' right for capability flexpages.
Definition __l4_fpage.h:199
L4_CAP_FPAGE_RWS
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flexpages.
Definition __l4_fpage.h:206
L4_CAP_FPAGE_S
@ L4_CAP_FPAGE_S
Interface specific 'S' right for capability flexpages.
Definition __l4_fpage.h:169
L4_EXPORT
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:214
ipc_iface
Interface Definition Language.
L4_RPC_NF_OP
#define L4_RPC_NF_OP(op, res, name, args...)
Define an RPC call type with specific opcode (the type only, no callable).
Definition ipc_iface:525
L4_RPC_NF
#define L4_RPC_NF(res, name, args...)
Define an RPC call type (the type only, no callable).
Definition ipc_iface:510
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14
L4
L4 low-level kernel interface.
Definition l4sys-l4f-groups.dox:50
protocols.h
L4Re Protocol Constants (C version).
L4::Ipc::Array_ref
Array reference data type for arrays located in the message.
Definition ipc_array:29
L4::Ipc::Array
Array data type for dynamically sized arrays in RPCs.
Definition ipc_array:82
L4::Ipc::Call_t
RPC attribute for an RPC call with required rights.
Definition ipc_iface:271
L4::Ipc::Opt
Attribute for defining an optional RPC argument.
Definition ipc_types:137
L4::Typeid::Rpcs
Standard list of RPCs of an interface.
Definition __typeinfo.h:428