C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches
thread.h
1
15#pragma once
16
17#include <cmrx/api.h>
18#include <arch/sysenter.h>
19#include <stdint.h>
20
25__SYSCALL int CMRX_API(get_tid)();
26
34__SYSCALL int CMRX_API(sched_yield)();
35
53__SYSCALL int CMRX_API(thread_create)(int (*entrypoint)(void *), void * data, uint8_t priority);
54
62__SYSCALL int CMRX_API(thread_join)(int thread);
63
74__SYSCALL int CMRX_API(thread_exit)(int status);
75
85__SYSCALL int CMRX_API(setpriority)(uint8_t priority);
86
87#ifdef CMRX_VERBOSE_API_NAMES
88#define setpriority CMRX_API(setpriority)
89#define thread_join CMRX_API(thread_join)
90#define thread_exit CMRX_API(thread_exit)
91#define thread_create CMRX_API(thread_create)
92#define sched_yield CMRX_API(sched_yield)
93#define get_tid CMRX_API(get_tid)
94#endif
95
__SYSCALL int CMRX_API() get_tid()
Return current thread ID.
Definition thread.c:11
__SYSCALL int CMRX_API() sched_yield()
Give up processor.
Definition thread.c:6
__SYSCALL int CMRX_API() thread_join(int thread)
Wait for other thread to finish.
Definition thread.c:24
__SYSCALL int CMRX_API() thread_exit(int status)
Terminate currently running thread.
Definition thread.c:30
__SYSCALL int CMRX_API() thread_create(int(*entrypoint)(void *), void *data, uint8_t priority)
Create new thread.
Definition thread.c:16
__SYSCALL int CMRX_API() setpriority(uint8_t priority)
Change thread priority.
Definition thread.c:36
#define __SYSCALL
Mark function as syscall entrypoint in userspace.
Definition sysenter.h:14