Update the NIOSII port to enable longer jumps (#578)

Update the NIOSII port so it works on systems with more RAM as
per https://forums.freertos.org/t/nios-ii-r-nios2-call26-noat-linker-error/16028
This commit is contained in:
RichardBarry 2022-10-19 22:04:53 -07:00 committed by GitHub
parent 4e2bf2c639
commit d7b712668d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,12 +76,12 @@ save_sp_to_pxCurrentTCB:
ldw et, (et) # Load the value of the pxCurrentTCB pointer
stw sp, (et) # Store the stack pointer into the top of the TCB
br irq_test_user # skip the section .exceptions.entry
br irq_test_user # skip the section .exceptions.entry
.section .exceptions.irqtest, "xa"
.section .exceptions.irqtest, "xa"
irq_test_user:
.section .exceptions.exit.user, "xa"
.section .exceptions.exit.user, "xa"
restore_sp_from_pxCurrentTCB:
movia et, pxCurrentTCB # Load the address of the pxCurrentTCB pointer
ldw et, (et) # Load the value of the pxCurrentTCB pointer
@ -120,7 +120,7 @@ restore_context:
ldw fp, 112(sp)
addi sp, sp, 116 # Release stack space
eret # Return to address ea, loading eStatus into Status.
eret # Return to address ea, loading eStatus into Status.
.section .exceptions.soft, "xa"
soft_exceptions:
@ -131,7 +131,8 @@ soft_exceptions:
call_scheduler:
stw ea, 72(sp) # EA is PC+4 so will skip over instruction causing exception
call vTaskSwitchContext # Pick the next context.
movia r15, vTaskSwitchContext # Pick the next context - use long call version in place of "call"
callr r15
br restore_sp_from_pxCurrentTCB # Switch in the task context and restore.
.section .exceptions.unknown.user