OpenCores
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 302 to Rev 301
    Reverse comparison

Rev 302 → Rev 301

/taskmgr/taskmgr_const.s
223,8 → 223,8
Flag DB ; Single-byte flag variable for returning semaphores
.ENDST
 
.DEFINE TSB_SIZE 2 * TASK_COUNT
.DEFINE FREE_SYS WP_Rgn_Size - 8 - TSB_SIZE
.DEFINE TSB_SIZE 2 * TASK_COUNT
.DEFINE FREE_SYS 124 - TSB_SIZE
 
.STRUCT str_taskman
This_Task DB ; Holds the task number of the current task
231,10 → 231,6
Next_Task DB ; Specifieds which task to be executed next
Fault_Flag DB ; Memory write fault flag
Fault_Task DB ; Task active/responsible for write fault
Temp_R0 DB ; Temp storage for R0
Temp_R1 DB ; Temp storage for R1
Temp_R2 DB ; Temp storage for R2
Temp_R3 DB ; Temp storage for R3
Task_Stacks DSB TSB_SIZE ; First location for stack data*
Free_Mem DSB FREE_SYS ; Unused memory in system region
.ENDST
937,22 → 933,17
; ISR/Supervisory Mode Functions - Allows tasks to define up to 5 functions
; that will operate in supervisor mode by calling a soft-int.
;
; Note 1: that using these functions requires at least 5 free bytes of stack
;
; Note 2: Due to assembler limitations, it is actually necessary for each task
; Note 1: Due to assembler limitations, it is actually necessary for each task
; to define all 5 sets of these macros, even if not used. These are defined
; in the pattern of TASKx_SPV_FUNCy, where x is the task number and
; y is the function 0-4.
;
; Note 3: Task code for these functions should NOT use RTS or RTI, as this WILL
; Note 2: Task code for these functions should NOT use RTS or RTI, as this WILL
; corrupt their stacks and likely crash the whole system. These are intended
; for operations that are atomic in nature, or that require supervisor perms
; due to write access (writing flags/messages to other tasks) Registers will
; be preserved in local system memory and restored prior to entering the stub
; effectively meaning that registers will retain their state through the
; function call. The state of system flags will NOT be retained, however.
; due to write access (writing flags/messages to other tasks)
;
; Note 4: These functions will run to completion (or hang) regardless of the
; Note 3: These functions will run to completion (or hang) regardless of the
; task timer, as interrupts can't pre-empt each other, so caution should be
; used with them. However, both the internal and external interrupt managers
; will latch incoming interrupts while these are running.
962,10 → 953,7
; referenced in the ISR table. (EXEC_SUPVn is used in the interrupt table)
 
.MACRO CREATE_SUPV_FUNC
EXEC_SUPV\@: STA R0, TaskMgr.Temp_R0 ; Copy R0-R3 to local RAM, not stack
STA R1, TaskMgr.Temp_R1
STA R2, TaskMgr.Temp_R2
STA R3, TaskMgr.Temp_R3
EXEC_SUPV\@: BACKUP_FULL_CONTEXT
 
REINIT_TASK_TABLE_PTR ; Setup R3:R2 to point to the task table
 
975,16 → 963,10
LDO R2, SUPV_FN\@_ENTRY_LOW
PSH R0
 
LDA R3, TaskMgr.Temp_R3 ; Replace R0-R3 from local RAM so that
LDA R2, TaskMgr.Temp_R2 ; the stub has the same register space
LDA R1, TaskMgr.Temp_R1 ; as a function call - less the flag
LDA R0, TaskMgr.Temp_R0 ; state, which isn't preserved
 
RTS ; Use RTS to "return" to our jump addr
 
.REPEAT TASK_COUNT ; Create a stub for each task. The final
CREATE_F\@_FUNCTION_STUB ; RTI will be handled in the stubs
.ENDR
_F\@_EXIT: RESTORE_FULL_CONTEXT
RTI
.ENDM
 
; CREATE_Fn_FUNCTION_STUB creates an entry point that is referenced in the
994,28 → 976,28
; disrupting the stack. (These aren't technically subroutines)
 
.MACRO CREATE_F0_FUNCTION_STUB
_F0_EXE_S\@: TASK\@_SUPV_FN0 ; Run the stub code from the task
RTI ; Return from the interrupt
_F0_EXE_S\@: TASK\@_SUPV_FN0
JMP _F0_EXIT
.ENDM
 
.MACRO CREATE_F1_FUNCTION_STUB
_F1_EXE_S\@: TASK\@_SUPV_FN1 ; Run the stub code from the task
RTI ; Return from the interrupt
_F1_EXE_S\@: TASK\@_SUPV_FN1
JMP _F1_EXIT
.ENDM
 
.MACRO CREATE_F2_FUNCTION_STUB
_F2_EXE_S\@: TASK\@_SUPV_FN2 ; Run the stub code from the task
RTI ; Return from the interrupt
_F2_EXE_S\@: TASK\@_SUPV_FN2
JMP _F2_EXIT
.ENDM
 
.MACRO CREATE_F3_FUNCTION_STUB
_F3_EXE_S\@: TASK\@_SUPV_FN3 ; Run the stub code from the task
RTI ; Return from the interrupt
_F3_EXE_S\@: TASK\@_SUPV_FN3
JMP _F3_EXIT
.ENDM
 
.MACRO CREATE_F4_FUNCTION_STUB
_F4_EXE_S\@: TASK\@_SUPV_FN4 ; Run the stub code from the task
RTI ; Return from the interrupt
_F4_EXE_S\@: TASK\@_SUPV_FN4
JMP _F4_EXIT
.ENDM
 
; INSTANCE_SUPV_FUNCS creates all 5 supervisory function entry points and a set
1024,6 → 1006,14
.REPEAT 5
CREATE_SUPV_FUNC
.ENDR
 
.REPEAT TASK_COUNT
CREATE_F0_FUNCTION_STUB
CREATE_F1_FUNCTION_STUB
CREATE_F2_FUNCTION_STUB
CREATE_F3_FUNCTION_STUB
CREATE_F4_FUNCTION_STUB
.ENDR
.ENDM
 
;------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.