Go to the documentation of this file.
51 #define STACK_CANARY_WORD (0xE7FEE7FEu)
59 #define PROVIDES_PM_SET_LOWEST
67 #define CORTEXM_SCB_CPACR_FPU_ACCESS_FULL (0x00f00000)
102 #if (defined(CPU_CORE_CORTEX_M33) || defined(CPU_CORE_CORTEX_M4F) || defined(CPU_CORE_CORTEX_M7)) && defined(MODULE_CORTEXM_FPU)
108 #if defined(CPU_CORTEXM_INIT_SUBFUNCTIONS) || defined(DOXYGEN)
140 __asm__ __volatile__(
"mov %0, lr" :
"=r"(lr_ptr));
141 printf(
"%p\n", (
void*) lr_ptr);
163 SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);
166 SCB->SCR &= ~(SCB_SCR_SLEEPDEEP_Msk);
212 __set_MSP(*(uint32_t*)image_address);
218 uint32_t destination_address = *(uint32_t*)image_address;
221 destination_address |= 0x1;
224 __asm(
"BX %0" ::
"r" (destination_address));
229 #if defined(CPU_CORE_CORTEX_M0PLUS) || defined(CPU_CORE_CORTEX_M23) || \
230 defined(CPU_CORE_CORTEX_M3) || defined(CPU_CORE_CORTEX_M33) || \
231 defined(CPU_CORE_CORTEX_M4) || defined(CPU_CORE_CORTEX_M4F) || \
232 defined(CPU_CORE_CORTEX_M7)
233 static inline uint32_t cpu_get_image_baseaddr(
void)
static void cortexm_init_fpu(void)
Initialize Cortex-M FPU.
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
static void cortexm_sleep_until_event(void)
Put the CPU into the 'wait for event' sleep mode.
void thread_yield_higher(void)
Lets current thread yield in favor of a higher prioritized thread.
Scheduler API definition.
static void cortexm_isr_end(void)
Trigger a conditional context scheduler run / context switch.
bool cpu_check_address(volatile const char *address)
Checks is memory address valid or not.
void cortexm_init_isr_priorities(void)
Initialize Cortex-M interrupt priorities.
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
volatile unsigned int sched_context_switch_request
Flag indicating whether a context switch is necessary after handling an interrupt.
void cpu_init(void)
Initialization of the CPU.
static void cpu_print_last_instruction(void)
Prints the current content of the link register (lr)
void cortexm_init(void)
Initialize Cortex-M specific core parts of the CPU.
static void cortexm_sleep(int deep)
Put the CPU into (deep) sleep mode, using the WFI instruction.
#define CORTEXM_SCB_CPACR_FPU_ACCESS_FULL
Pattern to write into the co-processor Access Control Register to allow full FPU access.
static void cpu_jump_to_image(uint32_t image_address)
Jumps to another image in flash.
void cortexm_init_misc(void)
Initialize Cortex-M misc functions.