改函数最终会返回线程栈顶指针stk, 在线程栈初始化函数中,定义了struct stack_frame 类型的结构体指针stack_frame,改结构体类型具体如下: struct exception_stack_frame
{
/*异常发生时自动加载CPU寄存器的内容*/
rt_uint32_t r0;
rt_uint32_t r1;
rt_uint32_t r2;
rt_uint32_t r3;
rt_uint32_t r12;
rt_uint32_t lr;
rt_uint32_t pc;
rt_uint32_t psr;
};
struct stack_frame
{
/*异常发生时需要手动加载CPU寄存器的内容*/
rt_uint32_t r4;
rt_uint32_t r5;
rt_uint32_t r6;
rt_uint32_t r7;
rt_uint32_t r8;
rt_uint32_t r9;
rt_uint32_t r10;
rt_uint32_t r11;
struct exception_stack_frame exception_stack_frame;
};
|