51#define STACK_CANARY_WORD (0xE7FEE7FEu)
59#define PROVIDES_PM_SET_LOWEST
67#define CORTEXM_SCB_CPACR_FPU_ACCESS_FULL (0x00f00000)
97#if (defined(CPU_CORE_CORTEX_M33) || defined(CPU_CORE_CORTEX_M4F) || defined(CPU_CORE_CORTEX_M7)) && defined(MODULE_CORTEXM_FPU)
103#if defined(CPU_CORTEXM_INIT_SUBFUNCTIONS) || defined(DOXYGEN)
137 __asm__ __volatile__(
"mov %0, lr" :
"=r"(lr_ptr));
160 SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);
163 SCB->SCR &= ~(SCB_SCR_SLEEPDEEP_Msk);
171#if CORTEXM_ISB_REQUIRED_AFTER_WFI
213 __set_MSP(*(uint32_t*)image_address);
219 uint32_t destination_address = *(uint32_t*)image_address;
222 destination_address |= 0x1;
225 __asm(
"BX %0" ::
"r" (destination_address));
230#if defined(CPU_CORE_CORTEX_M0PLUS) || defined(CPU_CORE_CORTEX_M23) || \
231 defined(CPU_CORE_CORTEX_M3) || defined(CPU_CORE_CORTEX_M33) || \
232 defined(CPU_CORE_CORTEX_M4) || defined(CPU_CORE_CORTEX_M4F) || \
233 defined(CPU_CORE_CORTEX_M7)
static uinttxtptr_t cpu_get_caller_pc(void)
Get the last instruction's address.
static uint32_t cpu_get_image_baseaddr(void)
Returns the address of running application in flash.
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
volatile unsigned int sched_context_switch_request
Flag indicating whether a context switch is necessary after handling an interrupt.
THREAD_MAYBE_INLINE void thread_yield_higher(void)
Lets current thread yield in favor of a higher prioritized thread.
void cortexm_init_misc(void)
Initialize Cortex-M misc functions.
static void cortexm_sleep(int deep)
Put the CPU into (deep) sleep mode, using the WFI instruction.
static void cortexm_isr_end(void)
Trigger a conditional context scheduler run / context switch.
static void cpu_jump_to_image(uint32_t image_address)
Jumps to another image in flash.
void cortexm_init(void)
Initialize Cortex-M specific core parts of the CPU.
void cortexm_init_isr_priorities(void)
Initialize Cortex-M interrupt priorities.
#define CORTEXM_SCB_CPACR_FPU_ACCESS_FULL
Pattern to write into the co-processor Access Control Register to allow full FPU access.
static void cortexm_sleep_until_event(void)
Put the CPU into the 'wait for event' sleep mode.
bool cpu_check_address(volatile const char *address)
Checks is memory address valid or not.
static void cortexm_init_fpu(void)
Initialize Cortex-M FPU.
Scheduler API definition.
stdio wrapper to extend the C libs stdio