|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
A union to hold timeouts that are passed down to end up in the scheduler. More...
#include <timeout.h>

Public Member Functions | |
| __TimeoutArgument (AbsoluteMonotonicTimeout absoluteTimeout) | |
| Permit implicit construction from absolute timeouts. | |
| __TimeoutArgument (Timeout *relativeTimeout) | |
| Permit implicit construction from relative timeouts. | |
| bool | is_relative () |
| Returns true if this is a relative timeout, false otherwise. | |
| bool | is_valid () |
| Returns true if this is a valid timeout, false otherwise. | |
| bool | may_block () |
| Returns true if the timeout is in the future (and therefore may still block), false otherwise. | |
| void | elapse (Ticks ticks) |
| If this is a relative timeout, elapse the specified number of ticks. | |
| void | elapse_from (Timeout &source) |
| Take any ticks that have been counted towards source and apply it to destination. | |
Public Attributes | |
| AbsoluteMonotonicTimeout | absoluteTimeout |
| An absolute timeout. | |
| Timeout * | relativeTimeout |
| A relative timeout. | |
A union to hold timeouts that are passed down to end up in the scheduler.
These are one of two things:
This is a tagged union, with the CHERI tag bit used to differentiate between the two cases.
|
inline |
Permit implicit construction from absolute timeouts.
Definition at line 129 of file timeout.h.
References absoluteTimeout.
|
inline |
Permit implicit construction from relative timeouts.
Definition at line 134 of file timeout.h.
References relativeTimeout.
|
inline |
If this is a relative timeout, elapse the specified number of ticks.
Otherwise, do nothing.
Definition at line 259 of file timeout.h.
References timeout_elapse().
Referenced by elapse_from().
|
inline |
Take any ticks that have been counted towards source and apply it to destination.
If destination is not a tick-counting relative timeout, do nothing.
This is intended for short-yielding operations, where a compartment wishes to yield for a small amount of time (typically one tick) and then retry some operation, rather than waiting for the whole time that the caller has allowed them to wait. The caller-provided timeout may be relative or absolute, but the timeout for the short sleep is local to the compartment doing the short sleep and so is always a Timeout.
Definition at line 176 of file timeout.h.
References elapse(), and Timeout::elapsed.
Referenced by LockGuard< Lock >::yield().
|
inline |
Returns true if this is a relative timeout, false otherwise.
Definition at line 142 of file timeout.h.
References relativeTimeout.
|
inline |
Returns true if this is a valid timeout, false otherwise.
Definition at line 251 of file timeout.h.
References timeout_is_valid().
|
inline |
Returns true if the timeout is in the future (and therefore may still block), false otherwise.
Definition at line 255 of file timeout.h.
References timeout_may_block().
| AbsoluteMonotonicTimeout __TimeoutArgument::absoluteTimeout |
| Timeout* __TimeoutArgument::relativeTimeout |
A relative timeout.
Definition at line 125 of file timeout.h.
Referenced by __TimeoutArgument(), and is_relative().