URL
https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk
Subversion Repositories open8_urisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/open8_urisc/trunk
- from Rev 304 to Rev 305
- ↔ Reverse comparison
Rev 304 → Rev 305
/taskmgr/taskmgr_const.s
338,18 → 338,10
T0X R3 |
.ENDM |
|
; SETUP_TASK is a template used to generate code that sets up a single task's |
; stack and stack pointer for each a task. This macros will temporarily |
; relocate the stack pointer, push the task's initial state to the task's |
; stack. Note that it is important to also ensure that the stack has data to |
; not only restore the return address, but also R7:R0, as well as the flag |
; state. |
.MACRO SETUP_TASK |
LDI R0, #\@ |
STA R0, TaskMgr.This_Task ; Write This_Task |
|
REINIT_TASK_TABLE_PTR ; Use This_Task to initialize R3:R2 |
|
; INITIALIZE_TASK_STACK relocates the CPU stack pointer during setup, then |
; simulates an RTI by loading an initial flag and return address, then resets |
; all registers to 0 |
.MACRO INITIALIZE_TASK_STACK |
; Get the task's starting stack address from the table and load |
; it into the CPU SP |
LDO R2, PARAM_STACK_ADDR_HIGH |
383,21 → 375,8
T0X R5 |
T0X R6 |
T0X R7 |
|
; Once the task's initial state has been created, "suspend" |
; the task. This will effective initialize its state and |
; SP pointer |
SUSPEND_THIS_TASK |
.ENDM |
|
; SUSPEND_THIS_TASK pushes all of the registers to a task's stack, then |
; backups up the stack pointer to the system memory backup location for that |
; task. |
.MACRO SUSPEND_THIS_TASK |
BACKUP_FULL_CONTEXT |
BACKUP_STACK_POINTER |
.ENDM |
|
; BACKUP_STACK_POINTER uses the This_Task variable to configure R3:R2 as a |
; pointer into the system memory where stack pointer backups are stored, then |
; obtains the current stack address and pushes it to the task's backup |
422,6 → 401,29
STO R2,1 |
.ENDM |
|
; SUSPEND_THIS_TASK pushes all of the registers to a task's stack, then |
; backups up the stack pointer to the system memory backup location for that |
; task. |
.MACRO SUSPEND_THIS_TASK |
BACKUP_FULL_CONTEXT |
BACKUP_STACK_POINTER |
.ENDM |
|
; SETUP_TASK is a template used to generate code that sets up a single task's |
; stack and stack pointer for each a task. This macros will temporarily |
; relocate the stack pointer, push the task's initial state to the task's |
; stack. Note that it is important to also ensure that the stack has data to |
; not only restore the return address, but also R7:R0, as well as the flag |
; state. |
.MACRO SETUP_TASK |
LDI R0, #\@ |
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 |
SUSPEND_THIS_TASK ; Suspend the task to store setup |
.ENDM |
|
; RESTORE_STACK_POINTER uses the This_Task variable to configure R3:R2 as a |
; pointer into the system memory where stack pointer backups are stored. It |
; then looks up the task's SP backup variable and pushes it back to the CPU SP |