OSStartHang NOP B OSStartHang ;Should never get here
OSPendSV MRS R0, PSP ; PSP is process stack pointer ;CBZ R0, OSPendSV_nosave ; skip register save the first time
SUBS R0, R0, #0x20 ; save remaining regs r4-11 on process stack STM R0, {R4-R11}
LDR R1, __OS_TCBCur ; OSTCBCur->OSTCBStkPtr = SP; LDR R1, [R1] STR R0, [R1] ; R0 is SP of process being switched out
; at this point, entire context of process has been saved OSPendSV_nosave PUSH {R14} ; need to save LR exc_return value LDR R0, __OS_TaskSwHook ; OSTaskSwHook(); BLX R0 POP {R14}
LDR R0, [R2] ; R0 is new process SP; SP = OSTCBHighRdy->OSTCBStkPtr; LDM R0, {R4-R11} ; restore r4-11 from new process stack ADDS R0, R0, #0x20 MSR PSP, R0 ; load PSP with new process SP ;ORR LR, LR, #0x04 ; ensure exception return uses process stack BX LR
例子例说明用2.85的ucos,我把ucos拷进去,可是还是有错误, 哪位高手帮着看一下,郁闷, ..osos_core.c(592): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_core.c(592): error: #20: identifier "OS_STAT_PEND_TO" is undefined ..osos_core.c(594): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_core.c(594): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_core.c(677): error: #147-D: declaration is incompatible with "INT8U OS_EventTaskRdy(OS_EVENT *, void *, INT8U)" (declared at line 1155 of "..osucos_ii.h") ..osos_core.c(728): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_core.c(794): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_core.c(794): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_core.c(1554): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_core.c(1554): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_core.c(1628): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_core.c(1631): error: #20: identifier "OS_ERR_TASK_NO_MORE_TCB" is undefined ..osos_mbox.c(201): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(212): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_mbox.c(226): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(310): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(314): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_mbox.c(314): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_mbox.c(320): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_mbox.c(321): error: #136: struct "os_tcb" has no field "OSTCBStatPend" ..osos_mbox.c(325): error: #20: identifier "OS_STAT_PEND_TO" is undefined ..osos_mbox.c(327): error: #20: identifier "OS_ERR_TIMEOUT" is undefined ..osos_mbox.c(330): error: #20: identifier "OS_STAT_PEND_ABORT" is undefined ..osos_mbox.c(331): error: #20: identifier "OS_ERR_PEND_ABORT" is undefined ..osos_mbox.c(341): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(474): error: #20: identifier "OS_STAT_PEND_OK" is undefined ..osos_mbox.c(477): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(481): error: #20: identifier "OS_ERR_MBOX_FULL" is undefined ..osos_mbox.c(485): error: #20: identifier "OS_ERR_NONE" is undefined ..osos_mbox.c(546): error: #20: identifier "OS_STAT_PEND_OK" is undefined
LDR R0, [R2] ; R0 is new process SP; SP = OSTCBHighRdy->OSTCBStkPtr;
;在这里出的错 LDM R0, {R4-R11} ; Restore r4-11 from new process stack ADDS R0, R0, #0x20 MSR PSP, R0 ; Load PSP with new process SP ORR LR, LR, #0x04 ; Ensure exception return uses process stack CPSIE I BX LR ; Exception return will restore remaining context