C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches
runtime.h
1#pragma once
2
3#include <kernel/rpc.h>
4#include <RTE_Components.h>
5#include CMSIS_device_header
6
7struct OS_thread_t;
8
15#if __FPU_USED
16
17void os_save_fpu_context(struct OS_thread_t * thread);
18void os_load_fpu_context(struct OS_thread_t * thread);
19bool os_fpu_exception_frame(void);
20
21#define os_save_exc_return(thread) thread->arch.exc_return = (uint32_t) __get_LR()
22#define os_load_exc_return(thread) __set_LR((void *) thread->arch.exc_return)
23
24/* Figure out if thread is using FPU.
25 * @return true if thread has FPU active, false otherwise
26 */
27bool os_is_thread_using_fpu(Thread_t thread_id);
28
29/* Implementation of the porting layer API. */
30void os_init_arch(void);
31void os_init_core(unsigned core_id);
32
33#else
34// These functions are not needed if FPU is not enabled, turn them into no-op
35# define os_save_fpu_context(x)
36# define os_load_fpu_context(x)
37# define os_save_exc_return(thread)
38# define os_load_exc_return(thread)
39
40# define os_is_thread_using_fpu(thread) (false)
41# define os_fpu_exception_frame() (false)
42
43
44# define os_init_arch(x)
45# define os_init_core(x)
46#endif
47
48
59#if __FPU_USED
61 uint32_t exc_return;
62#endif
64};
65
66
uint8_t Thread_t
Data type used for thread IDs.
Definition defines.h:72
ARM-specific architecture state of a thread.
Definition runtime.h:58
struct MPU_Registers mpu_stack
Definition runtime.h:63
ARMv6M/ARMv7M MPU registers for one region (base + size model)
Definition mpu.h:26
Thread control block.
Definition runtime.h:72
uint8_t core_id
Core at which this thread is running.
Definition runtime.h:120