URL
https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk
[/] [open8_urisc/] [trunk/] [taskmgr/] [taskmgr_const.s] - Diff between revs 305 and 306
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 305 |
Rev 306 |
Line 340... |
Line 340... |
|
|
; INITIALIZE_TASK_STACK relocates the CPU stack pointer during setup, then
|
; INITIALIZE_TASK_STACK relocates the CPU stack pointer during setup, then
|
; simulates an RTI by loading an initial flag and return address, then resets
|
; simulates an RTI by loading an initial flag and return address, then resets
|
; all registers to 0
|
; all registers to 0
|
.MACRO INITIALIZE_TASK_STACK
|
.MACRO INITIALIZE_TASK_STACK
|
|
REINIT_TASK_TABLE_PTR ; Use This_Task to initialize R3:R2
|
|
|
; Get the task's starting stack address from the table and load
|
; Get the task's starting stack address from the table and load
|
; it into the CPU SP
|
; it into the CPU SP
|
LDO R2, PARAM_STACK_ADDR_HIGH
|
LDO R2, PARAM_STACK_ADDR_HIGH
|
T0X R1
|
T0X R1
|
LDO R2, PARAM_STACK_ADDR_LOW
|
LDO R2, PARAM_STACK_ADDR_LOW
|
Line 417... |
Line 419... |
; state.
|
; state.
|
.MACRO SETUP_TASK
|
.MACRO SETUP_TASK
|
LDI R0, #\@
|
LDI R0, #\@
|
STA R0, TaskMgr.This_Task ; Write This_Task
|
STA R0, TaskMgr.This_Task ; Write This_Task
|
|
|
REINIT_TASK_TABLE_PTR ; Use This_Task to initialize R3:R2
|
|
INITIALIZE_TASK_STACK ; Setup the new task's stack area
|
INITIALIZE_TASK_STACK ; Setup the new task's stack area
|
SUSPEND_THIS_TASK ; Suspend the task to store setup
|
SUSPEND_THIS_TASK ; Suspend the task to store setup
|
.ENDM
|
.ENDM
|
|
|
; RESTORE_STACK_POINTER uses the This_Task variable to configure R3:R2 as a
|
; RESTORE_STACK_POINTER uses the This_Task variable to configure R3:R2 as a
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.