Release 6.1.9
This commit is contained in:
@@ -8,74 +8,67 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
|
||||
.equ BTA, 0x412
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_restore ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.9 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function restores the interrupt context if it is processing a */
|
||||
;/* nested interrupt. If not, it returns to the interrupt thread if no */
|
||||
;/* preemption is necessary. Otherwise, if preemption is necessary or */
|
||||
;/* if no thread was running, the function returns to the scheduler. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule Thread scheduling routine */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ISRs Interrupt Service Routines */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function restores the interrupt context if it is processing a */
|
||||
;/* nested interrupt. If not, it returns to the interrupt thread if no */
|
||||
;/* preemption is necessary. Otherwise, if preemption is necessary or */
|
||||
;/* if no thread was running, the function returns to the scheduler. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule Thread scheduling routine */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ISRs Interrupt Service Routines */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 10-15-2021 Andres Mlinar Modified comment(s), and */
|
||||
;/* r25/r30 are caller saved, */
|
||||
;/* use schedule_reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_restore(VOID)
|
||||
;{
|
||||
.global _tx_thread_context_restore
|
||||
.type _tx_thread_context_restore, @function
|
||||
.type _tx_thread_context_restore, @function
|
||||
_tx_thread_context_restore:
|
||||
;
|
||||
; /* Note: it is assumed that the stack pointer is in the same position now as
|
||||
@@ -106,7 +99,7 @@ _tx_thread_context_restore:
|
||||
;
|
||||
; /* Interrupts are nested. */
|
||||
;
|
||||
; /* Just recover the saved registers and return to the point of
|
||||
; /* Just recover the saved registers and return to the point of
|
||||
; interrupt. */
|
||||
;
|
||||
|
||||
@@ -117,10 +110,10 @@ __tx_thread_nested_restore:
|
||||
sr r0, [LP_START] ; Restore LP_START
|
||||
ld r1, [sp, 8] ; Recover LP_END
|
||||
sr r1, [LP_END] ; Restore LP_END
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
mov LP_COUNT, r2
|
||||
.endif
|
||||
|
||||
|
||||
ld r2, [sp, 156] ; Pickup BTA
|
||||
sr r2, [BTA] ; Recover BTA
|
||||
.ifdef TX_ENABLE_ACC
|
||||
@@ -128,6 +121,7 @@ __tx_thread_nested_restore:
|
||||
ld r59, [sp, 144] ; Recover r59
|
||||
.endif
|
||||
ld blink, [sp, 16] ; Recover blink
|
||||
ld r25, [sp, 32] ; Recover r25
|
||||
ld r12, [sp, 84] ; Recover r12
|
||||
ld r11, [sp, 88] ; Recover r11
|
||||
ld r10, [sp, 92] ; Recover r10
|
||||
@@ -140,8 +134,9 @@ __tx_thread_nested_restore:
|
||||
ld r3, [sp, 120] ; Recover r3
|
||||
ld r2, [sp, 124] ; Recover r2
|
||||
ld r1, [sp, 128] ; Recover r1
|
||||
ld r0, [sp, 132] ; Recover r0
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
ld r0, [sp, 132] ; Recover r0
|
||||
ld r30, [sp, 136] ; Recover r30
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
rtie ; Return from interrupt
|
||||
;
|
||||
;
|
||||
@@ -149,7 +144,7 @@ __tx_thread_nested_restore:
|
||||
__tx_thread_not_nested_restore:
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
@@ -183,7 +178,7 @@ __tx_thread_no_preempt_restore:
|
||||
sr r0, [LP_START] ; Restore LP_START
|
||||
ld r1, [sp, 8] ; Recover LP_END
|
||||
sr r1, [LP_END] ; Restore LP_END
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
mov LP_COUNT, r2
|
||||
.endif
|
||||
|
||||
@@ -194,6 +189,7 @@ __tx_thread_no_preempt_restore:
|
||||
ld r59, [sp, 144] ; Recover r59
|
||||
.endif
|
||||
ld blink, [sp, 16] ; Recover blink
|
||||
ld r25, [sp, 32] ; Recover r25
|
||||
ld r12, [sp, 84] ; Recover r12
|
||||
ld r11, [sp, 88] ; Recover r11
|
||||
ld r10, [sp, 92] ; Recover r10
|
||||
@@ -206,7 +202,8 @@ __tx_thread_no_preempt_restore:
|
||||
ld r3, [sp, 120] ; Recover r3
|
||||
ld r2, [sp, 124] ; Recover r2
|
||||
ld r1, [sp, 128] ; Recover r1
|
||||
ld r0, [sp, 132] ; Recover r0
|
||||
ld r0, [sp, 132] ; Recover r0
|
||||
ld r30, [sp, 136] ; Recover r30
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
rtie ; Return from interrupt
|
||||
;
|
||||
@@ -252,7 +249,6 @@ __tx_software_interrupt_context:
|
||||
st r6, [r7, 0] ; Setup interrupt stack type
|
||||
st fp, [r7, 24] ; Save fp
|
||||
st gp, [r7, 28] ; Save gp
|
||||
st r25, [r7, 32] ; Save r25
|
||||
st r24, [r7, 36] ; Save r24
|
||||
st r23, [r7, 40] ; Save r23
|
||||
st r22, [r7, 44] ; Save r22
|
||||
@@ -265,7 +261,6 @@ __tx_software_interrupt_context:
|
||||
st r15, [r7, 72] ; Save r15
|
||||
st r14, [r7, 76] ; Save r14
|
||||
st r13, [r7, 80] ; Save r13
|
||||
st r30, [r7, 136] ; Save r30
|
||||
__tx_preempt_save_done:
|
||||
;
|
||||
; /* Save the remaining time-slice and disable it. */
|
||||
@@ -294,7 +289,7 @@ __tx_thread_dont_save_ts:
|
||||
sub sp, sp, 8 ; Allocate a small stack frame on the system stack
|
||||
lr r0, [STATUS32] ; Pickup STATUS32
|
||||
st r0, [sp, 4] ; Place on stack
|
||||
mov r0, _tx_thread_schedule ; Build address of scheduler
|
||||
mov r0, _tx_thread_schedule_reenter ; Build address of scheduler
|
||||
st r0, [sp, 0] ; Write over the point of interrupt
|
||||
rtie ; Return from interrupt to scheduler
|
||||
;
|
||||
|
||||
@@ -8,73 +8,65 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
|
||||
.equ BTA, 0x412
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_save ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.9 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function saves the context of an executing thread in the */
|
||||
;/* beginning of interrupt processing. The function also ensures that */
|
||||
;/* the system stack is used upon return to the calling ISR. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ISRs */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function saves the context of an executing thread in the */
|
||||
;/* beginning of interrupt processing. The function also ensures that */
|
||||
;/* the system stack is used upon return to the calling ISR. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ISRs */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 10-15-2021 Andres Mlinar Modified comment(s), and */
|
||||
;/* r25/r30 are caller saved, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_save(VOID)
|
||||
;{
|
||||
.global _tx_thread_context_save
|
||||
.type _tx_thread_context_save, @function
|
||||
.type _tx_thread_context_save, @function
|
||||
_tx_thread_context_save:
|
||||
;
|
||||
; /* Upon entry to this routine, it is assumed that an interrupt stack frame
|
||||
@@ -103,6 +95,8 @@ _tx_thread_context_save:
|
||||
; calling ISR. */
|
||||
;
|
||||
__tx_thread_nested_save: ; Label is for special nested interrupt case from idle system save below
|
||||
st r30, [sp, 136] ; Save r30
|
||||
st r25, [sp, 32] ; Save r25
|
||||
st r12, [sp, 84] ; Save r12
|
||||
st r11, [sp, 88] ; Save r11
|
||||
st r10, [sp, 92] ; Save r10
|
||||
@@ -111,7 +105,7 @@ __tx_thread_nested_save: ; Label is for special n
|
||||
st r7, [sp, 104] ; Save r7
|
||||
st r6, [sp, 108] ; Save r6
|
||||
st r5, [sp, 112] ; Save r5
|
||||
st r4, [sp, 116] ; Save r6
|
||||
st r4, [sp, 116] ; Save r4
|
||||
lr r10, [LP_START] ; Pickup LP_START
|
||||
lr r9, [LP_END] ; Pickup LP_END
|
||||
st LP_COUNT, [sp, 12] ; Save LP_COUNT
|
||||
@@ -153,6 +147,8 @@ __tx_thread_not_nested_save:
|
||||
add r0, r0, 1 ; Increment the nested interrupt count
|
||||
st r0, [gp, _tx_thread_system_state@sda] ; Update system state
|
||||
ld r1, [gp, _tx_thread_current_ptr@sda] ; Pickup current thread pointer
|
||||
st r30, [sp, 136] ; Save r30
|
||||
st r25, [sp, 32] ; Save r25
|
||||
st r12, [sp, 84] ; Save r12
|
||||
st r11, [sp, 88] ; Save r11
|
||||
breq r1, 0, __tx_thread_idle_system_save ; If no thread is running, idle system was
|
||||
@@ -196,6 +192,7 @@ __tx_thread_not_nested_save:
|
||||
ld blink, [sp, 16] ; Recover blink
|
||||
add sp, sp, 32 ; Recover the stack space
|
||||
.endif
|
||||
|
||||
;
|
||||
; /* Switch to the system stack. */
|
||||
; sp = _tx_thread_system_stack_ptr;
|
||||
@@ -231,11 +228,11 @@ __tx_thread_idle_system_save:
|
||||
and r1, r0, r1 ; See if there are any other interrupts present
|
||||
brne r0, r1, __tx_thread_nested_save ; If more interrupts, go into the nested interrupt save logic
|
||||
;
|
||||
; /* Not much to do here, just adjust the stack pointer, and return to
|
||||
; /* Not much to do here, just adjust the stack pointer, and return to
|
||||
; ISR processing. */
|
||||
;
|
||||
j_s.d [blink] ; Return to ISR
|
||||
add sp, sp, 160 ; Recover stack space
|
||||
add sp, sp, 160 ; Recover stack space
|
||||
;
|
||||
; }
|
||||
;}
|
||||
|
||||
@@ -8,69 +8,61 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_interrupt_control ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.6 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function is responsible for changing the interrupt lockout */
|
||||
;/* posture of the system. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* new_posture New interrupt lockout posture */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* old_posture Old interrupt lockout posture */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* Application Code */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function is responsible for changing the interrupt lockout */
|
||||
;/* posture of the system. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* new_posture New interrupt lockout posture */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* old_posture Old interrupt lockout posture */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* Application Code */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;UINT _tx_thread_interrupt_control(UINT new_posture)
|
||||
;{
|
||||
.global _tx_thread_interrupt_control
|
||||
.type _tx_thread_interrupt_control, @function
|
||||
.type _tx_thread_interrupt_control, @function
|
||||
_tx_thread_interrupt_control:
|
||||
;
|
||||
; /* Pickup current interrupt lockout posture. */
|
||||
|
||||
@@ -8,70 +8,61 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
|
||||
.equ BTA, 0x412
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.9 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function waits for a thread control block pointer to appear in */
|
||||
;/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
|
||||
;/* in the variable, the corresponding thread is resumed. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function waits for a thread control block pointer to appear in */
|
||||
;/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
|
||||
;/* in the variable, the corresponding thread is resumed. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* _tx_initialize_kernel_enter ThreadX entry function */
|
||||
;/* _tx_thread_system_return Return to system from thread */
|
||||
;/* _tx_thread_context_restore Restore thread's context */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* _tx_initialize_kernel_enter ThreadX entry function */
|
||||
;/* _tx_thread_system_return Return to system from thread */
|
||||
;/* _tx_thread_context_restore Restore thread's context */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 10-15-2021 Andres Mlinar Modified comment(s), */
|
||||
;/* use schedule reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_schedule(VOID)
|
||||
@@ -79,6 +70,15 @@
|
||||
.global _tx_thread_schedule
|
||||
.type _tx_thread_schedule, @function
|
||||
_tx_thread_schedule:
|
||||
|
||||
mov r0, _estack
|
||||
st r0, [gp, _tx_thread_system_stack_ptr@sda] ; Clean the system stack
|
||||
|
||||
.global _tx_thread_schedule_reenter
|
||||
.type _tx_thread_schedule_reenter, @function
|
||||
_tx_thread_schedule_reenter:
|
||||
|
||||
|
||||
;
|
||||
; /* Switch to system stack. */
|
||||
;
|
||||
@@ -100,7 +100,7 @@ __tx_thread_schedule_loop:
|
||||
;
|
||||
; }
|
||||
; while(_tx_thread_execute_ptr == TX_NULL);
|
||||
;
|
||||
;
|
||||
; /* Yes! We have a thread to execute. Lockout interrupts and
|
||||
; transfer control to it. */
|
||||
;
|
||||
@@ -199,10 +199,10 @@ __tx_restore_non_hw_context:
|
||||
ld r15, [sp, 56] ; Recover r15
|
||||
ld r14, [sp, 60] ; Recover r14
|
||||
ld r13, [sp, 64] ; Recover r13
|
||||
ld r1, [sp, 68] ; Pickup status32
|
||||
ld r1, [sp, 68] ; Pickup STATUS32
|
||||
ld r30, [sp, 72] ; Recover r30
|
||||
add sp, sp, 76 ; Recover solicited stack frame
|
||||
j_s.d [blink] ; Return to thread and restore flags
|
||||
add sp, sp, 76 ; Recover solicited stack frame
|
||||
j_s.d [blink] ; Return to thread and restore flags
|
||||
seti r1 ; Recover STATUS32
|
||||
;
|
||||
__tx_thread_schedule_int_ret:
|
||||
@@ -215,10 +215,10 @@ __tx_thread_schedule_int_ret:
|
||||
sr r0, [LP_START] ; Restore LP_START
|
||||
ld r1, [sp, 8] ; Recover LP_END
|
||||
sr r1, [LP_END] ; Restore LP_END
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
ld r2, [sp, 12] ; Recover LP_COUNT
|
||||
mov LP_COUNT, r2
|
||||
.endif
|
||||
|
||||
|
||||
ld r0, [sp, 156] ; Pickup saved BTA
|
||||
sr r0, [BTA] ; Recover BTA
|
||||
ld blink, [sp, 16] ; Recover blink
|
||||
@@ -256,8 +256,8 @@ __tx_thread_schedule_int_ret:
|
||||
ld r58, [sp, 140] ; Recover r58
|
||||
ld r59, [sp, 144] ; Recover r59
|
||||
.endif
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
rtie ; Return to point of interrupt
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
rtie ; Return to point of interrupt
|
||||
;
|
||||
;}
|
||||
;
|
||||
|
||||
@@ -8,70 +8,60 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;
|
||||
;
|
||||
.equ LONG_ALIGN_MASK, 0xFFFFFFFC
|
||||
|
||||
.equ LONG_ALIGN_MASK, 0xFFFFFFFC
|
||||
.equ INT_ENABLE_BITS, 0x8000001E
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_stack_build ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.6 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function builds a stack frame on the supplied thread's stack. */
|
||||
;/* The stack frame results in a fake interrupt return to the supplied */
|
||||
;/* function pointer. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* function pointer. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* thread_ptr Pointer to thread control blk */
|
||||
;/* function_ptr Pointer to return function */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* _tx_thread_create Create thread service */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
|
||||
@@ -80,11 +70,11 @@
|
||||
.type _tx_thread_stack_build, @function
|
||||
_tx_thread_stack_build:
|
||||
;
|
||||
;
|
||||
;
|
||||
; /* Build a fake interrupt frame. The form of the fake interrupt stack
|
||||
; on the ARC HS should look like the following after it is built.
|
||||
; Note that the extension registers are always assigned space here.
|
||||
;
|
||||
;
|
||||
; Stack Top: 1 Interrupt stack frame type
|
||||
; LP_START Initial loop start
|
||||
; LP_END Initial loop end
|
||||
@@ -119,7 +109,7 @@ _tx_thread_stack_build:
|
||||
; r2 Initial r2
|
||||
; r1 Initial r1
|
||||
; r0 Initial r0
|
||||
; r30 Initial r30
|
||||
; r30 Initial r30
|
||||
; r58 Initial r58
|
||||
; r59 Initial r59
|
||||
; 0 Reserved
|
||||
@@ -127,10 +117,10 @@ _tx_thread_stack_build:
|
||||
; 0 Initial BTA
|
||||
; 0 Point of Interrupt (thread entry point)
|
||||
; 0 Initial STATUS32
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
; 0 Backtrace
|
||||
;
|
||||
; *: these registers will only be saved and restored if flag -Xxmac_d16 is passed to hcac
|
||||
;
|
||||
@@ -179,19 +169,19 @@ _tx_thread_stack_build:
|
||||
st r5, [r3, 128] ; Store initial r1
|
||||
st r5, [r3, 132] ; Store initial r0
|
||||
st r5, [r3, 136] ; Store initial r30
|
||||
st r5, [r3, 140] ; Store initial r58
|
||||
st r5, [r3, 140] ; Store initial r58
|
||||
st r5, [r3, 144] ; Store initial r59
|
||||
st r5, [r3, 148] ; Reserved
|
||||
st r5, [r3, 152] ; Reserved
|
||||
st r5, [r3, 156] ; Store initial BTA
|
||||
st r1, [r3, 160] ; Store initial point of entry
|
||||
st r1, [r3, 160] ; Store initial point of entry
|
||||
lr r6, [status32] ; Pickup STATUS32
|
||||
or r6, r6, INT_ENABLE_BITS ; Make sure interrupts are enabled
|
||||
st r6, [r3, 164] ; Store initial STATUS32
|
||||
st r5, [r3, 168] ; Backtrace 0
|
||||
st r5, [r3, 172] ; Backtrace 0
|
||||
st r5, [r3, 176] ; Backtrace 0
|
||||
st r5, [r3, 180] ; Backtrace 0
|
||||
st r5, [r3, 168] ; Backtrace 0
|
||||
st r5, [r3, 172] ; Backtrace 0
|
||||
st r5, [r3, 176] ; Backtrace 0
|
||||
st r5, [r3, 180] ; Backtrace 0
|
||||
;
|
||||
; /* Setup stack pointer. */
|
||||
; thread_ptr -> tx_thread_stack_ptr = r3;
|
||||
|
||||
@@ -8,66 +8,58 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Thread */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_system_return ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.1.9 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function is target processor specific. It is used to transfer */
|
||||
;/* control from a thread back to the ThreadX system. Only a */
|
||||
;/* minimal context is saved since the compiler assumes temp registers */
|
||||
;/* are going to get slicked by a function call anyway. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule Thread scheduling loop */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ThreadX components */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function is target processor specific. It is used to transfer */
|
||||
;/* control from a thread back to the ThreadX system. Only a */
|
||||
;/* minimal context is saved since the compiler assumes temp registers */
|
||||
;/* are going to get slicked by a function call anyway. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule_reenter Thread scheduling loop */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* ThreadX components */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 10-15-2021 Andres Mlinar Modified comments, */
|
||||
;/* use schedule reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_system_return(VOID)
|
||||
@@ -160,7 +152,7 @@ __tx_thread_dont_save_ts:
|
||||
; /* Clear the current thread pointer. */
|
||||
; _tx_thread_current_ptr = TX_NULL;
|
||||
;
|
||||
b.d _tx_thread_schedule ; Return to scheduler..
|
||||
b.d _tx_thread_schedule_reenter ; Return to the scheduler
|
||||
st r3, [gp, _tx_thread_current_ptr@sda] ; ..clearing current thread pointer
|
||||
;
|
||||
;}
|
||||
|
||||
@@ -8,67 +8,56 @@
|
||||
;/* and in the root directory of this software. */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** ThreadX Component */
|
||||
;/** */
|
||||
;/** Timer */
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_timer.h"
|
||||
;#include "tx_thread.h"
|
||||
;
|
||||
;
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_timer_interrupt ARC_HS/MetaWare */
|
||||
;/* 6.1.3 */
|
||||
;/* 6.1.9 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
;/* */
|
||||
;/* DESCRIPTION */
|
||||
;/* */
|
||||
;/* This function processes the hardware timer interrupt. This */
|
||||
;/* processing includes incrementing the system clock and checking for */
|
||||
;/* time slice and/or timer expiration. If either is found, the */
|
||||
;/* interrupt context save/restore functions are called along with the */
|
||||
;/* expiration functions. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_timer_expiration_process Process timer expiration */
|
||||
;/* _tx_thread_time_slice Time slice interrupted thread */
|
||||
;/* _tx_thread_context_save Save interrupt context */
|
||||
;/* _tx_thread_context_restore Restore interrupt context */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* interrupt vector */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* */
|
||||
;/* This function processes the hardware timer interrupt. This */
|
||||
;/* processing includes incrementing the system clock and checking for */
|
||||
;/* time slice and/or timer expiration. If either is found, the */
|
||||
;/* interrupt context save/restore functions are called along with the */
|
||||
;/* expiration functions. */
|
||||
;/* */
|
||||
;/* INPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* OUTPUT */
|
||||
;/* */
|
||||
;/* None */
|
||||
;/* */
|
||||
;/* CALLS */
|
||||
;/* */
|
||||
;/* _tx_timer_expiration_process Process timer expiration */
|
||||
;/* _tx_thread_time_slice Time slice interrupted thread */
|
||||
;/* _tx_thread_context_save Save interrupt context */
|
||||
;/* _tx_thread_context_restore Restore interrupt context */
|
||||
;/* */
|
||||
;/* CALLED BY */
|
||||
;/* */
|
||||
;/* interrupt vector */
|
||||
;/* */
|
||||
;/* RELEASE HISTORY */
|
||||
;/* */
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@@ -76,12 +65,16 @@
|
||||
;/* unneeded load of */
|
||||
;/* _tx_thread_preempt_disable, */
|
||||
;/* resulting in version 6.1.3 */
|
||||
;/* 10-15-2021 Yuxin Zhou Modified comment(s), and */
|
||||
;/* fixed possible race */
|
||||
;/* condition on preemption */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_timer_interrupt(VOID)
|
||||
;{
|
||||
.global _tx_timer_interrupt
|
||||
.type _tx_timer_interrupt, @function
|
||||
.type _tx_timer_interrupt, @function
|
||||
_tx_timer_interrupt:
|
||||
;
|
||||
; /* Upon entry to this routine, it is assumed the interrupt stack frame has
|
||||
@@ -132,7 +125,7 @@ __tx_timer_no_time_slice:
|
||||
;
|
||||
ld r0, [gp, _tx_timer_current_ptr@sda] ; Pickup current timer pointer
|
||||
ld r2, [r0, 0] ; Pickup examine actual list entry
|
||||
breq r2, 0, __tx_timer_no_timer ;
|
||||
breq r2, 0, __tx_timer_no_timer ;
|
||||
; If NULL, no timer has expired, just move to the next entry
|
||||
;
|
||||
; /* Set expiration flag. */
|
||||
@@ -175,6 +168,10 @@ __tx_timer_done:
|
||||
; /* See if anything has expired. */
|
||||
; if ((_tx_timer_expired_time_slice) || (_tx_timer_expired))
|
||||
; {
|
||||
;
|
||||
ld r0, [gp, _tx_thread_current_ptr@sda]
|
||||
ld r2, [gp, _tx_thread_execute_ptr@sda]
|
||||
brne r0, r2, __tx_something_expired
|
||||
;
|
||||
breq r1, 0, __tx_timer_nothing_expired ; If 0, nothing has expired
|
||||
;
|
||||
@@ -220,7 +217,7 @@ __tx_timer_dont_activate:
|
||||
;
|
||||
__tx_timer_not_ts_expiration:
|
||||
;
|
||||
st 0, [gp, _tx_timer_expired_time_slice@sda]
|
||||
st 0, [gp, _tx_timer_expired_time_slice@sda]
|
||||
b _tx_thread_context_restore ; Go restore interrupt context..
|
||||
; ..clearing time-slice expired flag
|
||||
; Note that we don't return from
|
||||
@@ -233,9 +230,9 @@ __tx_timer_nothing_expired:
|
||||
ld r0, [sp, 0] ; Recover r0
|
||||
ld r1, [sp, 4] ; Recover r1
|
||||
ld r2, [sp, 8] ; Recover r2
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
add sp, sp, 160 ; Recover interrupt stack frame
|
||||
rtie ; Return to point of interrupt
|
||||
;
|
||||
;}
|
||||
.end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user