CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
platform-time.h File Reference

` 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

uint64_t platform_monotonic_time_read ()
 Platform-specific hook for reading the current monotonic time.

Detailed Description

` 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.

Macro Definition Documentation

◆ CHERIOT_PLATFORM_TIME_HIGH

#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 platform_monotonic_time_read().

◆ CHERIOT_PLATFORM_TIME_LOW

#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 platform_monotonic_time_read().

Function Documentation

◆ platform_monotonic_time_read()

uint64_t platform_monotonic_time_read ( )
inline

Platform-specific hook for reading the current monotonic time.

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.

Definition at line 38 of file platform-time.h.

References CHERIOT_PLATFORM_TIME_HIGH, CHERIOT_PLATFORM_TIME_LOW, and platform_monotonic_time_read().

Referenced by clock(), and platform_monotonic_time_read().