tinykernel
読み取り中…
検索中…
一致する文字列を見つけられません
port_m33.h
[詳解]
1#pragma once
2
3#include <stdint.h>
4
5#include "hardware/structs/scb.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11// One-time port setup: FPU context policy + SysTick + PendSV priority. Called from tk::start().
12void tk_port_init(uint32_t ticks_per_sec);
13
14// Build a task's initial stack frame. Returns the SP to start with.
15uintptr_t tk_port_make_frame(uint8_t* base, uint32_t size_bytes, void* entry_fn, void* arg);
16
17// Jump into the first task (r0 = SP from tk_port_make_frame). Never returns.
18void tk_port_start(uintptr_t sp);
19
20// Trigger a PendSV exception to initiate context switching.
21static inline void tk_port_trigger_pendsv(void) {
22 scb_hw->icsr = 1u << 28; // SCB_ICSR_PENDSVSET_Msk
23 __asm__ volatile("isb" ::: "memory");
24}
25
26#ifdef __cplusplus
27}
28#endif
void tk_port_init(uint32_t ticks_per_sec)
定義 port_m33.c:14
uintptr_t tk_port_make_frame(uint8_t *base, uint32_t size_bytes, void *entry_fn, void *arg)
void tk_port_start(uintptr_t sp)