Skip to content

Commit f5056f4

Browse files
author
Bo Chen
committed
Release 6.1.7
1 parent d759e6b commit f5056f4

File tree

1,269 files changed

+57162
-55015
lines changed

Some content is hidden

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

1,269 files changed

+57162
-55015
lines changed

common/inc/tx_api.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* tx_api.h PORTABLE C */
29-
/* 6.1.6 */
29+
/* 6.1.7 */
3030
/* AUTHOR */
3131
/* */
3232
/* William E. Lamie, Microsoft Corporation */
@@ -69,6 +69,9 @@
6969
/* 04-02-2021 Scott Larson Modified comment(s), and */
7070
/* update patch number, */
7171
/* resulting in version 6.1.6 */
72+
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
73+
/* Execution Profile support, */
74+
/* resulting in version 6.1.7 */
7275
/* */
7376
/**************************************************************************/
7477

@@ -101,7 +104,7 @@ extern "C" {
101104
#define AZURE_RTOS_THREADX
102105
#define THREADX_MAJOR_VERSION 6
103106
#define THREADX_MINOR_VERSION 1
104-
#define THREADX_PATCH_VERSION 6
107+
#define THREADX_PATCH_VERSION 7
105108

106109
/* Define the following symbol for backward compatibility */
107110
#define EL_PRODUCT_THREADX
@@ -498,6 +501,17 @@ typedef struct TX_THREAD_STRUCT
498501
is typically defined to whitespace in tx_port.h. */
499502
TX_THREAD_EXTENSION_3
500503

504+
505+
/* Define variables for supporting execution profile. */
506+
/* Note that in ThreadX 5.x, user would define TX_ENABLE_EXECUTION_CHANGE_NOTIFY and use TX_THREAD_EXTENSION_3
507+
to define the following two variables.
508+
For Azure RTOS 6, user shall use TX_EXECUTION_PROFILE_ENABLE instead of TX_ENABLE_EXECUTION_CHANGE_NOTIFY,
509+
and SHALL NOT add variables to TX_THREAD_EXTENSION_3. */
510+
#if (defined(TX_EXECUTION_PROFILE_ENABLE) && !defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY))
511+
unsigned long long tx_thread_execution_time_total;
512+
unsigned long long tx_thread_execution_time_last_start;
513+
#endif
514+
501515
/* Define suspension sequence number. This is used to ensure suspension is still valid when
502516
cleanup routine executes. */
503517
ULONG tx_thread_suspension_sequence;

common/src/tx_byte_pool_search.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/* FUNCTION RELEASE */
3636
/* */
3737
/* _tx_byte_pool_search PORTABLE C */
38-
/* 6.1 */
38+
/* 6.1.7 */
3939
/* AUTHOR */
4040
/* */
4141
/* William E. Lamie, Microsoft Corporation */
@@ -76,9 +76,12 @@
7676
/* */
7777
/* DATE NAME DESCRIPTION */
7878
/* */
79-
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
80-
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
79+
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
80+
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
8181
/* resulting in version 6.1 */
82+
/* 06-02-2021 Scott Larson Improve possible free bytes */
83+
/* calculation, */
84+
/* resulting in version 6.1.7 */
8285
/* */
8386
/**************************************************************************/
8487
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
@@ -96,13 +99,16 @@ UINT first_free_block_found = TX_FALSE;
9699
TX_THREAD *thread_ptr;
97100
ALIGN_TYPE *free_ptr;
98101
UCHAR *work_ptr;
102+
ULONG total_theoretical_available;
99103

100104

101105
/* Disable interrupts. */
102106
TX_DISABLE
103107

104108
/* First, determine if there are enough bytes in the pool. */
105-
if (memory_size >= pool_ptr -> tx_byte_pool_available)
109+
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
110+
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
111+
if (memory_size >= total_theoretical_available)
106112
{
107113

108114
/* Restore interrupts. */
@@ -146,10 +152,9 @@ UCHAR *work_ptr;
146152
/* Determine if this is the first free block. */
147153
if (first_free_block_found == TX_FALSE)
148154
{
149-
150155
/* This is the first free block. */
151156
pool_ptr->tx_byte_pool_search = current_ptr;
152-
157+
153158
/* Set the flag to indicate we have found the first free
154159
block. */
155160
first_free_block_found = TX_TRUE;
@@ -178,7 +183,7 @@ UCHAR *work_ptr;
178183
/* Clear the available bytes variable. */
179184
available_bytes = ((ULONG) 0);
180185

181-
/* Not enough memory, check to see if the neighbor is
186+
/* Not enough memory, check to see if the neighbor is
182187
free and can be merged. */
183188
work_ptr = TX_UCHAR_POINTER_ADD(next_ptr, (sizeof(UCHAR *)));
184189
free_ptr = TX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(work_ptr);
@@ -207,22 +212,19 @@ UCHAR *work_ptr;
207212
/* See if the search pointer is affected. */
208213
if (pool_ptr -> tx_byte_pool_search == next_ptr)
209214
{
210-
211215
/* Yes, update the search pointer. */
212216
pool_ptr -> tx_byte_pool_search = current_ptr;
213217
}
214218
}
215219
else
216220
{
217-
218221
/* Neighbor is not free so we can skip over it! */
219222
next_block_link_ptr = TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr);
220223
current_ptr = *next_block_link_ptr;
221224

222225
/* Decrement the examined block count to account for this one. */
223226
if (examine_blocks != ((UINT) 0))
224227
{
225-
226228
examine_blocks--;
227229

228230
#ifdef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
@@ -297,7 +299,7 @@ UCHAR *work_ptr;
297299

298300
/* Update the current pointer to point at the newly created block. */
299301
*this_block_link_ptr = next_ptr;
300-
302+
301303
/* Set available equal to memory size for subsequent calculation. */
302304
available_bytes = memory_size;
303305

common/src/tx_thread_create.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/* FUNCTION RELEASE */
3737
/* */
3838
/* _tx_thread_create PORTABLE C */
39-
/* 6.1 */
39+
/* 6.1.7 */
4040
/* AUTHOR */
4141
/* */
4242
/* William E. Lamie, Microsoft Corporation */
@@ -84,6 +84,9 @@
8484
/* changed stack calculations */
8585
/* to use ALIGN_TYPE integers, */
8686
/* resulting in version 6.1 */
87+
/* 06-02-2021 William E. Lamie Modified comment(s), and */
88+
/* supported TX_MISRA_ENABLE, */
89+
/* resulting in version 6.1.7 */
8790
/* */
8891
/**************************************************************************/
8992
UINT _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, VOID (*entry_function)(ULONG id), ULONG entry_input,
@@ -120,7 +123,11 @@ ALIGN_TYPE updated_stack_start;
120123
stack_size = ((stack_size/(sizeof(ULONG))) * (sizeof(ULONG))) - (sizeof(ULONG));
121124

122125
/* Ensure the starting stack address is evenly aligned. */
126+
#ifdef TX_MISRA_ENABLE
127+
new_stack_start = TX_POINTER_TO_ULONG_CONVERT(stack_start);
128+
#else
123129
new_stack_start = TX_POINTER_TO_ALIGN_TYPE_CONVERT(stack_start);
130+
#endif /* TX_MISRA_ENABLE */
124131
updated_stack_start = ((((ULONG) new_stack_start) + ((sizeof(ULONG)) - ((ULONG) 1)) ) & (~((sizeof(ULONG)) - ((ULONG) 1))));
125132

126133
/* Determine if the starting stack address is different. */
@@ -132,7 +139,11 @@ ALIGN_TYPE updated_stack_start;
132139
}
133140

134141
/* Update the starting stack pointer. */
142+
#ifdef TX_MISRA_ENABLE
143+
stack_start = TX_ULONG_TO_POINTER_CONVERT(updated_stack_start);
144+
#else
135145
stack_start = TX_ALIGN_TYPE_TO_POINTER_CONVERT(updated_stack_start);
146+
#endif /* TX_MISRA_ENABLE */
136147
#endif
137148

138149
/* Prepare the thread control block prior to placing it on the created

common/src/tx_thread_initialize.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ const CHAR _tx_thread_special_string[] =
310310
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
311311
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
312312
/* resulting in version 6.1 */
313+
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
314+
/* Execution Profile support, */
315+
/* resulting in version 6.1.7 */
313316
/* */
314317
/**************************************************************************/
315318
VOID _tx_thread_initialize(VOID)
@@ -439,7 +442,7 @@ VOID _tx_thread_initialize(VOID)
439442
#ifdef TX_ENABLE_EVENT_TRACE
440443
| (((ULONG) 1) << 8)
441444
#endif
442-
#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY
445+
#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)
443446
| (((ULONG) 1) << 7)
444447
#endif
445448
#if TX_PORT_SPECIFIC_BUILD_OPTIONS != 0

common/src/tx_thread_stack_error_handler.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
/* Include necessary system files. */
2727

2828
#include "tx_api.h"
29+
#ifndef TX_PORT_THREAD_STACK_ERROR_HANDLER
2930
#if defined(TX_MISRA_ENABLE) || defined(TX_ENABLE_STACK_CHECKING)
3031
#include "tx_thread.h"
3132

@@ -35,7 +36,7 @@
3536
/* FUNCTION RELEASE */
3637
/* */
3738
/* _tx_thread_stack_error_handler PORTABLE C */
38-
/* 6.1.1 */
39+
/* 6.1.7 */
3940
/* AUTHOR */
4041
/* */
4142
/* William E. Lamie, Microsoft Corporation */
@@ -72,6 +73,11 @@
7273
/* 10-16-2020 William E. Lamie Modified comment(s), */
7374
/* fixed link issue, */
7475
/* resulting in version 6.1.1 */
76+
/* 06-02-2021 William E. Lamie Modified comment(s), */
77+
/* fixed link issue, added */
78+
/* conditional compilation */
79+
/* for ARMv8-M (Cortex M23/33) */
80+
/* resulting in version 6.1.7 */
7581
/* */
7682
/**************************************************************************/
7783
VOID _tx_thread_stack_error_handler(TX_THREAD *thread_ptr)
@@ -111,3 +117,4 @@ TX_INTERRUPT_SAVE_AREA
111117
}
112118
#endif /* TX_MISRA_ENABLE */
113119

120+
#endif /* TX_PORT_THREAD_STACK_ERROR_HANDLER */

common/src/tx_thread_stack_error_notify.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
/* Include necessary system files. */
2727

2828
#include "tx_api.h"
29+
#ifndef TX_PORT_THREAD_STACK_ERROR_NOTIFY
2930
#include "tx_thread.h"
3031
#ifdef TX_ENABLE_STACK_CHECKING
3132
#include "tx_trace.h"
@@ -37,7 +38,7 @@
3738
/* FUNCTION RELEASE */
3839
/* */
3940
/* _tx_thread_stack_error_notify PORTABLE C */
40-
/* 6.1 */
41+
/* 6.1.7 */
4142
/* AUTHOR */
4243
/* */
4344
/* William E. Lamie, Microsoft Corporation */
@@ -74,6 +75,10 @@
7475
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
7576
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
7677
/* resulting in version 6.1 */
78+
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
79+
/* conditional compilation */
80+
/* for ARMv8-M (Cortex M23/33) */
81+
/* resulting in version 6.1.7 */
7782
/* */
7883
/**************************************************************************/
7984
UINT _tx_thread_stack_error_notify(VOID (*stack_error_handler)(TX_THREAD *thread_ptr))
@@ -125,3 +130,4 @@ TX_INTERRUPT_SAVE_AREA
125130
#endif
126131
}
127132

133+
#endif /* TX_PORT_THREAD_STACK_ERROR_NOTIFY */

0 commit comments

Comments
 (0)