Loading...
Searching...
No Matches
L4Re::Inhibitor Class Reference

Set of inhibitor locks, which inhibit specific actions when held. More...

`#include <inhibitor>`

Inheritance diagram for L4Re::Inhibitor:
Collaboration diagram for L4Re::Inhibitor:

## Public Types

enum | { Name_max = 20 }

## Public Member Functions

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.
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.
Public Member Functions inherited from L4::Kobject
l4_msgtag_t | dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
| Decrement the in kernel reference counter for the object.

## Additional Inherited Members

Protected Types inherited from L4::Kobject_t< Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR >
typedef Inhibitor | Class
| The target interface type (inheriting from Kobject_t).
typedef Typeid::Iface< PROTO, Inhibitor > | __Iface
| The interface description for the derived class.
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename L4::Kobject::__Iface_list > | __Iface_list
| The list of all RPC interfaces provided directly or through inheritance.
Protected Member Functions inherited from L4::Kobject_t< Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR >
L4::Cap< Class > | c () const noexcept
| Get the capability to ourselves.
Protected Member Functions inherited from L4::Kobject
l4_cap_idx_t | cap () const noexcept
| Return capability selector.
Static Protected Member Functions inherited from L4::Kobject_t< Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR >
static void | __check_protocols__ () noexcept
| Helper to check for protocol conflicts.

## Detailed Description

Set of inhibitor locks, which inhibit specific actions when held.

This interface provides access to a set of inhibitor locks, each determined by an ID that is specific to the Inhibitor object. Each individual lock shall prevent, a specific (implementation defined) action to be executed, as long as the lock is held.

For example there can be an inhibitor lock to prevent a transition to suspend-to-RAM state and a different one to prevent shutdown.

A client shall take an inhibitor lock if it needs to execute code before the action is taken. For example a lock-screen application shall grab an inhibitor lock for the suspend action to be able to lock the screen before the system goes to sleep.

Inhibitor locks are usually closely related to specific events. Usually a server automatically subscribes a client holding a lock to the corresponding event. The server shall send the event to inform the client that an action is pending. Upon reception of the event, the client is supposed to release the corresponding inhibitor lock.

Definition at line 38 of file inhibitor.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
Name_max | The maximum length of a lock's name.

Definition at line 42 of file inhibitor.

## Member Function Documentation

## acquire()

long L4Re::Inhibitor::acquire | ( | l4_umword_t | id,
|  | L4::Ipc::String<> | reason )

Acquire a specific inhibitor lock.

Parameters

  id | ID of the inhibitor lock that the client intends to acquire
  reason | The reason why you need the lock. Used for informing the user or debugging.

Return values

  0 | Success
  -L4_ENODEV | The specified id does not exist.

References acquire().

Referenced by acquire().

Here is the call graph for this function:
Here is the caller graph for this function:

## next_lock_info()

long L4Re::Inhibitor::next_lock_info | ( | char * | name,
|  | unsigned | len,
|  | l4_mword_t | current_id = -1,
|  | l4_utcb_t * | utcb = l4_utcb() )

inline

Get information for the next available inhibitor lock.

Parameters

  name | A pointer to a buffer for the name of the lock.
  len | The length of the available buffer (usually Name_max is used).
  current_id | The ID of the last available lock, use -1 to get the first lock.
  utcb | The UTCB to use for the message.

Return values

  >0 | The ID of the next available lock if there is one (in this case name shall contain the name of the inhibitor lock).
  -L4_ENODEV | There are no more locks.

Definition at line 84 of file inhibitor.

References L4::Kobject_t< Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR >::c().

Here is the call graph for this function:

## release()

long L4Re::Inhibitor::release | ( | l4_umword_t | id | ) |

Release a specific inhibitor lock.

Parameters

  id | The ID of the inhibitor lock to release.

Return values

  0 | Success
  -L4_ENODEV | Lock with the given id does not exist.

References release().

Referenced by release().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file:

- l4/re/inhibitor