L4Re - L4 Runtime Environment
inhibitor
1 // vim:set ft=cpp: -*- Mode: C++ -*-
2 /*
3  * (c) 2014 Steffen Liebergeld <steffen.liebergeld@kernkonzept.com>
4  *
5  * This file is licensed under the terms of the GNU Lesser General
6  * Public License 2.1.
7  * See the file COPYING-LGPL-2.1 for details.
8  */
9 #pragma once
10 
11 #include <l4/sys/capability>
12 #include <l4/sys/cxx/ipc_iface>
13 #include <l4/sys/cxx/ipc_string>
14 #include <l4/re/protocols.h>
15 
16 namespace L4Re {
17 
40 class Inhibitor :
41  public L4::Kobject_t<Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR>
42 {
43 public:
44  enum
45  {
46  Name_max = 20
47  };
48 
59  L4_INLINE_RPC(long, acquire, (l4_umword_t id, L4::Ipc::String<> reason));
60 
69  L4_INLINE_RPC(long, release, (l4_umword_t id));
70 
86  long next_lock_info(char *name, unsigned len, l4_mword_t current_id = -1,
87  l4_utcb_t *utcb = l4_utcb())
88  {
89  L4::Ipc::String<char> name_buf(len , name);
90  long r = next_lock_info_t::call(c(), &current_id, name_buf, utcb);
91  if (r < 0)
92  return r;
93 
94  return current_id;
95  }
96 
98  L4::Ipc::String<char> &name));
99 
101 };
102 
103 }
Standard list of RPCs of an interface.
Definition: __typeinfo.h:438
signed long l4_mword_t
Signed machine word.
Definition: l4int.h:49
long next_lock_info(char *name, unsigned len, l4_mword_t current_id=-1, l4_utcb_t *utcb=l4_utcb())
Get information for the next available inhibitor lock.
Definition: inhibitor:86
L4Re C++ Interfaces.
Definition: cmd_control:15
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition: utcb.h:67
L4::Cap related definitions.
Set of inhibitor locks, which inhibit specific actions when held.
Definition: inhibitor:40
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition: ipc_iface:469
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
L4::Cap< Class > c() const noexcept
Get the capability to ourselves.
Definition: __typeinfo.h:779
The maximum length of a lock&#39;s name.
Definition: inhibitor:46
Mark an argument as in-out argument.
Definition: ipc_types:52
Interface Definition Language.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition: utcb.h:340
long release(l4_umword_t id)
Release a specific inhibitor lock.
Helper class to create an L4Re interface class that is derived from a single base class...
Definition: __typeinfo.h:759
long acquire(l4_umword_t id, L4::Ipc::String<> reason)
Acquire a specific inhibitor lock.
L4Re Protocol Constants (C version)
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
Definition: ipc_iface:440