Loading...
Searching...
No Matches
semaphore
Go to the documentation of this file.
// vi:set ft=cpp: -*- Mode: C++ -*-
/*
* (c) 2015 Alexander Warg <alexander.warg@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/irq>
#include <l4/sys/semaphore.h>
namespace L4 {
struct Semaphore : Kobject_t<Semaphore, Triggerable, L4_PROTO_SEMAPHORE>
{
l4_msgtag_t up(l4_utcb_t *utcb = l4_utcb()) noexcept
{ return trigger(utcb); }
l4_msgtag_t down(l4_timeout_t timeout = L4_IPC_NEVER,
l4_utcb_t *utcb = l4_utcb()) noexcept
{ return l4_semaphore_down_u(cap(), timeout, utcb); }
};
}
L4::Kobject_t
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:750
L4::Kobject::cap
l4_cap_idx_t cap() const noexcept
Return capability selector.
Definition kobject:69
L4_IPC_NEVER
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
irq
C++ Irq interface.
L4
L4 low-level kernel interface.
Definition l4sys-l4f-groups.dox:50
semaphore.h
C semaphore interface.
L4::Semaphore
C++ Kernel-provided semaphore interface, see Kernel-provided semaphore for the C interface.
Definition semaphore:52
L4::Semaphore::up
l4_msgtag_t up(l4_utcb_t *utcb=l4_utcb()) noexcept
Semaphore up operation (wrapper for trigger()).
Definition semaphore:67
L4::Semaphore::down
l4_msgtag_t down(l4_timeout_t timeout=L4_IPC_NEVER, l4_utcb_t *utcb=l4_utcb()) noexcept
Semaphore down operation.
Definition semaphore:89
L4::Triggerable::trigger
l4_msgtag_t trigger(l4_utcb_t *utcb=l4_utcb()) noexcept
Trigger the object.
Definition irq:91
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_timeout_t
Timeout pair.
Definition __timeout.h:53