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
task.h
Go to the documentation of this file.
1
16#ifndef ICARUS_TASK_H
17#define ICARUS_TASK_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <stdint.h>
24#include "icarus/types.h"
25
26/* ============================================================================
27 * TASK CREATION
28 * ========================================================================= */
29
35void os_register_task(void (*function)(void), const char *name);
36
45void os_create_task(icarus_task_t *task, void (*function)(void),
46 uint32_t *stack, uint32_t stack_size,
47 uint32_t *data, const char *name);
48
49/* ============================================================================
50 * TASK LIFECYCLE
51 * ========================================================================= */
52
57void os_exit_task(void);
58
63void os_kill_process(uint8_t task_index);
64
68void os_task_suicide(void);
69
81void os_restart_task(uint8_t task_index);
82
83/* ============================================================================
84 * PRIVILEGED IMPLEMENTATIONS (Internal - Do Not Call Directly)
85 * ========================================================================= */
86
87void __os_register_task(void (*function)(void), const char *name);
88void __os_exit_task(void);
89void __os_kill_process(uint8_t task_index);
90void __os_task_suicide(void);
91void __os_restart_task(uint8_t task_index);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* ICARUS_TASK_H */
Task Control Block (TCB)
Definition types.h:115
void os_create_task(icarus_task_t *task, void(*function)(void), uint32_t *stack, uint32_t stack_size, uint32_t *data, const char *name)
Create a task with explicit stack allocation.
Definition task.c:27
void os_task_suicide(void)
Terminate current task (suicide)
Definition svc.c:647
void __os_kill_process(uint8_t task_index)
Privileged implementation of os_kill_process.
Definition task.c:110
void __os_exit_task(void)
Privileged implementation of os_exit_task.
Definition task.c:90
void __os_restart_task(uint8_t task_index)
Privileged implementation of os_restart_task.
Definition task.c:154
void __os_register_task(void(*function)(void), const char *name)
Privileged implementation of os_register_task.
Definition task.c:74
void os_exit_task(void)
Terminate current task normally.
Definition svc.c:636
void os_kill_process(uint8_t task_index)
Terminate another task by index.
Definition svc.c:676
void os_restart_task(uint8_t task_index)
Restart a killed or finished task (cold restart from entry point).
Definition svc.c:693
void __os_task_suicide(void)
Privileged implementation of os_task_suicide.
Definition task.c:136
void os_register_task(void(*function)(void), const char *name)
Register a task with automatic stack allocation.
Definition svc.c:658
ICARUS OS Core Type Definitions.