L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
inhibitor
1// vim:set ft=cpp: -*- Mode: C++ -*-
2/*
3 * (c) 2014 Steffen Liebergeld <steffen.liebergeld@kernkonzept.com>
4 *
5 * License: see LICENSE.spdx (in this directory or the directories above)
6 */
7#pragma once
8
9#include <l4/sys/capability>
10#include <l4/sys/cxx/ipc_iface>
11#include <l4/sys/cxx/ipc_string>
12#include <l4/re/protocols.h>
13
14namespace L4Re {
15
38class Inhibitor :
39 public L4::Kobject_t<Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR>
40{
41public:
42 enum
43 {
44 Name_max = 20
45 };
46
57 L4_INLINE_RPC(long, acquire, (l4_umword_t id, L4::Ipc::String<> reason));
58
68
84 long next_lock_info(char *name, unsigned len, l4_mword_t current_id = -1,
85 l4_utcb_t *utcb = l4_utcb())
86 {
87 L4::Ipc::String<char> name_buf(len , name);
88 long r = next_lock_info_t::call(c(), &current_id, name_buf, utcb);
89 if (r < 0)
90 return r;
91
92 return current_id;
93 }
94
96 L4::Ipc::String<char> &name));
97
99};
100
101}
L4::Cap related definitions.
Set of inhibitor locks, which inhibit specific actions when held.
Definition inhibitor:40
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:84
long acquire(l4_umword_t id, L4::Ipc::String<> reason)
Acquire a specific inhibitor lock.
@ Name_max
The maximum length of a lock's name.
Definition inhibitor:44
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:750
L4::Cap< Class > c() const noexcept
Get the capability to ourselves.
Definition __typeinfo.h:769
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
signed long l4_mword_t
Signed machine word.
Definition l4int.h:37
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
Interface Definition Language.
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition ipc_iface:476
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
Definition ipc_iface:447
L4Re C++ Interfaces.
Definition cmd_control:14
L4Re Protocol Constants (C version)
Mark an argument as in-out argument.
Definition ipc_types:42
Standard list of RPCs of an interface.
Definition __typeinfo.h:428