|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
` defines the interface for the timer that is used to implement a monotonic clock. More...
#include <cdefs.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | CHERIOT_PLATFORM_TIME_HIGH mcycleh |
| CHERIOT_PLATFORM_TIME_HIGH is a macro that can be defined by platform headers that include this via #include_next. | |
| #define | CHERIOT_PLATFORM_TIME_LOW mcycle |
| CHERIOT_PLATFORM_TIME_LOW is a macro that can be defined by platform headers that include this via #include_next. | |
Functions | |
| __if_c (static) inline uint64_t platform_monotonic_time_read() | |
| Platform-specific hook for reading the current monotonic time. | |
` defines the interface for the timer that is used to implement a monotonic clock.
This is the generic implementation that assumes that the time value is exposed via a CSR. If your board exposes this via an MMIO region then it must provide a different implementation.
Definition in file platform-time.h.
| #define CHERIOT_PLATFORM_TIME_HIGH mcycleh |
CHERIOT_PLATFORM_TIME_HIGH is a macro that can be defined by platform headers that include this via #include_next.
This defines the name for the CSR that provides the top 32 bits of a 64-bit counter.
Definition at line 21 of file platform-time.h.
Referenced by __if_c().
| #define CHERIOT_PLATFORM_TIME_LOW mcycle |
CHERIOT_PLATFORM_TIME_LOW is a macro that can be defined by platform headers that include this via #include_next.
This defines the name for the CSR that provides the top 32 bits of a 64-bit counter.
Definition at line 30 of file platform-time.h.
Referenced by __if_c().
| __if_c | ( | static | ) |
Platform-specific hook for reading the current monotonic time.
Take any ticks that have been counted towards source and apply it to destination.
Returns true if the timeout is in the future (and therefore may still block), false otherwise.
This should be implemented to return the time that increments with the rate defined by the CPU_TIMER_HZ macro and must be the same timer used by the scheduler.
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 38 of file platform-time.h.
References CHERIOT_PLATFORM_TIME_HIGH, and CHERIOT_PLATFORM_TIME_LOW.