Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
Common Types

Fixed-width types and the caller-owned-storage handle pattern. More...

Macros

#define RTE_STORAGE_ALIGN   8U
 Alignment (bytes) guaranteed for every opaque storage block.
#define RTE_ALIGNED_(n)
 Portable alignment specifier used ahead of a storage byte array (e.g. in RTE_DECLARE_STORAGE) so its address is suitable for the OSAdapter's internal struct layout. Expands to the best available mechanism for the compiler (C11 _Alignas, MSVC declspec, or GCC/Clang __attribute); expands to nothing on compilers with no portable alignment control.
#define RTE_DECLARE_STORAGE(type_name, byte_size)
 Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout is private to the OSAdapter implementation; callers only reserve the bytes.

Typedefs

typedef uint32_t rte_duration_ms_t
typedef uint64_t rte_timestamp_ms_t

Detailed Description

Fixed-width types and the caller-owned-storage handle pattern.

Macro Definition Documentation

◆ RTE_STORAGE_ALIGN

#define RTE_STORAGE_ALIGN   8U

Alignment (bytes) guaranteed for every opaque storage block.

Definition at line 36 of file rte_types.h.

◆ RTE_ALIGNED_

#define RTE_ALIGNED_ ( n)

Portable alignment specifier used ahead of a storage byte array (e.g. in RTE_DECLARE_STORAGE) so its address is suitable for the OSAdapter's internal struct layout. Expands to the best available mechanism for the compiler (C11 _Alignas, MSVC declspec, or GCC/Clang __attribute); expands to nothing on compilers with no portable alignment control.

Parameters
nRequested alignment in bytes.

Definition at line 58 of file rte_types.h.

◆ RTE_DECLARE_STORAGE

#define RTE_DECLARE_STORAGE ( type_name,
byte_size )
Value:
typedef struct \
{ \
RTE_ALIGNED_(RTE_STORAGE_ALIGN) \
unsigned char reserved_[(byte_size)]; \
} type_name
#define RTE_STORAGE_ALIGN
Alignment (bytes) guaranteed for every opaque storage block.
Definition rte_types.h:36

Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout is private to the OSAdapter implementation; callers only reserve the bytes.

Usage: RTE_DECLARE_STORAGE(rte_timer_storage_t, 64U);

Definition at line 69 of file rte_types.h.

Typedef Documentation

◆ rte_duration_ms_t

typedef uint32_t rte_duration_ms_t

Milliseconds, used by all timer/deadline related APIs.

Definition at line 27 of file rte_types.h.

◆ rte_timestamp_ms_t

typedef uint64_t rte_timestamp_ms_t

Monotonic timestamp in milliseconds since an arbitrary epoch.

Definition at line 30 of file rte_types.h.