ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
pipe.h
Go to the documentation of this file.
1
16#ifndef ICARUS_PIPE_H
17#define ICARUS_PIPE_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <stdint.h>
24#include <stdbool.h>
25
26/* ============================================================================
27 * MESSAGE PIPE API
28 * ========================================================================= */
29
36bool pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes);
37
47bool pipe_enqueue(uint8_t pipe_idx, uint8_t* message, uint8_t message_bytes);
48
58bool pipe_dequeue(uint8_t pipe_idx, uint8_t* message, uint8_t message_bytes);
59
65uint16_t pipe_get_count(uint8_t pipe_idx);
66
72uint16_t pipe_get_max_count(uint8_t pipe_idx);
73
74/* ============================================================================
75 * SVC CALL GATES (MPU Protection)
76 * ========================================================================= */
77
85bool pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes);
86
94bool pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes);
95
104void pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes);
105
114void pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes);
115
116/* ============================================================================
117 * PRIVILEGED IMPLEMENTATIONS (Internal - Do Not Call Directly)
118 * ========================================================================= */
119
120bool __pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes);
121bool __pipe_enqueue(uint8_t pipe_idx, uint8_t* message, uint8_t message_bytes);
122bool __pipe_dequeue(uint8_t pipe_idx, uint8_t* message, uint8_t message_bytes);
123uint16_t __pipe_get_count(uint8_t pipe_idx);
124uint16_t __pipe_get_max_count(uint8_t pipe_idx);
125bool __pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes);
126bool __pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes);
127void __pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes);
128void __pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes);
129
130#ifdef __cplusplus
131}
132#endif
133
134#endif /* ICARUS_PIPE_H */
uint16_t pipe_get_max_count(uint8_t pipe_idx)
Get pipe capacity.
Definition svc.c:921
uint16_t __pipe_get_count(uint8_t pipe_idx)
Privileged implementation of pipe_get_count.
Definition pipe.c:123
bool pipe_enqueue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Enqueue bytes to pipe.
Definition svc.c:887
uint16_t pipe_get_count(uint8_t pipe_idx)
Get current byte count in pipe.
Definition svc.c:901
bool pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes)
Initialize a message pipe.
Definition svc.c:865
void pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Read bytes from pipe (SVC call gate)
Definition svc.c:1095
bool __pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes)
Privileged implementation of pipe_init.
Definition pipe.c:35
uint16_t __pipe_get_max_count(uint8_t pipe_idx)
Privileged implementation of pipe_get_max_count.
Definition pipe.c:135
bool __pipe_enqueue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged implementation of pipe_enqueue.
Definition pipe.c:64
bool __pipe_dequeue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged implementation of pipe_dequeue.
Definition pipe.c:94
bool pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes)
Check if pipe has data available (SVC call gate)
Definition svc.c:1011
bool pipe_dequeue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Dequeue bytes from pipe.
Definition svc.c:894
void __pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged write gate: write bytes to pipe buffer.
Definition pipe.c:176
bool __pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes)
Privileged call gate: can pipe deliver message_bytes bytes?
Definition pipe.c:163
void __pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged write gate: read bytes from pipe buffer.
Definition pipe.c:199
bool pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes)
Check if pipe can accept data (SVC call gate)
Definition svc.c:988
void pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Write bytes to pipe (SVC call gate)
Definition svc.c:1074
bool __pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes)
Privileged call gate: can pipe accept message_bytes bytes?
Definition pipe.c:149