Skip to content

Commit c4ad279

Browse files
authored
Merge pull request #468 from eclipse-threadx/dev
Merge changes included in the v6.4.3.202503 release.
2 parents 12dac1d + 8a744af commit c4ad279

File tree

46 files changed

+1348
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1348
-61
lines changed

CHANGELOG.md

Lines changed: 214 additions & 0 deletions
Large diffs are not rendered by default.

common/inc/tx_api.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ extern "C" {
148148
#define AZURE_RTOS_THREADX
149149
#define THREADX_MAJOR_VERSION 6
150150
#define THREADX_MINOR_VERSION 4
151-
#define THREADX_PATCH_VERSION 2
151+
#define THREADX_PATCH_VERSION 3
152+
#define THREADX_BUILD_VERSION 202503
153+
#define THREADX_HOTFIX_VERSION ''
152154

153155
/* Define the following symbol for backward compatibility */
154156
#define EL_PRODUCT_THREADX
@@ -328,6 +330,12 @@ extern "C" {
328330
#define TX_TIMER_TICKS_PER_SECOND (100UL)
329331
#endif
330332

333+
/* Define the default maximum message size in a queue. The default value is TX_16_ULONG, but may
334+
be customized in tx_user.h or as a compilation option. */
335+
336+
#ifndef TX_QUEUE_MESSAGE_MAX_SIZE
337+
#define TX_QUEUE_MESSAGE_MAX_SIZE TX_16_ULONG
338+
#endif
331339

332340
/* Event numbers 0 through 4095 are reserved by Azure RTOS. Specific event assignments are:
333341

common/inc/tx_thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
_tx_thread_stack_error_handler((thread_ptr)); \
240240
TX_DISABLE \
241241
} \
242-
if (*(((ULONG *) (thread_ptr) -> tx_thread_stack_highest_ptr) - 1) != TX_STACK_FILL) \
242+
else if (*(((ULONG *) (thread_ptr) -> tx_thread_stack_highest_ptr) - 1) != TX_STACK_FILL) \
243243
{ \
244244
TX_RESTORE \
245245
_tx_thread_stack_analyze((thread_ptr)); \

common/inc/tx_user_sample.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@
117117
#define TX_TIMER_THREAD_PRIORITY ????
118118
*/
119119

120+
/* Define the maximum size of a message in the a queue. the Default value is TX_ULONG_16.
121+
the new value must be a multiple of ULONG. */
122+
123+
/*
124+
#define TX_QUEUE_MESSAGE_MAX_SIZE TX_ULONG_16
125+
*/
126+
120127
/* Define the common timer tick reference for use by other middleware components. The default
121128
value is 10ms (i.e. 100 ticks, defined in tx_api.h), but may be replaced by a port-specific
122129
version in tx_port.h or here.

common/src/txe_queue_create.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ TX_THREAD *thread_ptr;
178178
status = TX_SIZE_ERROR;
179179
}
180180

181-
/* Check for an invalid message size - greater than 16. */
182-
else if (message_size > TX_16_ULONG)
181+
/* Check for an invalid message size - greater than TX_QUEUE_MESSAGE_MAX_SIZE 16 by default. */
182+
else if (message_size > TX_QUEUE_MESSAGE_MAX_SIZE)
183183
{
184184

185185
/* Invalid message size specified. */

common_modules/module_manager/inc/txm_module_manager_dispatch.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/***************************************************************************
2-
* Copyright (c) 2024 Microsoft Corporation
2+
* Copyright (c) 2024 Microsoft Corporation
3+
* Copyright (c) 2025 Eclipse ThreadX Contributors
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the MIT License which is available at
@@ -2389,6 +2390,11 @@ static ALIGN_TYPE _txm_module_manager_tx_thread_preemption_change_dispatch(TXM_M
23892390

23902391
ALIGN_TYPE return_value;
23912392

2393+
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
2394+
{
2395+
return(TX_THRESH_ERROR);
2396+
}
2397+
23922398
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
23932399
{
23942400
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD)))
@@ -2418,6 +2424,11 @@ static ALIGN_TYPE _txm_module_manager_tx_thread_priority_change_dispatch(TXM_MOD
24182424

24192425
ALIGN_TYPE return_value;
24202426

2427+
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
2428+
{
2429+
return(TX_PRIORITY_ERROR);
2430+
}
2431+
24212432
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
24222433
{
24232434
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD)))

common_modules/module_manager/inc/txm_module_manager_util.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/* COMPONENT DEFINITION RELEASE */
2626
/* */
2727
/* txm_module_manager_util.h PORTABLE C */
28-
/* 6.3.0 */
28+
/* 6.4.3 */
2929
/* AUTHOR */
3030
/* */
3131
/* Scott Larson, Microsoft Corporation */
@@ -46,6 +46,10 @@
4646
/* 10-31-2023 Tiejun Zhou Modified comment(s) and */
4747
/* improved object check, */
4848
/* resulting in version 6.3.0 */
49+
/* xx-xx-2025 William E. Lamie Modified comment(s) and */
50+
/* improved object pointer use */
51+
/* and creation checking, */
52+
/* resulting in version 6.4.3 */
4953
/* */
5054
/**************************************************************************/
5155

@@ -102,16 +106,11 @@
102106

103107
/* Kernel objects should be outside the module at the very least. */
104108
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, obj_ptr, obj_size) \
105-
(TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, obj_ptr, obj_size) || \
106-
(_txm_module_manager_created_object_check(module_instance, (void *)obj_ptr) == TX_FALSE) || \
107-
((void *) (obj_ptr) == TX_NULL))
109+
(_txm_module_manager_param_check_object_for_use(module_instance, obj_ptr, obj_size))
108110

109111
/* When creating an object, the object must be inside the object pool. */
110112
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_CREATION(module_instance, obj_ptr, obj_size) \
111-
((TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL(module_instance, obj_ptr, obj_size) && \
112-
(_txm_module_manager_object_size_check(obj_ptr, obj_size) == TX_SUCCESS)) || \
113-
(_txm_module_manager_created_object_check(module_instance, (void *)obj_ptr) == TX_FALSE) || \
114-
((void *) (obj_ptr) == TX_NULL))
113+
(_txm_module_manager_param_check_object_for_creation(module_instance, obj_ptr, obj_size))
115114

116115
/* Strings we dereference can be in RW/RO/Shared areas. */
117116
#define TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, string_ptr) \
@@ -136,6 +135,8 @@ UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_inst
136135
UINT _txm_module_manager_object_size_check(ALIGN_TYPE object_ptr, ULONG object_size);
137136
UINT _txm_module_manager_object_name_compare(CHAR *object_name1, UINT object_name1_length, CHAR *object_name2);
138137
UCHAR _txm_module_manager_created_object_check(TXM_MODULE_INSTANCE *module_instance, void *object_ptr);
138+
UINT _txm_module_manager_param_check_object_for_creation(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size);
139+
UINT _txm_module_manager_param_check_object_for_use(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size);
139140
UINT _txm_module_manager_util_code_allocation_size_and_alignment_get(TXM_MODULE_PREAMBLE *module_preamble, ULONG *code_alignment_dest, ULONG *code_allocation_size_dest);
140141

141142
#endif

common_modules/module_manager/src/txm_module_manager_util.c

Lines changed: 161 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instan
104104
/* FUNCTION RELEASE */
105105
/* */
106106
/* _txm_module_manager_created_object_check PORTABLE C */
107-
/* 6.1 */
107+
/* 6.1x */
108108
/* AUTHOR */
109109
/* */
110110
/* Scott Larson, Microsoft Corporation */
@@ -137,22 +137,20 @@ UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instan
137137
/* DATE NAME DESCRIPTION */
138138
/* */
139139
/* 09-30-2020 Scott Larson Initial Version 6.1 */
140+
/* xx-xx-2025 William E. Lamie Modified comment(s), and */
141+
/* removed module local memory */
142+
/* check, resulting in */
143+
/* version 6.1x */
140144
/* */
141145
/**************************************************************************/
142146
UCHAR _txm_module_manager_created_object_check(TXM_MODULE_INSTANCE *module_instance, VOID *object_ptr)
143147
{
144148

145149
TXM_MODULE_ALLOCATED_OBJECT *allocated_object_ptr;
146150

147-
/* Determine if the socket control block is inside the module. */
148-
if ( (((CHAR *) object_ptr) >= ((CHAR *) module_instance -> txm_module_instance_data_start)) &&
149-
(((CHAR *) object_ptr) < ((CHAR *) module_instance -> txm_module_instance_data_end)))
150-
{
151-
return TX_TRUE;
152-
}
153151

154-
/* Determine if this object control block was allocated by this module instance. */
155-
else if (_txm_module_manager_object_pool_created)
152+
/* Determine if the object pool has been created. */
153+
if (_txm_module_manager_object_pool_created)
156154
{
157155

158156
/* Determine if the current object is from the pool of dynamically allocated objects. */
@@ -336,6 +334,158 @@ CHAR object_name_char;
336334
}
337335

338336

337+
/**************************************************************************/
338+
/* */
339+
/* FUNCTION RELEASE */
340+
/* */
341+
/* _txm_module_manager_param_check_object_for_creation PORTABLE C */
342+
/* 6.4.3 */
343+
/* AUTHOR */
344+
/* */
345+
/* William E. Lamie, RTOSX */
346+
/* */
347+
/* DESCRIPTION */
348+
/* */
349+
/* This function checks to make sure the object pointer for one of the */
350+
/* creation APIs is valid. */
351+
/* */
352+
/* INPUT */
353+
/* */
354+
/* module_instance Requesting module instance pointer*/
355+
/* object_ptr Address of object memory area */
356+
/* ojbect_size Size of object memory area */
357+
/* */
358+
/* OUTPUT */
359+
/* */
360+
/* TX_TRUE Valid object pointer */
361+
/* TX_FALSE Invalid object pointer */
362+
/* */
363+
/* CALLS */
364+
/* */
365+
/* None */
366+
/* */
367+
/* CALLED BY */
368+
/* */
369+
/* txm_module_manager_* Module manager functions */
370+
/* */
371+
/* RELEASE HISTORY */
372+
/* */
373+
/* DATE NAME DESCRIPTION */
374+
/* */
375+
/* xx-xx-2025 William E. Lamie Initial Version 6.4.3 */
376+
/* */
377+
/**************************************************************************/
378+
UINT _txm_module_manager_param_check_object_for_creation(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size)
379+
{
380+
381+
/* Determine if the object pointer is NULL. */
382+
if ((void *) object_ptr == TX_NULL)
383+
{
384+
385+
/* Object pointer is NULL, which is invalid. */
386+
return(TX_FALSE);
387+
}
388+
389+
/* Determine if the object pointer is inside the module object pool. */
390+
if (TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL(module_instance, object_ptr, object_size) == TX_FALSE)
391+
{
392+
393+
/* Object pointer is not inside the object pool, which is invalid. */
394+
return(TX_FALSE);
395+
}
396+
397+
/* Determine if the object size is correct. */
398+
if (_txm_module_manager_object_size_check(object_ptr, object_size) != TX_SUCCESS)
399+
{
400+
401+
/* Object size is invalid. */
402+
return(TX_FALSE);
403+
}
404+
405+
/* Determine if the ojbect has already been created. */
406+
if (_txm_module_manager_created_object_check(module_instance, (void *) object_ptr) == TX_FALSE)
407+
{
408+
409+
/* Object has already been created, which is invalid. */
410+
return(TX_FALSE);
411+
}
412+
413+
/* Everything is okay with the object, return TX_TRUE. */
414+
return(TX_TRUE);
415+
}
416+
417+
418+
/**************************************************************************/
419+
/* */
420+
/* FUNCTION RELEASE */
421+
/* */
422+
/* _txm_module_manager_param_check_object_for_use PORTABLE C */
423+
/* 6.4.3 */
424+
/* AUTHOR */
425+
/* */
426+
/* William E. Lamie, RTOSX */
427+
/* */
428+
/* DESCRIPTION */
429+
/* */
430+
/* This function checks to make sure the object pointer is valid. */
431+
/* */
432+
/* INPUT */
433+
/* */
434+
/* module_instance Requesting module instance pointer*/
435+
/* object_ptr Address of object memory area */
436+
/* ojbect_size Size of object memory area */
437+
/* */
438+
/* OUTPUT */
439+
/* */
440+
/* TX_TRUE Valid object pointer */
441+
/* TX_FALSE Invalid object pointer */
442+
/* */
443+
/* CALLS */
444+
/* */
445+
/* None */
446+
/* */
447+
/* CALLED BY */
448+
/* */
449+
/* txm_module_manager_* Module manager functions */
450+
/* */
451+
/* RELEASE HISTORY */
452+
/* */
453+
/* DATE NAME DESCRIPTION */
454+
/* */
455+
/* xx-xx-2025 William E. Lamie Initial Version 6.4.3 */
456+
/* */
457+
/**************************************************************************/
458+
UINT _txm_module_manager_param_check_object_for_use(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size)
459+
{
460+
461+
/* Determine if the object pointer is NULL. */
462+
if ((void *) object_ptr == TX_NULL)
463+
{
464+
465+
/* Object pointer is NULL, which is invalid. */
466+
return(TX_FALSE);
467+
}
468+
469+
/* Determine if the object pointer is inside the module object pool. */
470+
if (TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, object_ptr, object_size) == TX_FALSE)
471+
{
472+
473+
/* Object pointer is not inside the object pool, which is invalid. */
474+
return(TX_FALSE);
475+
}
476+
477+
/* Define application-specific object memory check. */
478+
#ifdef TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_CHECK
479+
480+
/* Bring in the application-spefic objeft memory check, defined by the user. */
481+
TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_CHECK
482+
#endif /* TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_ENABLE */
483+
484+
/* Everything is okay with the object, return TX_TRUE. */
485+
return(TX_TRUE);
486+
}
487+
488+
339489
/**************************************************************************/
340490
/* */
341491
/* FUNCTION RELEASE */
@@ -414,3 +564,5 @@ ULONG data_alignment_ignored;
414564
/* Return success. */
415565
return(TX_SUCCESS);
416566
}
567+
568+

common_smp/inc/tx_api.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ extern "C" {
149149
#define AZURE_RTOS_THREADX
150150
#define THREADX_MAJOR_VERSION 6
151151
#define THREADX_MINOR_VERSION 4
152-
#define THREADX_PATCH_VERSION 2
152+
#define THREADX_PATCH_VERSION 3
153+
#define THREADX_BUILD_VERSION 202503
154+
#define THREADX_HOTFIX_VERSION ''
155+
153156

154157
/* Define the following symbol for backward compatibility */
155158
#define EL_PRODUCT_THREADX

common_smp/src/txe_queue_create.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ TX_THREAD *thread_ptr;
178178
status = TX_SIZE_ERROR;
179179
}
180180

181-
/* Check for an invalid message size - greater than 16. */
182-
else if (message_size > TX_16_ULONG)
181+
/* Check for an invalid message sizegreater than TX_QUEUE_MESSAGE_MAX_SIZE 16 by default. */
182+
else if (message_size > TX_QUEUE_MESSAGE_MAX_SIZE)
183183
{
184184

185185
/* Invalid message size specified. */

0 commit comments

Comments
 (0)