mirror of
https://github.com/eclipse-threadx/threadx.git
synced 2025-11-16 12:34:48 +00:00
Add rxv1, v2, v3 port: removed system state macro, added missing interrupt control defines, and added missing thread preemption logic.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
/* PORT SPECIFIC C INFORMATION RELEASE */
|
||||
/* */
|
||||
/* tx_port.h RXv2/CCRX */
|
||||
/* 6.1.9 */
|
||||
/* 6.1.10 */
|
||||
/* */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
@@ -52,6 +52,11 @@
|
||||
/* resulting in version 6.1.7 */
|
||||
/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||
/* 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 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -82,6 +87,12 @@ typedef short SHORT;
|
||||
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
|
||||
from 32 to 1024 and MUST be evenly divisible by 32. */
|
||||
|
||||
@@ -248,19 +259,6 @@ static void _tx_thread_system_return_inline(void)
|
||||
}
|
||||
|
||||
|
||||
#ifndef TX_THREAD_GET_SYSTEM_STATE
|
||||
|
||||
#pragma inline_asm _get_psw
|
||||
static UINT _get_psw(void){
|
||||
MVFC PSW,R1 ;
|
||||
}
|
||||
|
||||
extern volatile ULONG _tx_thread_system_state;
|
||||
#define TX_THREAD_GET_SYSTEM_STATE() (_tx_thread_system_state | ((~_get_psw()) & (1u << 17u)))
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Define the interrupt lockout macros for each ThreadX object. */
|
||||
|
||||
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
|
||||
@@ -275,7 +273,7 @@ extern volatile ULONG _tx_thread_system_state;
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/CCRX Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/CCRX Version 6.1.10 *";
|
||||
#else
|
||||
extern CHAR _tx_version_id[];
|
||||
#endif
|
||||
|
||||
@@ -153,6 +153,11 @@ For generic code revision information, please refer to the readme_threadx_generi
|
||||
file, which is included in your distribution. The following details the revision
|
||||
information associated with this specific port of ThreadX:
|
||||
|
||||
01-31-2022 Release 6.1.10 changes:
|
||||
tx_port.h Removed system state macro, and added
|
||||
missing interrupt control defines
|
||||
tx_timer_interrupt.src Added missing thread preemption logic
|
||||
|
||||
10-15-2021 Release 6.1.9 changes:
|
||||
tx_thread_context_restore.src Removed unnecessary stack type placement
|
||||
tx_thread_schedule.src Removed unnecessary stack type checking
|
||||
@@ -167,7 +172,7 @@ information associated with this specific port of ThreadX:
|
||||
12-31-2020 Initial ThreadX release for the RXv2 using CC-RXX tools, version 6.1.3
|
||||
|
||||
|
||||
Copyright(c) 1996-2020 Microsoft Corporation
|
||||
Copyright(c) 1996-2022 Microsoft Corporation
|
||||
|
||||
|
||||
https://azure.com/rtos
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_initialize_low_level RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -70,7 +70,8 @@
|
||||
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.9 */
|
||||
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_restore RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -82,6 +82,8 @@
|
||||
;/* removed unnecessary stack */
|
||||
;/* type placement, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_restore(VOID)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_save RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -74,6 +74,8 @@
|
||||
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_save(VOID)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_interrupt_control RXc2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -68,6 +68,8 @@
|
||||
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;UINT _tx_thread_interrupt_control(UINT new_posture)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -80,6 +80,8 @@
|
||||
;/* removed unnecessary stack */
|
||||
;/* type checking, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_schedule(VOID)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_stack_build RXc2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -73,6 +73,8 @@
|
||||
;/* removed unnecessary stack */
|
||||
;/* type placement, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_system_return RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -76,6 +76,8 @@
|
||||
;/* 10-15-2021 William E. Lamie Modified comment(s), and */
|
||||
;/* removed unused code, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 01-31-2022 William E. Lamie Modified comment(s), */
|
||||
;/* resulting in version 6.1.10 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_system_return(VOID)
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
;
|
||||
;Define Assembly language external references...
|
||||
;
|
||||
|
||||
SWI0 .EQU 872E0H
|
||||
|
||||
.GLB __tx_timer_time_slice
|
||||
.GLB __tx_timer_system_clock
|
||||
.GLB __tx_timer_current_ptr
|
||||
@@ -43,6 +46,9 @@
|
||||
.GLB __tx_thread_context_save
|
||||
.GLB __tx_thread_time_slice
|
||||
.GLB __tx_thread_context_restore
|
||||
.GLB __tx_thread_preempt_disable
|
||||
.GLB __tx_thread_execute_ptr
|
||||
.GLB __tx_thread_current_ptr
|
||||
;
|
||||
.SECTION P,CODE
|
||||
;/**************************************************************************/
|
||||
@@ -50,7 +56,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_timer_interrupt RXv2/CCRX */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.1.10 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -89,6 +95,10 @@
|
||||
;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */
|
||||
;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
||||
;/* 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 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_timer_interrupt(VOID)
|
||||
@@ -236,6 +246,23 @@ __tx_timer_dont_activate:
|
||||
; _tx_thread_time_slice();
|
||||
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user