mirror of
https://github.com/azure-rtos/threadx
synced 2025-01-16 07:42:57 +08:00
update RX modules
This commit is contained in:
parent
fd403521e9
commit
db11aba063
@ -26,7 +26,7 @@
|
|||||||
/* PORT SPECIFIC C INFORMATION RELEASE */
|
/* PORT SPECIFIC C INFORMATION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* tx_port.h RXv2/IAR */
|
/* tx_port.h RXv2/IAR */
|
||||||
/* 6.1.9 */
|
/* 6.1.10 */
|
||||||
/* */
|
/* */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
@ -49,9 +49,14 @@
|
|||||||
/* */
|
/* */
|
||||||
/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||||
/* 06-02-2021 William E. Lamie Modified comments, */
|
/* 06-02-2021 William E. Lamie Modified comments, */
|
||||||
/* resulting in version 6.1.7 */
|
/* resulting in version 6.1.7 */
|
||||||
/* 10-15-2021 William E. Lamie Modified comment(s), */
|
/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||||
/* resulting in version 6.1.9 */
|
/* resulting in version 6.1.9 */
|
||||||
|
/* 01-31-2022 William E. Lamie Modified comment(s), removed */
|
||||||
|
/* system state macro, and */
|
||||||
|
/* added missing interrupt */
|
||||||
|
/* control defines, */
|
||||||
|
/* resulting in version 6.1.10 */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
@ -85,6 +90,12 @@ typedef short SHORT;
|
|||||||
typedef unsigned short USHORT;
|
typedef unsigned short USHORT;
|
||||||
|
|
||||||
|
|
||||||
|
/* Define interrupt control options. */
|
||||||
|
|
||||||
|
#define TX_INT_DISABLE 0x00000000
|
||||||
|
#define TX_INT_ENABLE 0x00010000
|
||||||
|
|
||||||
|
|
||||||
/* Define the priority levels for ThreadX. Legal values range
|
/* Define the priority levels for ThreadX. Legal values range
|
||||||
from 32 to 1024 and MUST be evenly divisible by 32. */
|
from 32 to 1024 and MUST be evenly divisible by 32. */
|
||||||
|
|
||||||
@ -263,15 +274,6 @@ static void _tx_thread_system_return_inline(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef TX_THREAD_GET_SYSTEM_STATE
|
|
||||||
|
|
||||||
extern volatile ULONG _tx_thread_system_state;
|
|
||||||
#define TX_THREAD_GET_SYSTEM_STATE() (_tx_thread_system_state | ((~__get_PSW_register()) & (1u << 17u)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Define the interrupt lockout macros for each ThreadX object. */
|
/* Define the interrupt lockout macros for each ThreadX object. */
|
||||||
|
|
||||||
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
|
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
|
||||||
@ -286,7 +288,7 @@ extern volatile ULONG _tx_thread_system_state;
|
|||||||
|
|
||||||
#ifdef TX_THREAD_INIT
|
#ifdef TX_THREAD_INIT
|
||||||
CHAR _tx_version_id[] =
|
CHAR _tx_version_id[] =
|
||||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/IAR Version 6.1.9 *";
|
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/IAR Version 6.1.10 *";
|
||||||
#else
|
#else
|
||||||
extern CHAR _tx_version_id[];
|
extern CHAR _tx_version_id[];
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
;/* FUNCTION RELEASE */
|
;/* FUNCTION RELEASE */
|
||||||
;/* */
|
;/* */
|
||||||
;/* _tx_thread_stack_build RXv2/IAR */
|
;/* _tx_thread_stack_build RXv2/IAR */
|
||||||
;/* 6.1.9 */
|
;/* 6.1.10 */
|
||||||
;/* AUTHOR */
|
;/* AUTHOR */
|
||||||
;/* */
|
;/* */
|
||||||
;/* William E. Lamie, Microsoft Corporation */
|
;/* William E. Lamie, Microsoft Corporation */
|
||||||
@ -65,6 +65,8 @@
|
|||||||
;/* removed unnecessary stack */
|
;/* removed unnecessary stack */
|
||||||
;/* type placement, */
|
;/* type placement, */
|
||||||
;/* resulting in version 6.1.9 */
|
;/* resulting in version 6.1.9 */
|
||||||
|
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||||
|
;/* resulting in version 6.1.10 */
|
||||||
;/* */
|
;/* */
|
||||||
;/**************************************************************************/
|
;/**************************************************************************/
|
||||||
public __tx_thread_stack_build
|
public __tx_thread_stack_build
|
||||||
@ -98,7 +100,7 @@ __tx_thread_stack_build:
|
|||||||
;
|
;
|
||||||
; Stack Bottom: (higher memory address) */
|
; Stack Bottom: (higher memory address) */
|
||||||
;
|
;
|
||||||
MOV.L 16[R1],R3 ; Pickup end of stack area
|
MOV.L 16[R1],R3 ; Pickup end of stack area
|
||||||
BCLR #0, R3 ; Mask for 4-byte alignment
|
BCLR #0, R3 ; Mask for 4-byte alignment
|
||||||
BCLR #1, R3
|
BCLR #1, R3
|
||||||
;
|
;
|
||||||
@ -127,11 +129,11 @@ __tx_thread_stack_build:
|
|||||||
MOV.L R4,[-R3] ; Initial R7 ...
|
MOV.L R4,[-R3] ; Initial R7 ...
|
||||||
MOV.L R4,[-R3] ; Initial R6 ...
|
MOV.L R4,[-R3] ; Initial R6 ...
|
||||||
|
|
||||||
MOV.L R4,[-R3] ; Accumulator 1
|
MOV.L R4,[-R3] ; Accumulator 1
|
||||||
MOV.L R4,[-R3]
|
MOV.L R4,[-R3]
|
||||||
MOV.L R4,[-R3]
|
MOV.L R4,[-R3]
|
||||||
|
|
||||||
MOV.L R4,[-R3] ; Accumulator 0
|
MOV.L R4,[-R3] ; Accumulator 0
|
||||||
MOV.L R4,[-R3]
|
MOV.L R4,[-R3]
|
||||||
MOV.L R4,[-R3]
|
MOV.L R4,[-R3]
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
;/**************************************************************************/
|
;/**************************************************************************/
|
||||||
;/**************************************************************************/
|
;/**************************************************************************/
|
||||||
|
|
||||||
|
SWI0 EQU 0x872E0
|
||||||
|
|
||||||
extern __tx_timer_expiration_process
|
extern __tx_timer_expiration_process
|
||||||
extern __tx_timer_system_clock
|
extern __tx_timer_system_clock
|
||||||
extern __tx_timer_expired_time_slice
|
extern __tx_timer_expired_time_slice
|
||||||
@ -29,6 +31,9 @@
|
|||||||
extern __tx_timer_time_slice
|
extern __tx_timer_time_slice
|
||||||
extern __tx_timer_list_end
|
extern __tx_timer_list_end
|
||||||
extern __tx_thread_time_slice
|
extern __tx_thread_time_slice
|
||||||
|
extern __tx_thread_preempt_disable
|
||||||
|
extern __tx_thread_execute_ptr
|
||||||
|
extern __tx_thread_current_ptr
|
||||||
|
|
||||||
section .text:CODE:ROOT
|
section .text:CODE:ROOT
|
||||||
|
|
||||||
@ -37,7 +42,7 @@
|
|||||||
;/* FUNCTION RELEASE */
|
;/* FUNCTION RELEASE */
|
||||||
;/* */
|
;/* */
|
||||||
;/* _tx_timer_interrupt RXv2/IAR */
|
;/* _tx_timer_interrupt RXv2/IAR */
|
||||||
;/* 6.1.9 */
|
;/* 6.1.10 */
|
||||||
;/* AUTHOR */
|
;/* AUTHOR */
|
||||||
;/* */
|
;/* */
|
||||||
;/* William E. Lamie, Microsoft Corporation */
|
;/* William E. Lamie, Microsoft Corporation */
|
||||||
@ -76,6 +81,10 @@
|
|||||||
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||||
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||||
;/* resulting in version 6.1.9 */
|
;/* resulting in version 6.1.9 */
|
||||||
|
;/* 01-31-2022 William E. Lamie Modified comment(s), and */
|
||||||
|
;/* added missing thread */
|
||||||
|
;/* preemption logic, */
|
||||||
|
;/* resulting in version 6.1.10 */
|
||||||
;/* */
|
;/* */
|
||||||
;/**************************************************************************/
|
;/**************************************************************************/
|
||||||
|
|
||||||
@ -94,38 +103,38 @@ __tx_timer_interrupt:
|
|||||||
PUSHM R14-R15
|
PUSHM R14-R15
|
||||||
PUSHM R1-R5
|
PUSHM R1-R5
|
||||||
|
|
||||||
MOV.L #__tx_timer_system_clock, R1 ; Pickup address of system clock
|
MOV.L #__tx_timer_system_clock, R1 ; Pickup address of system clock
|
||||||
MOV.L [R1], R2 ; Pickup system clock
|
MOV.L [R1], R2 ; Pickup system clock
|
||||||
ADD #1, R2 ; Increment system clock
|
ADD #1, R2 ; Increment system clock
|
||||||
MOV.L R2,[R1] ; Store new system clock
|
MOV.L R2,[R1] ; Store new system clock
|
||||||
;
|
;
|
||||||
; /* Test for time-slice expiration. */
|
; /* Test for time-slice expiration. */
|
||||||
; if (_tx_timer_time_slice)
|
; if (_tx_timer_time_slice)
|
||||||
; {
|
; {
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_time_slice, R1 ; Pickup address of time slice
|
MOV.L #__tx_timer_time_slice, R1 ; Pickup address of time slice
|
||||||
MOV.L [R1], R2 ; Pickup the current time slice
|
MOV.L [R1], R2 ; Pickup the current time slice
|
||||||
CMP #0, R2 ; Is a time slice active?
|
CMP #0, R2 ; Is a time slice active?
|
||||||
BEQ __tx_timer_no_time_slice ; No, skip timer slice processing
|
BEQ __tx_timer_no_time_slice ; No, skip timer slice processing
|
||||||
;
|
;
|
||||||
; /* Decrement the time_slice. */
|
; /* Decrement the time_slice. */
|
||||||
; _tx_timer_time_slice--;
|
; _tx_timer_time_slice--;
|
||||||
;
|
;
|
||||||
SUB #1, R2 ; Decrement the time-slice
|
SUB #1, R2 ; Decrement the time-slice
|
||||||
MOV.L R2, [R1] ; Store time-slice
|
MOV.L R2, [R1] ; Store time-slice
|
||||||
;
|
;
|
||||||
; /* Check for expiration. */
|
; /* Check for expiration. */
|
||||||
; if (__tx_timer_time_slice == 0)
|
; if (__tx_timer_time_slice == 0)
|
||||||
;
|
;
|
||||||
CMP #0, R2 ; Has it expired?
|
CMP #0, R2 ; Has it expired?
|
||||||
BNE __tx_timer_no_time_slice ; No, time-slice has not expired
|
BNE __tx_timer_no_time_slice ; No, time-slice has not expired
|
||||||
;
|
;
|
||||||
; /* Set the time-slice expired flag. */
|
; /* Set the time-slice expired flag. */
|
||||||
; _tx_timer_expired_time_slice = TX_TRUE;
|
; _tx_timer_expired_time_slice = TX_TRUE;
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup address of expired time-slice
|
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup address of expired time-slice
|
||||||
MOV.L #1, R2 ; Build expired value
|
MOV.L #1, R2 ; Build expired value
|
||||||
MOV.L R2, [R1] ; Set expired time slice variable
|
MOV.L R2, [R1] ; Set expired time slice variable
|
||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
__tx_timer_no_time_slice:
|
__tx_timer_no_time_slice:
|
||||||
@ -134,20 +143,20 @@ __tx_timer_no_time_slice:
|
|||||||
; if (*_tx_timer_current_ptr)
|
; if (*_tx_timer_current_ptr)
|
||||||
; {
|
; {
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_current_ptr, R1 ; Pickup address of current timer ptr
|
MOV.L #__tx_timer_current_ptr, R1 ; Pickup address of current timer ptr
|
||||||
MOV.L [R1], R2 ; Pickup current pointer
|
MOV.L [R1], R2 ; Pickup current pointer
|
||||||
MOV.L [R2+], R1 ; Pickup timer list entry, _tx_timer_current_ptr++
|
MOV.L [R2+], R1 ; Pickup timer list entry, _tx_timer_current_ptr++
|
||||||
CMP #0, R1 ; Is timer pointer NULL?
|
CMP #0, R1 ; Is timer pointer NULL?
|
||||||
BEQ __tx_timer_no_timer ; Yes, no timer has expired
|
BEQ __tx_timer_no_timer ; Yes, no timer has expired
|
||||||
|
|
||||||
;
|
;
|
||||||
; /* Set expiration flag. */
|
; /* Set expiration flag. */
|
||||||
; _tx_timer_expired = TX_TRUE;
|
; _tx_timer_expired = TX_TRUE;
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_expired,R2 ; Build address of expired flag
|
MOV.L #__tx_timer_expired,R2 ; Build address of expired flag
|
||||||
MOV.L #1, R1 ; Build expired value
|
MOV.L #1, R1 ; Build expired value
|
||||||
MOV.L R1, [R2]
|
MOV.L R1, [R2]
|
||||||
BRA __tx_timer_done ; Finished with timer processing
|
BRA __tx_timer_done ; Finished with timer processing
|
||||||
;
|
;
|
||||||
; }
|
; }
|
||||||
; else
|
; else
|
||||||
@ -162,17 +171,17 @@ __tx_timer_no_timer:
|
|||||||
; /* Check for wrap-around. */
|
; /* Check for wrap-around. */
|
||||||
; if (_tx_timer_current_ptr == _tx_timer_list_end)
|
; if (_tx_timer_current_ptr == _tx_timer_list_end)
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_list_end, R1 ; Pickup the timer list end ptr
|
MOV.L #__tx_timer_list_end, R1 ; Pickup the timer list end ptr
|
||||||
MOV.L [R1], R1 ; Pickup actual timer list end
|
MOV.L [R1], R1 ; Pickup actual timer list end
|
||||||
CMP R1, R2 ; Are we at list end?
|
CMP R1, R2 ; Are we at list end?
|
||||||
BNE __tx_timer_skip_wrap ; No, don't move pointer to the
|
BNE __tx_timer_skip_wrap ; No, don't move pointer to the
|
||||||
; top of the list
|
; top of the list
|
||||||
;
|
;
|
||||||
; /* Wrap to beginning of list. */
|
; /* Wrap to beginning of list. */
|
||||||
; _tx_timer_current_ptr = _tx_timer_list_start;
|
; _tx_timer_current_ptr = _tx_timer_list_start;
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_list_start, R2 ; Pickup the timer list start ptr
|
MOV.L #__tx_timer_list_start, R2 ; Pickup the timer list start ptr
|
||||||
MOV.L [R2], R2 ; Pickup the start of the list
|
MOV.L [R2], R2 ; Pickup the start of the list
|
||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
__tx_timer_skip_wrap:
|
__tx_timer_skip_wrap:
|
||||||
@ -186,25 +195,25 @@ __tx_timer_done:
|
|||||||
; {
|
; {
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup expired time slice addr
|
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup expired time slice addr
|
||||||
MOV.L [R1], R1 ; Pickup expired time slice
|
MOV.L [R1], R1 ; Pickup expired time slice
|
||||||
MOV.L #__tx_timer_expired, R2 ; Pickup expired timer flag address
|
MOV.L #__tx_timer_expired, R2 ; Pickup expired timer flag address
|
||||||
MOV.L [R2], R2 ; Pickup actual flag
|
MOV.L [R2], R2 ; Pickup actual flag
|
||||||
OR R1, R2 ; Or flags together
|
OR R1, R2 ; Or flags together
|
||||||
BEQ __tx_timer_nothing_expired ; If Z set, nothing has expired
|
BEQ __tx_timer_nothing_expired ; If Z set, nothing has expired
|
||||||
|
|
||||||
__tx_something_expired:
|
__tx_something_expired:
|
||||||
; /* Did a timer expire? */
|
; /* Did a timer expire? */
|
||||||
; if (_tx_timer_expired)
|
; if (_tx_timer_expired)
|
||||||
; {
|
; {
|
||||||
MOV.L #__tx_timer_expired,R1 ; Pickup expired flag address
|
MOV.L #__tx_timer_expired,R1 ; Pickup expired flag address
|
||||||
MOV.L [R1], R1 ; Pickup expired flag
|
MOV.L [R1], R1 ; Pickup expired flag
|
||||||
CMP #0,R1 ; Is the expired timer flag set?
|
CMP #0,R1 ; Is the expired timer flag set?
|
||||||
BEQ __tx_timer_dont_activate ; No, skip timer activation
|
BEQ __tx_timer_dont_activate ; No, skip timer activation
|
||||||
;
|
;
|
||||||
; /* Process timer expiration. */
|
; /* Process timer expiration. */
|
||||||
; _tx_timer_expiration_process();
|
; _tx_timer_expiration_process();
|
||||||
;
|
;
|
||||||
BSR __tx_timer_expiration_process ; Call the timer expiration handling routine
|
BSR __tx_timer_expiration_process ; Call the timer expiration handling routine
|
||||||
;
|
;
|
||||||
; }
|
; }
|
||||||
__tx_timer_dont_activate:
|
__tx_timer_dont_activate:
|
||||||
@ -214,14 +223,31 @@ __tx_timer_dont_activate:
|
|||||||
; {
|
; {
|
||||||
;
|
;
|
||||||
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup time-slice expired flag addr
|
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup time-slice expired flag addr
|
||||||
MOV.L [R1], R1 ; Pickup actual flag
|
MOV.L [R1], R1 ; Pickup actual flag
|
||||||
CMP #0,R1 ; Has time-slice expired?
|
CMP #0,R1 ; Has time-slice expired?
|
||||||
BEQ __tx_timer_not_ts_expiration ; No, skip time-slice expiration
|
BEQ __tx_timer_not_ts_expiration ; No, skip time-slice expiration
|
||||||
;
|
;
|
||||||
; /* Time slice interrupted thread. */
|
; /* Time slice interrupted thread. */
|
||||||
; _tx_thread_time_slice();
|
; _tx_thread_time_slice();
|
||||||
|
|
||||||
BSR __tx_thread_time_slice ; Call time-slice processing
|
BSR __tx_thread_time_slice ; Call time-slice processing
|
||||||
|
|
||||||
|
; /* Check if we must trigger a context switch. */
|
||||||
|
MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag.
|
||||||
|
MOV.L [R1], R1
|
||||||
|
CMP #0, R1
|
||||||
|
BNE __tx_timer_not_ts_expiration ; Skip if prempt disabled.
|
||||||
|
|
||||||
|
MOV.L #__tx_thread_execute_ptr, R1
|
||||||
|
MOV.L [R1], R1
|
||||||
|
MOV.L #__tx_thread_current_ptr, R2
|
||||||
|
MOV.L [R2], R2
|
||||||
|
CMP R1, R2
|
||||||
|
BEQ __tx_timer_not_ts_expiration
|
||||||
|
|
||||||
|
MOV.L #SWI0, R1
|
||||||
|
MOV.L #1, [R1]
|
||||||
|
|
||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
__tx_timer_not_ts_expiration:
|
__tx_timer_not_ts_expiration:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user