L4Re Operating System Framework
Interface and Usage Documentation
|
Set of inhibitor locks, which inhibit specific actions when held. More...
#include <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 Base::__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. | |
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.
anonymous enum |
long L4Re::Inhibitor::acquire | ( | l4_umword_t | id, |
L4::Ipc::String<> | reason | ||
) |
Acquire a specific inhibitor lock.
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. |
0 | Success |
-L4_ENODEV | The specified id does not exist. |
|
inline |
Get information for the next available inhibitor lock.
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. |
>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 86 of file inhibitor.
References L4::Kobject_t< Inhibitor, L4::Kobject, L4RE_PROTO_INHIBITOR >::c().
long L4Re::Inhibitor::release | ( | l4_umword_t | id | ) |
Release a specific inhibitor lock.
id | The ID of the inhibitor lock to release. |
0 | Success |
-L4_ENODEV | Lock with the given id does not exist. |