Skip to content

Commit 8dac70a

Browse files
committed
Add a step to correct the offset
1 parent 5055b65 commit 8dac70a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

portable/CCRH/F1Kx/portasm.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ _vTRAP0_Handler:
209209
; Context switch should be executed at the most outer of interrupt tree.
210210
; In that case, set xPortScheduleStatus to flag context switch in interrupt handler.
211211
jarl _xPortGET_CORE_ID, lp ; return value is contained in r10 (CCRH compiler)
212+
shl 2, r10
212213
mov r10, r11
213-
shl 2, r11
214214
mov #_uxInterruptNesting, r19
215215
add r11, r19
216216
ld.w 0[r19], r18
@@ -309,6 +309,7 @@ _vIrq_Handler_SwitchContext:
309309
; Get Core ID and pass to vTaskSwitchContext as parameter (CCRH compiler)
310310
; The parameter is unused in single core, no problem with this redudant setting
311311
jarl _xPortGET_CORE_ID, lp ; return value is contained in r10 (CCRH compiler)
312+
shl 2, r10 ; Multipy core ID by 4 (size of word) to get the correct offset
312313
mov r10, r6
313314

314315
; vPortYeild may be called to current core again at the end of vTaskSwitchContext.

0 commit comments

Comments
 (0)