📄 portasm.lst
字号:
first item on the stack.
32.8 00000090 ; Load it into the ulCriticalNesting
variable.
32.9 00000090 A0009FE5 LDR R0, =ulCriticalNesting
32.10 00000094 0200BEE8 LDMFD LR!, {R1}
32.11 00000098 001080E5 STR R1, [R0]
32.12 0000009C
32.13 0000009C ; Get the SPSR from the stack.
32.14 0000009C 0100BEE8 LDMFD LR!, {R0}
32.15 000000A0 00F06FE1 MSR SPSR_cxsf, R0
32.16 000000A4
32.17 000000A4 ; Restore all system mode registers for
the task.
32.18 000000A4 FF7FDEE8 LDMFD LR, {R0-R14}^
32.19 000000A8 0000A0E1 NOP
32.20 000000AC
32.21 000000AC ; Restore the return address.
32.22 000000AC 3CE09EE5 LDR LR, [LR, #+60]
32.23 000000B0
32.24 000000B0 ; And return - correcting the offset in
the LR to obtain the
32.25 000000B0 ; correct address.
32.26 000000B0 04F05EE2 SUBS PC, LR, #4
32.27 000000B4
32.28 000000B4 ENDM
33 000000B4
34 000000B4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35 000000B4 ; Preemptive context switch function. This will
only ever get used if
36 000000B4 ; portUSE_PREEMPTION is set to 1 in portmacro.h.
37 000000B4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38 000000B4 vPortPreemptiveTickISR:
39 000000B4 portSAVE_CONTEXT
; Save the context of the current task.
39.1 000000B4
39.2 000000B4 ; Push R0 as we are going to use the
register.
39.3 000000B4 01002DE9 STMDB SP!, {R0}
39.4 000000B8
39.5 000000B8 ; Set R0 to point to the task stack
pointer.
39.6 000000B8 00204DE9 STMDB SP, {SP}^
39.7 000000BC 04D04DE2 SUB SP, SP, #4
39.8 000000C0 0100BDE8 LDMIA SP!, {R0}
39.9 000000C4
39.10 000000C4 ; Push the return address onto the
stack.
39.11 000000C4 004020E9 STMDB R0!, {LR}
39.12 000000C8
39.13 000000C8 ; Now we have saved LR we can use it
instead of R0.
39.14 000000C8 00E0A0E1 MOV LR, R0
39.15 000000CC
39.16 000000CC ; Pop R0 so we can save it onto the
system mode stack.
39.17 000000CC 0100BDE8 LDMIA SP!, {R0}
39.18 000000D0
39.19 000000D0 ; Push all the system mode registers
onto the task stack.
39.20 000000D0 FF7F4EE9 STMDB LR, {R0-LR}^
39.21 000000D4 3CE04EE2 SUB LR, LR, #60
39.22 000000D8
39.23 000000D8 ; Push the SPSR onto the task stack.
39.24 000000D8 00004FE1 MRS R0, SPSR
39.25 000000DC 01002EE9 STMDB LR!, {R0}
39.26 000000E0
39.27 000000E0 50009FE5 LDR R0, =ulCriticalNesting
39.28 000000E4 000090E5 LDR R0, [R0]
39.29 000000E8 01002EE9 STMDB LR!, {R0}
39.30 000000EC
39.31 000000EC ; Store the new top of stack for the
task.
39.32 000000EC 40109FE5 LDR R1, =pxCurrentTCB
39.33 000000F0 000091E5 LDR R0, [R1]
39.34 000000F4 00E080E5 STR LR, [R0]
39.35 000000F8
39.36 000000F8 ENDM
40 000000F8
41 000000F8 40009FE5 LDR R0, =vPortPreemptiveTick ; Increment
the tick
count -
this may
wake a
task.
42 000000FC 0FE0A0E1 MOV lr, pc
43 00000100 10FF2FE1 BX R0
44 00000104
45 00000104 portRESTORE_CONTEXT
; Restore the context of the selected
task.
45.1 00000104
45.2 00000104 ; Set the LR to the task stack.
45.3 00000104 28109FE5 LDR R1, =pxCurrentTCB
45.4 00000108 000091E5 LDR R0, [R1]
45.5 0000010C 00E090E5 LDR LR, [R0]
45.6 00000110
45.7 00000110 ; The critical nesting depth is the
first item on the stack.
45.8 00000110 ; Load it into the ulCriticalNesting
variable.
45.9 00000110 20009FE5 LDR R0, =ulCriticalNesting
45.10 00000114 0200BEE8 LDMFD LR!, {R1}
45.11 00000118 001080E5 STR R1, [R0]
45.12 0000011C
45.13 0000011C ; Get the SPSR from the stack.
45.14 0000011C 0100BEE8 LDMFD LR!, {R0}
45.15 00000120 00F06FE1 MSR SPSR_cxsf, R0
45.16 00000124
45.17 00000124 ; Restore all system mode registers for
the task.
45.18 00000124 FF7FDEE8 LDMFD LR, {R0-R14}^
45.19 00000128 0000A0E1 NOP
45.20 0000012C
45.21 0000012C ; Restore the return address.
45.22 0000012C 3CE09EE5 LDR LR, [LR, #+60]
45.23 00000130
45.24 00000130 ; And return - correcting the offset in
the LR to obtain the
45.25 00000130 ; correct address.
45.26 00000130 04F05EE2 SUBS PC, LR, #4
45.27 00000134
45.28 00000134 ENDM
46 00000134
47 00000134
48 00000134 END
48.1 00000134 TABLE
48.2 00000134 ........ Reference on line 18,28,32,39,45
48.3 00000138 ........ Reference on line 18,28,32,39,45
48.4 0000013C ........ Reference on line 29
48.5 00000140 ........ Reference on line 41
48.6 00000144 END (including table)
##############################
# CRC:39B5 #
# Errors: 0 #
# Warnings: 0 #
# Bytes: 324 #
##############################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -