L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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
16namespace L4Re {
17
40class Inhibitor :
41 public L4::Kobject_t<Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR>
42{
43public:
44 enum
45 {
46 Name_max = 20
47 };
48
59 L4_INLINE_RPC(long, acquire, (l4_umword_t id, L4::Ipc::String<> reason));
60
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}
L4::Cap related definitions.
Set of inhibitor locks, which inhibit specific actions when held.
Definition inhibitor:42
@ Name_max
The maximum length of a lock's name.
Definition inhibitor:46
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
long acquire(l4_umword_t id, L4::Ipc::String<> reason)
Acquire a specific inhibitor lock.
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:761
L4::Cap< Class > c() const noexcept
Get the capability to ourselves.
Definition __typeinfo.h:780
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
signed long l4_mword_t
Signed machine word.
Definition l4int.h:48
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:340
Interface Definition Language.
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition ipc_iface:469
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
Definition ipc_iface:440
L4Re C++ Interfaces.
Definition l4re.dox:17
L4Re Protocol Constants (C version)
Mark an argument as in-out argument.
Definition ipc_types:53
Standard list of RPCs of an interface.
Definition __typeinfo.h:439