L4Re - L4 Runtime Environment
namespace
Go to the documentation of this file.
1 // -*- Mode: C++ -*-
2 // vim:ft=cpp
7 /*
8  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
9  * Alexander Warg <warg@os.inf.tu-dresden.de>,
10  * Björn Döbel <doebel@os.inf.tu-dresden.de>
11  * economic rights: Technische Universität Dresden (Germany)
12  *
13  * This file is part of TUD:OS and distributed under the terms of the
14  * GNU General Public License 2.
15  * Please see the COPYING-GPL-2 file for details.
16  *
17  * As a special exception, you may use this file as part of a free software
18  * library without restriction. Specifically, if other files instantiate
19  * templates or use macros or inline functions from this file, or you compile
20  * this file and link it with other files to produce an executable, this
21  * file does not by itself cause the resulting executable to be covered by
22  * the GNU General Public License. This exception does not however
23  * invalidate any other reasons why the executable file might be covered by
24  * the GNU General Public License.
25  */
26 #pragma once
27 
28 #include <l4/sys/capability>
29 #include <l4/re/protocols.h>
30 #include <l4/sys/cxx/ipc_iface>
31 #include <l4/sys/cxx/ipc_array>
32 #include <l4/sys/cxx/ipc_string>
33 
34 namespace L4Re {
35 
60 class L4_EXPORT Namespace :
61  public L4::Kobject_t<Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE,
62  L4::Type_info::Demand_t<1> >
63 {
64 public:
69  {
74  Strong = L4_CAP_FPAGE_S,
75  Trusted = 0x008,
76 
77  Cap_flags = Ro | Rw | Strong | Trusted,
78 
79  Link = 0x100,
80  Overwrite = 0x200,
81  };
82 
89  {
90  Partly_resolved = 0x020,
91  };
92 
93  enum Query_timeout
94  {
95  To_default = 3600000,
96  To_non_blocking = 0,
97  To_forever = -1,
98  };
99 
100  L4_RPC_NF(
102  L4::Ipc::Small_buf cap,
105 
131  long query(char const *name, L4::Cap<void> const &cap,
132  int timeout = To_default,
133  l4_umword_t *local_id = 0, bool iterate = true) const throw();
134 
144  long query(char const *name, unsigned len, L4::Cap<void> const &cap,
145  int timeout = To_default,
146  l4_umword_t *local_id = 0, bool iterate = true) const throw();
147 
148  L4_RPC_NF(long, register_obj, (unsigned flags,
152 
176  long register_obj(char const *name, L4::Ipc::Cap<void> obj,
177  unsigned flags = Rw) const throw()
178  {
179  return register_obj_t::call(c(), flags,
181  __builtin_strlen(name), name),
182  obj);
183  }
184 
185  L4_RPC_NF_OP(3, // backward compatibility opcode
186  long, unlink, (L4::Ipc::Array<char const, unsigned long> name),
188 
202  long unlink(char const* name)
203  {
204  return unlink_t::call(c(), L4::Ipc::Array<char const, unsigned long>(
205  __builtin_strlen(name), name));
206  }
207 
209 
210 private:
211  long _query(char const *name, unsigned len,
212  L4::Cap<void> const &target, l4_umword_t *local_id,
213  bool iterate) const throw();
214 
215 };
216 
217 };
Capability type for RPC interfaces (see L4::Cap<T>).
Definition: ipc_types:541
Read and interface specific &#39;W&#39; right for capability flex-pages.
Definition: __l4_fpage.h:176
Query_result_flags
Flags returned by query IPC, only used internally.
Definition: namespace:88
Interface specific &#39;S&#39; right for capability flex-pages.
Definition: __l4_fpage.h:153
Standard list of RPCs of an interface.
Definition: __typeinfo.h:438
A receive item for receiving a single capability.
Definition: ipc_types:268
Read and interface specific &#39;S&#39; right for capability flex-pages.
Definition: __l4_fpage.h:183
Name-space interface.
Definition: namespace:60
L4Re C++ Interfaces.
Definition: cmd_control:15
L4::Cap related definitions.
long register_obj(char const *name, L4::Ipc::Cap< void > obj, unsigned flags=Rw) const
Register an object with a name.
Definition: namespace:176
Read right for capability flex-pages.
Definition: __l4_fpage.h:160
Register_flags
Flags for registering name spaces.
Definition: namespace:68
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
Interface Definition Language.
Attribute for defining an optional RPC argument.
Definition: ipc_types:147
Array reference data type for arrays located in the message.
Definition: ipc_array:39
RPC attribute for an RPC call with required rights.
Definition: ipc_iface:246
long unlink(char const *name)
Remove an entry from the name space.
Definition: namespace:202
Helper class to create an L4Re interface class that is derived from a single base class...
Definition: __typeinfo.h:759
Read, interface specific &#39;W&#39;, and &#39;S&#39; rights for capability flex-pages.
Definition: __l4_fpage.h:190
C++ interface for capabilities.
Definition: capability.h:13
Array data type for dynamically sized arrays in RPCs.
Definition: ipc_array:85
L4Re Protocol Constants (C version)
#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:501
Generic RPC wrapper for L4 flex-pages.
Definition: ipc_types:321
#define L4_RPC_NF(res, name, args...)
Define an RPC call type (the type only, no callable).
Definition: ipc_iface:486