26 Commits

Author SHA1 Message Date
Tiejun Zhou
b216ceb25e Removed unused code. 2021-10-17 10:00:34 +08:00
Yuxin Zhou
1af8404c54 Release 6.1.9 2021-10-14 00:51:26 +00:00
yuxin-azrtos
215df45d4b Merge pull request #139 from azure-rtos/tizho/release_rxv1
Add RXv1 port.
2021-09-23 19:57:35 -07:00
Tiejun Zhou
06064828ef Add RXv1 port. 2021-09-24 10:52:11 +08:00
Yuxin Zhou
d0dab58250 Release 6.1.8 2021-07-28 07:24:02 +00:00
Liya Du
244365fc6a Add files via upload 2021-06-14 21:48:25 +08:00
TiejunZhou
a891c3f903 Merge pull request #112 from azure-rtos/freertos-readme
FreeRTOS readme
2021-06-07 11:45:38 +08:00
Liya Du
db7a3972a8 FreeRTOS readme 2021-06-07 11:38:19 +08:00
Bo Chen
f5056f4923 Release 6.1.7 2021-06-02 06:45:05 +00:00
Scott Larson
d759e6bb9e Add Renesas RA family 2021-04-05 16:01:25 -07:00
Yuxin Zhou
b12bd44faa Release 6.1.6 2021-04-03 01:03:21 +00:00
Scott Larson
6ffaf848a0 Update LICENSED-HARDWARE.txt 2021-04-01 14:34:50 -07:00
Scott Larson
c8ed70019e update readmes and fix compilation for Keil/AC5 2021-03-05 14:52:53 -08:00
Yuxin Zhou
10a7932b9d Release 6.1.5 2021-03-05 05:38:33 +00:00
Scott Larson
32e3b3b25f add cmake for rx 2021-01-08 15:50:14 -08:00
Scott Larson
f108ebdbaf update to v6.1.3 2021-01-08 13:31:36 -08:00
Scott Larson
b0e9b132b5 update nxp 2020-12-15 10:11:38 -08:00
Scott Larson
848e7d8169 add mediatek 2020-12-11 14:51:05 -08:00
Scott Larson
69287b8bb4 update workflows 2020-12-09 10:57:26 -08:00
Scott Larson
1777796996 Update ci_cortex_m0.yml 2020-12-07 14:56:14 -08:00
Scott Larson
64b4d510ba Update ci_cortex_m0.yml 2020-12-07 14:38:48 -08:00
Scott Larson
609c75a2e5 add ST to hw list 2020-11-17 09:32:36 -08:00
Scott Larson
9b050d00ed patch release 6.1.2 2020-11-10 13:25:20 -08:00
Scott Larson
6773d468ae 6.1.1 patch: add stack sealing to armv8-m, fix misra warning, fix stack check link error 2020-10-16 11:57:42 -07:00
Scott Larson
c2df92c885 add NXP to hardware list 2020-10-14 20:21:01 -07:00
Scott Larson
e397fa003a add NXP to hardware list 2020-10-14 20:17:45 -07:00
4253 changed files with 339454 additions and 710524 deletions

View File

@@ -43,12 +43,12 @@ jobs:
directory: $HOME/arm-none-eabi-gcc-9-2019-q4
# Get CMake into the environment
- name: Install cmake 3.17.1
uses: lukka/get-cmake@v3.17.1
- name: Install cmake 3.19.1
uses: lukka/get-cmake@v3.19.1
# Get Ninja into the environment
- name: Install ninja-build
uses: seanmiddleditch/gha-setup-ninja@v1
uses: seanmiddleditch/gha-setup-ninja@v3
# Prepare the build system
- name: Prepare build system

View File

@@ -43,12 +43,12 @@ jobs:
directory: $HOME/arm-none-eabi-gcc-9-2019-q4
# Get CMake into the environment
- name: Install cmake 3.17.1
uses: lukka/get-cmake@v3.17.1
- name: Install cmake 3.19.1
uses: lukka/get-cmake@v3.19.1
# Get Ninja into the environment
- name: Install ninja-build
uses: seanmiddleditch/gha-setup-ninja@v1
uses: seanmiddleditch/gha-setup-ninja@v3
# Prepare the build system
- name: Prepare build system

View File

@@ -43,12 +43,12 @@ jobs:
directory: $HOME/arm-none-eabi-gcc-9-2019-q4
# Get CMake into the environment
- name: Install cmake 3.17.1
uses: lukka/get-cmake@v3.17.1
- name: Install cmake 3.19.1
uses: lukka/get-cmake@v3.19.1
# Get Ninja into the environment
- name: Install ninja-build
uses: seanmiddleditch/gha-setup-ninja@v1
uses: seanmiddleditch/gha-setup-ninja@v3
# Prepare the build system
- name: Prepare build system

View File

@@ -43,12 +43,12 @@ jobs:
directory: $HOME/arm-none-eabi-gcc-9-2019-q4
# Get CMake into the environment
- name: Install cmake 3.17.1
uses: lukka/get-cmake@v3.17.1
- name: Install cmake 3.19.1
uses: lukka/get-cmake@v3.19.1
# Get Ninja into the environment
- name: Install ninja-build
uses: seanmiddleditch/gha-setup-ninja@v1
uses: seanmiddleditch/gha-setup-ninja@v3
# Prepare the build system
- name: Prepare build system

View File

@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
# Set up the project
project(threadx
VERSION 6.0.0
LANGUAGES C ASM
)
@@ -12,6 +11,8 @@ endif()
if(NOT DEFINED THREADX_TOOLCHAIN)
message(FATAL_ERROR "Error: THREADX_TOOLCHAIN not defined")
endif()
message(STATUS "THREADX_ARCH: ${THREADX_ARCH}")
message(STATUS "THREADX_TOOLCHAIN: ${THREADX_TOOLCHAIN}")
# Define our target library and an alias for consumers
add_library(${PROJECT_NAME})
@@ -21,7 +22,11 @@ add_library("azrtos::${PROJECT_NAME}" ALIAS ${PROJECT_NAME})
set(CUSTOM_INC_DIR ${CMAKE_CURRENT_BINARY_DIR}/custom_inc)
# Pick up the port specific variables and apply them
if(DEFINED THREADX_CUSTOM_PORT)
add_subdirectory(${THREADX_CUSTOM_PORT} threadx_port)
else()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/ports/${THREADX_ARCH}/${THREADX_TOOLCHAIN})
endif()
# Pick up the common stuff
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)

View File

@@ -1,6 +1,6 @@
LICENSED HARDWARE LIST
Last Updated: 2020-09-22
Last Updated: 2021-04-01
Microsoft has entered into OEM Agreements with manufacturers of the following
microprocessors and microcontrollers (the “hardware”) to enable those
@@ -11,16 +11,33 @@ Production Use” rights in Section 2 of the Microsoft Software License Terms fo
Microsoft Azure RTOS. If hardware is not listed below, you do not have those
rights.
STMicroelectronics:
STM32 MCUs
STM32 MPUs
MediaTek:
MT3620 MCU (Azure Sphere)
Microchip:
PIC 32-bit MCUs
SAM 32-bit MCUs
SAM 32-bit MPUs
NXP:
i.MX RT10xx and RT116x/7x series crossover MCUs
LPC5500 series
Renesas:
Synergy Platform
RX Family of MCUs
RA Family of MCUs
RZ Family of MPUs
--------------------------------------------------------------------------------

View File

@@ -36,7 +36,7 @@ $ git clone https://github.com/azure-rtos/threadx.git
## Building as a static library
Each component of Azure RTOS comes with a composible CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
Each component of Azure RTOS comes with a composable CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
While the typical usage pattern is to include threadx into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
@@ -85,6 +85,10 @@ Each official release (preview or GA) will be tagged to mark the commit and push
Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. It is ultimately the responsibility of the device builder to ensure the device fully meets the evolving security requirements associated with its specific use case.
# Adaptation layer for ThreadX
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications. To help ease application migration to Auzre RTOS, ThreadX provides [adaption layers](https://github.com/azure-rtos/threadx/tree/master/utility/rtos_compatibility_layers) for various legacy RTOS APIs (FreeRTOS, POSIX, OSEK, etc.).
# Licensing
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the LICENSED-HARDWARE.txt file. If you are using hardware not defined in the LICENSED-HARDWARE.txt file or have licensing questions in general, please contact Microsoft directly at https://azure-rtos.ms-iot-contact.com/
@@ -103,7 +107,7 @@ The following are references to additional Azure RTOS and Azure IoT in general:
| | |
|---|---|
| TraceX Installer | https://aka.ms/azrtos-tracex-installer |
| Azure RTOS Documenation and Guides: | https://docs.microsoft.com/azure/rtos |
| Azure RTOS Documentation and Guides: | https://docs.microsoft.com/azure/rtos |
| Azure RTOS Website: | https://azure.microsoft.com/services/rtos/ |
| Azure RTOS Sales Questions: | https://azure-rtos.ms-iot-contact.com/ |
| For technical questions check out Microsoft Q/A for Azure IoT: | https://aka.ms/QnA/azure-rtos |

View File

@@ -17,7 +17,7 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_C_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} ${SPEC_FLAGS} -fdata-sections -ffunction-sections -mlong-calls" CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -fno-rtti -fno-exceptions -mlong-calls" CACHE INTERNAL "cxx compiler flags")
set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
set(CMAKE_EXE_LINKER_FLAGS "${MCPU_FLAGS} ${LD_FLAGS} -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
SET(CMAKE_C_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "c debug compiler flags")

View File

@@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* tx_api.h PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -51,6 +51,33 @@
/* added macros for casting */
/* pointers to ALIGN_TYPE, */
/* resulting in version 6.1 */
/* 10-16-2020 William E. Lamie Modified comment(s), and */
/* increased patch version, */
/* resulting in version 6.1.1 */
/* 11-09-2020 Yuxin Zhou Modified comment(s), and */
/* moved TX_THREAD_GET_SYSTEM_ */
/* STATE to tx_api.h, */
/* resulting in version 6.1.2 */
/* 12-31-2020 William E. Lamie Modified comment(s), and */
/* increased patch version, */
/* resulting in version 6.1.3 */
/* 03-02-2021 Scott Larson Modified comment(s), and */
/* order defines numerically, */
/* add option to remove FileX */
/* pointer, */
/* resulting in version 6.1.5 */
/* 04-02-2021 Scott Larson Modified comment(s), and */
/* update patch number, */
/* resulting in version 6.1.6 */
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
/* Execution Profile support, */
/* resulting in version 6.1.7 */
/* 08-02-2021 Scott Larson Modified comment(s), and */
/* update patch number, */
/* resulting in version 6.1.8 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), */
/* update patch number, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
@@ -83,7 +110,7 @@ extern "C" {
#define AZURE_RTOS_THREADX
#define THREADX_MAJOR_VERSION 6
#define THREADX_MINOR_VERSION 1
#define THREADX_PATCH_VERSION 0
#define THREADX_PATCH_VERSION 9
/* Define the following symbol for backward compatibility */
#define EL_PRODUCT_THREADX
@@ -144,7 +171,6 @@ extern "C" {
#define TX_SUCCESS ((UINT) 0x00)
#define TX_DELETED ((UINT) 0x01)
#define TX_NO_MEMORY ((UINT) 0x10)
#define TX_POOL_ERROR ((UINT) 0x02)
#define TX_PTR_ERROR ((UINT) 0x03)
#define TX_WAIT_ERROR ((UINT) 0x04)
@@ -159,6 +185,7 @@ extern "C" {
#define TX_NO_INSTANCE ((UINT) 0x0D)
#define TX_THREAD_ERROR ((UINT) 0x0E)
#define TX_PRIORITY_ERROR ((UINT) 0x0F)
#define TX_NO_MEMORY ((UINT) 0x10)
#define TX_START_ERROR ((UINT) 0x10)
#define TX_DELETE_ERROR ((UINT) 0x11)
#define TX_RESUME_ERROR ((UINT) 0x12)
@@ -412,7 +439,9 @@ typedef struct TX_THREAD_STRUCT
TX_THREAD_EXTENSION_2
/* Define a pointer type for FileX extensions. */
#ifndef TX_NO_FILEX_POINTER
VOID *tx_thread_filex_ptr;
#endif
/* Define the priority inheritance variables. These will be used
to manage priority inheritance changes applied to this thread
@@ -478,6 +507,17 @@ typedef struct TX_THREAD_STRUCT
is typically defined to whitespace in tx_port.h. */
TX_THREAD_EXTENSION_3
/* Define variables for supporting execution profile. */
/* Note that in ThreadX 5.x, user would define TX_ENABLE_EXECUTION_CHANGE_NOTIFY and use TX_THREAD_EXTENSION_3
to define the following two variables.
For Azure RTOS 6, user shall use TX_EXECUTION_PROFILE_ENABLE instead of TX_ENABLE_EXECUTION_CHANGE_NOTIFY,
and SHALL NOT add variables to TX_THREAD_EXTENSION_3. */
#if (defined(TX_EXECUTION_PROFILE_ENABLE) && !defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY))
unsigned long long tx_thread_execution_time_total;
unsigned long long tx_thread_execution_time_last_start;
#endif
/* Define suspension sequence number. This is used to ensure suspension is still valid when
cleanup routine executes. */
ULONG tx_thread_suspension_sequence;
@@ -1082,7 +1122,6 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
/* Services with MULTI runtime error checking ThreadX. */
#define tx_block_allocate _txr_block_allocate
@@ -1780,7 +1819,6 @@ VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL *inte
VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, VOID **highest_stack);
VOID _tx_misra_trace_event_insert(ULONG event_id, VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4, ULONG filter, ULONG time_stamp);
UINT _tx_misra_always_true(void);
UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **pointer);
UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer);
UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool);
@@ -1813,7 +1851,6 @@ VOID _tx_misra_semaphore_put_notify_not_used(VOID (*semaphore
VOID _tx_misra_thread_not_used(TX_THREAD *thread_ptr);
VOID _tx_misra_thread_entry_exit_notify_not_used(VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT id));
#define TX_MEMSET(a,b,c) _tx_misra_memset((a), (UINT) (b), (UINT) (c))
#define TX_UCHAR_POINTER_ADD(a,b) _tx_misra_uchar_pointer_add((UCHAR *) (a), (ULONG) (b))
#define TX_UCHAR_POINTER_SUB(a,b) _tx_misra_uchar_pointer_sub((UCHAR *) (a), (ULONG) (b))
@@ -1832,8 +1869,6 @@ VOID _tx_misra_thread_entry_exit_notify_not_used(VOID (*threa
#define TX_TRACE_IN_LINE_INSERT(i,a,b,c,d,e) _tx_misra_trace_event_insert((ULONG) (i), (VOID *) (a), (ULONG) (b), (ULONG) (c), (ULONG) (d), (ULONG) (e), ((ULONG) TX_TRACE_TIME_SOURCE));
#endif
#define TX_LOOP_FOREVER (_tx_misra_always_true() == TX_TRUE)
#define TX_INDIRECT_VOID_TO_UCHAR_POINTER_CONVERT(a) _tx_misra_indirect_void_to_uchar_pointer_convert((a))
#define TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(a) _tx_misra_uchar_to_indirect_uchar_pointer_convert((a))
#define TX_BLOCK_POOL_TO_UCHAR_POINTER_CONVERT(a) _tx_misra_block_pool_to_uchar_pointer_convert((a))
@@ -1869,7 +1904,6 @@ VOID _tx_misra_thread_entry_exit_notify_not_used(VOID (*threa
#define TX_THREAD_NOT_USED(a) _tx_misra_thread_not_used((a))
#define TX_THREAD_ENTRY_EXIT_NOTIFY_NOT_USED(a) _tx_misra_thread_entry_exit_notify_not_used((a))
#else
/* Define the TX_MEMSET macro to the standard library function, if not already defined. */
@@ -1898,8 +1932,6 @@ VOID _tx_misra_thread_entry_exit_notify_not_used(VOID (*threa
(b) = (TX_TIMER *) working_ptr; \
}
#define TX_LOOP_FOREVER ((UINT) 1)
#define TX_INDIRECT_VOID_TO_UCHAR_POINTER_CONVERT(a) ((UCHAR **) ((VOID *) (a)))
#define TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(a) ((UCHAR **) ((VOID *) (a)))
#define TX_BLOCK_POOL_TO_UCHAR_POINTER_CONVERT(a) ((UCHAR *) ((VOID *) (a)))
@@ -2210,6 +2242,13 @@ void __ghs_rnerr(char *errMsg, int stackLevels, int stackTraceDisplay, void *hex
#endif
/* Define the get system state macro. By default, it simply maps to the variable _tx_thread_system_state. */
/* Note that prior to Azure RTOS 6.1, this symbol was defined in tx_thread.h. */
#ifndef TX_THREAD_GET_SYSTEM_STATE
#define TX_THREAD_GET_SYSTEM_STATE() _tx_thread_system_state
#endif
/* Determine if a C++ compiler is being used. If so, complete the standard

View File

@@ -26,7 +26,7 @@
/* COMPONENT DEFINITION RELEASE */
/* */
/* tx_thread.h PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -44,6 +44,13 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 11-09-2020 Yuxin Zhou Modified comment(s), and */
/* moved TX_THREAD_GET_SYSTEM_ */
/* STATE to tx_api.h, */
/* resulting in version 6.1.2 */
/* 10-15-2021 Scott Larson Modified comment(s), improved */
/* stack check error handling, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
@@ -110,12 +117,13 @@
#endif
/* Define the get system state macro. By default, it simply maps to the variable _tx_thread_system_state. */
/* Define the get system state macro. By default, it simply maps to the variable _tx_thread_system_state. */
/* This symbol is moved to tx_api.h. Therefore removed from this file.
#ifndef TX_THREAD_GET_SYSTEM_STATE
#define TX_THREAD_GET_SYSTEM_STATE() _tx_thread_system_state
#endif
*/
/* Define the check for whether or not to call the _tx_thread_system_return function. A non-zero value
indicates that _tx_thread_system_return should not be called. */
@@ -433,7 +441,7 @@ THREAD_DECLARE VOID (*_tx_thread_mutex_release)(TX_THREAD *thread_pt
THREAD_DECLARE ULONG _tx_build_options;
#ifdef TX_ENABLE_STACK_CHECKING
#if defined(TX_ENABLE_STACK_CHECKING) || defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
/* Define the global function pointer for stack error handling. If a stack error is
detected and the application has registered a stack error handler, it will be

View File

@@ -26,7 +26,7 @@
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* tx_user.h PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* */
/* AUTHOR */
/* */
@@ -47,6 +47,17 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 03-02-2021 Scott Larson Modified comment(s), */
/* added option to remove */
/* FileX pointer, */
/* resulting in version 6.1.5 */
/* 06-02-2021 Scott Larson Added options for multiple */
/* block pool search & delay, */
/* resulting in version 6.1.7 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), added */
/* user-configurable symbol */
/* TX_TIMER_TICKS_PER_SECOND */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
@@ -76,6 +87,7 @@
TX_DISABLE_PREEMPTION_THRESHOLD
TX_DISABLE_REDUNDANT_CLEARING
TX_DISABLE_NOTIFY_CALLBACKS
TX_NO_FILEX_POINTER
TX_NOT_INTERRUPTABLE
TX_TIMER_PROCESS_IN_ISR
@@ -98,6 +110,25 @@
#define TX_TIMER_THREAD_PRIORITY ????
*/
/* Define the common timer tick reference for use by other middleware components. The default
value is 10ms (i.e. 100 ticks, defined in tx_api.h), but may be replaced by a port-specific
version in tx_port.h or here.
Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */
/*
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
*/
/* Determine if there is a FileX pointer in the thread control block.
By default, the pointer is there for legacy/backwards compatibility.
The pointer must also be there for applications using FileX.
Define this to save space in the thread control block.
*/
/*
#define TX_NO_FILEX_POINTER
*/
/* Determine if timer expirations (application timers, timeouts, and tx_thread_sleep calls
should be processed within the a system timer thread or directly in the timer ISR.
By default, the timer thread is used. When the following is defined, the timer expiration
@@ -255,5 +286,17 @@
#define TX_TIMER_ENABLE_PERFORMANCE_INFO
*/
/* Override options for byte pool searches of multiple blocks. */
/*
#define TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH 20
*/
/* Override options for byte pool search delay to avoid thrashing. */
/*
#define TX_BYTE_POOL_DELAY_VALUE 3
*/
#endif

View File

@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_byte_pool_search PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -79,6 +79,9 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 06-02-2021 Scott Larson Improve possible free bytes */
/* calculation, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
@@ -96,13 +99,16 @@ UINT first_free_block_found = TX_FALSE;
TX_THREAD *thread_ptr;
ALIGN_TYPE *free_ptr;
UCHAR *work_ptr;
ULONG total_theoretical_available;
/* Disable interrupts. */
TX_DISABLE
/* First, determine if there are enough bytes in the pool. */
if (memory_size >= pool_ptr -> tx_byte_pool_available)
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
if (memory_size >= total_theoretical_available)
{
/* Restore interrupts. */
@@ -146,7 +152,6 @@ UCHAR *work_ptr;
/* Determine if this is the first free block. */
if (first_free_block_found == TX_FALSE)
{
/* This is the first free block. */
pool_ptr->tx_byte_pool_search = current_ptr;
@@ -207,14 +212,12 @@ UCHAR *work_ptr;
/* See if the search pointer is affected. */
if (pool_ptr -> tx_byte_pool_search == next_ptr)
{
/* Yes, update the search pointer. */
pool_ptr -> tx_byte_pool_search = current_ptr;
}
}
else
{
/* Neighbor is not free so we can skip over it! */
next_block_link_ptr = TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr);
current_ptr = *next_block_link_ptr;
@@ -222,7 +225,6 @@ UCHAR *work_ptr;
/* Decrement the examined block count to account for this one. */
if (examine_blocks != ((UINT) 0))
{
examine_blocks--;
#ifdef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO

View File

@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_mutex_priority_change PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -78,6 +78,10 @@
/* calling */
/* _tx_thread_system_suspend, */
/* resulting in version 6.1 */
/* 04-02-2021 Scott Larson Modified comments, fixed */
/* mapping current thread's */
/* priority rather than next, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
VOID _tx_mutex_priority_change(TX_THREAD *thread_ptr, UINT new_priority)
@@ -308,15 +312,15 @@ UINT map_index;
#if TX_MAX_PRIORITIES > 32
/* Calculate the index into the bit map array. */
map_index = (next_execute_ptr -> tx_thread_priority)/ ((UINT) 32);
map_index = (thread_ptr -> tx_thread_priority)/ ((UINT) 32);
/* Set the active bit to remember that the preempt map has something set. */
TX_DIV32_BIT_SET(next_execute_ptr -> tx_thread_priority, priority_bit)
TX_DIV32_BIT_SET(thread_ptr -> tx_thread_priority, priority_bit)
_tx_thread_preempted_map_active = _tx_thread_preempted_map_active | priority_bit;
#endif
/* Remember that this thread was preempted by a thread above the thread's threshold. */
TX_MOD32_BIT_SET(next_execute_ptr -> tx_thread_priority, priority_bit)
TX_MOD32_BIT_SET(thread_ptr -> tx_thread_priority, priority_bit)
_tx_thread_preempted_maps[MAP_INDEX] = _tx_thread_preempted_maps[MAP_INDEX] | priority_bit;
}
#endif

View File

@@ -36,7 +36,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_thread_create PORTABLE C */
/* 6.1 */
/* 6.1.8 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -84,6 +84,10 @@
/* changed stack calculations */
/* to use ALIGN_TYPE integers, */
/* resulting in version 6.1 */
/* 06-02-2021 William E. Lamie Modified comment(s), and */
/* supported TX_MISRA_ENABLE, */
/* 08-02-2021 Scott Larson Removed unneeded cast, */
/* resulting in version 6.1.8 */
/* */
/**************************************************************************/
UINT _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, VOID (*entry_function)(ULONG id), ULONG entry_input,
@@ -120,8 +124,12 @@ ALIGN_TYPE updated_stack_start;
stack_size = ((stack_size/(sizeof(ULONG))) * (sizeof(ULONG))) - (sizeof(ULONG));
/* Ensure the starting stack address is evenly aligned. */
#ifdef TX_MISRA_ENABLE
new_stack_start = TX_POINTER_TO_ULONG_CONVERT(stack_start);
#else
new_stack_start = TX_POINTER_TO_ALIGN_TYPE_CONVERT(stack_start);
updated_stack_start = ((((ULONG) new_stack_start) + ((sizeof(ULONG)) - ((ULONG) 1)) ) & (~((sizeof(ULONG)) - ((ULONG) 1))));
#endif /* TX_MISRA_ENABLE */
updated_stack_start = (((new_stack_start) + ((sizeof(ULONG)) - ((ULONG) 1)) ) & (~((sizeof(ULONG)) - ((ULONG) 1))));
/* Determine if the starting stack address is different. */
if (new_stack_start != updated_stack_start)
@@ -132,7 +140,11 @@ ALIGN_TYPE updated_stack_start;
}
/* Update the starting stack pointer. */
#ifdef TX_MISRA_ENABLE
stack_start = TX_ULONG_TO_POINTER_CONVERT(updated_stack_start);
#else
stack_start = TX_ALIGN_TYPE_TO_POINTER_CONVERT(updated_stack_start);
#endif /* TX_MISRA_ENABLE */
#endif
/* Prepare the thread control block prior to placing it on the created

View File

@@ -175,7 +175,7 @@ VOID (*_tx_thread_mutex_release)(TX_THREAD *thread_ptr);
ULONG _tx_build_options;
#ifdef TX_ENABLE_STACK_CHECKING
#if defined(TX_ENABLE_STACK_CHECKING) || defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
/* Define the global function pointer for stack error handling. If a stack error is
detected and the application has registered a stack error handler, it will be
@@ -277,7 +277,7 @@ const CHAR _tx_thread_special_string[] =
/* FUNCTION RELEASE */
/* */
/* _tx_thread_initialize PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -310,6 +310,12 @@ const CHAR _tx_thread_special_string[] =
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
/* Execution Profile support, */
/* resulting in version 6.1.7 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), improved */
/* stack check error handling, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
VOID _tx_thread_initialize(VOID)
@@ -439,7 +445,7 @@ VOID _tx_thread_initialize(VOID)
#ifdef TX_ENABLE_EVENT_TRACE
| (((ULONG) 1) << 8)
#endif
#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY
#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)
| (((ULONG) 1) << 7)
#endif
#if TX_PORT_SPECIFIC_BUILD_OPTIONS != 0

View File

@@ -26,7 +26,7 @@
/* Include necessary system files. */
#include "tx_api.h"
#ifdef TX_MISRA_ENABLE
#if defined(TX_MISRA_ENABLE) || defined(TX_ENABLE_STACK_CHECKING) || defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
#include "tx_thread.h"
@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_thread_stack_error_handler PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -69,6 +69,17 @@
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* update misra support, */
/* resulting in version 6.1 */
/* 10-16-2020 William E. Lamie Modified comment(s), */
/* fixed link issue, */
/* resulting in version 6.1.1 */
/* 06-02-2021 William E. Lamie Modified comment(s), */
/* fixed link issue, added */
/* conditional compilation */
/* for ARMv8-M (Cortex M23/33) */
/* resulting in version 6.1.7 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), improved */
/* stack check error handling, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
VOID _tx_thread_stack_error_handler(TX_THREAD *thread_ptr)
@@ -76,7 +87,7 @@ VOID _tx_thread_stack_error_handler(TX_THREAD *thread_ptr)
TX_INTERRUPT_SAVE_AREA
#ifdef TX_ENABLE_STACK_CHECKING
#if defined(TX_ENABLE_STACK_CHECKING) || defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
/* Disable interrupts. */
TX_DISABLE
@@ -106,5 +117,4 @@ TX_INTERRUPT_SAVE_AREA
}
#endif
}
#endif /* TX_MISRA_ENABLE */
#endif

View File

@@ -27,7 +27,7 @@
#include "tx_api.h"
#include "tx_thread.h"
#ifdef TX_ENABLE_STACK_CHECKING
#if defined(TX_ENABLE_STACK_CHECKING) || defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
#include "tx_trace.h"
#endif
@@ -37,7 +37,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_thread_stack_error_notify PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -74,12 +74,19 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 06-02-2021 Yuxin Zhou Modified comment(s), added */
/* conditional compilation */
/* for ARMv8-M (Cortex M23/33) */
/* resulting in version 6.1.7 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), improved */
/* stack check error handling, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
UINT _tx_thread_stack_error_notify(VOID (*stack_error_handler)(TX_THREAD *thread_ptr))
{
#ifndef TX_ENABLE_STACK_CHECKING
#if !defined(TX_ENABLE_STACK_CHECKING) && !defined(TX_PORT_THREAD_STACK_ERROR_HANDLING)
UINT status;
@@ -100,6 +107,7 @@ UINT status;
/* Return completion status. */
return(status);
#else
TX_INTERRUPT_SAVE_AREA
@@ -124,4 +132,3 @@ TX_INTERRUPT_SAVE_AREA
return(TX_SUCCESS);
#endif
}

View File

@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_thread_suspend PORTABLE C */
/* 6.1 */
/* 6.1.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -70,6 +70,10 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 10-16-2020 Yuxin Zhou Modified comment(s), and */
/* added type cast to address */
/* a MISRA compliance issue, */
/* resulting in version 6.1.1 */
/* */
/**************************************************************************/
UINT _tx_thread_suspend(TX_THREAD *thread_ptr)
@@ -103,7 +107,7 @@ UINT status;
status = TX_SUCCESS;
/* Determine if we are in a thread context. */
if (TX_THREAD_GET_SYSTEM_STATE() == 0)
if (TX_THREAD_GET_SYSTEM_STATE() == ((ULONG) 0))
{
/* Yes, we are in a thread context. */
@@ -264,7 +268,7 @@ ULONG time_stamp = ((ULONG) 0);
status = TX_SUCCESS;
/* Determine if we are in a thread context. */
if (TX_THREAD_GET_SYSTEM_STATE() == 0)
if (TX_THREAD_GET_SYSTEM_STATE() == ((ULONG) 0))
{
/* Yes, we are in a thread context. */

View File

@@ -152,6 +152,7 @@ ULONG suspension_sequence;
/* Call any cleanup routines. */
if (suspend_cleanup != TX_NULL)
{
/* Yes, there is a function to call. */
(suspend_cleanup)(thread_ptr, suspension_sequence);
}

View File

@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_time_get PORTABLE C */
/* 6.1 */
/* 6.1.3 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -68,6 +68,8 @@
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 12-31-2020 Andres Mlinar Modified comment(s), */
/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
ULONG _tx_time_get(VOID)

View File

@@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* txm_module.h PORTABLE C */
/* 6.1 */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -41,6 +41,9 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 12-31-2020 Scott Larson Modified comment(s), added */
/* port-specific extension, */
/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
@@ -329,6 +332,8 @@ extern "C" {
#define TXM_MODULE_OBJECT_ALLOCATE_CALL 95
#define TXM_MODULE_OBJECT_DEALLOCATE_CALL 96
#define TXM_MODULE_PORT_EXTENSION_API_ID_START 500
#define TXM_MODULE_PORT_EXTENSION_API_ID_END 999
/* Determine the API call IDs for other components. */
@@ -571,6 +576,7 @@ VOID _txm_module_usbx_duo_callback_request(TXM_MODULE_CALLBACK_MESSAGE *callbac
resident portion of the application. */
#define txm_module_manager_initialize _txm_module_manager_initialize
#define txm_module_manager_absolute_load _txm_module_manager_absolute_load
#define txm_module_manager_in_place_load _txm_module_manager_in_place_load
#define txm_module_manager_file_load _txm_module_manager_file_load
#define txm_module_manager_memory_load _txm_module_manager_memory_load
@@ -607,6 +613,7 @@ UINT _txm_module_manager_application_request(ULONG request, ALIGN_TYPE param_1,
UINT _txm_module_manager_file_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, FX_MEDIA *media_ptr, CHAR *file_name);
#endif
UINT _txm_module_manager_initialize(VOID *module_memory_start, ULONG module_memory_size);
UINT _txm_module_manager_absolute_load(TXM_MODULE_INSTANCE *module_instance, CHAR *name, VOID *module_location);
UINT _txm_module_manager_in_place_load(TXM_MODULE_INSTANCE *module_instance, CHAR *name, VOID *module_location);
UINT _txm_module_manager_internal_load(TXM_MODULE_INSTANCE *module_instance, CHAR *name, VOID *module_location,
ULONG code_size, VOID *code_allocation_ptr, ULONG code_allocation_size);

View File

@@ -68,6 +68,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[1], extra_parameters[2]))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -131,6 +134,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -179,6 +185,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -218,6 +227,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -311,6 +323,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(VOID *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _txe_byte_allocate(
@@ -342,6 +357,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], extra_parameters[1]))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -404,6 +422,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -455,6 +476,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[6])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -509,6 +533,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -668,6 +695,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[1], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _txe_event_flags_get(
@@ -701,6 +731,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -745,6 +778,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -784,6 +820,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -886,6 +925,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _txe_mutex_create(
@@ -967,6 +1009,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1017,6 +1062,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1066,6 +1114,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1151,6 +1202,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[1], extra_parameters[2]))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -1264,6 +1318,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1314,6 +1371,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[5])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1363,6 +1423,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1551,6 +1614,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _txe_semaphore_create(
@@ -1631,6 +1697,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1675,6 +1744,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1714,6 +1786,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1840,6 +1915,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[9])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[2], extra_parameters[3]))
return(TXM_MODULE_INVALID_MEMORY);
@@ -1977,6 +2055,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[7])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(UINT)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2056,6 +2137,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[9])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2126,6 +2210,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[9])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2535,6 +2622,9 @@ VOID (*expiration_function)(ULONG);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[6])))
return(TXM_MODULE_INVALID_MEMORY);
}
/* Is it a disable request? */
@@ -2646,6 +2736,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(CHAR *)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(UINT)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2691,6 +2784,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[4])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2735,6 +2831,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[0], sizeof(ULONG)))
return(TXM_MODULE_INVALID_MEMORY);
@@ -2890,6 +2989,12 @@ static ALIGN_TYPE _txm_module_manager_tx_trace_user_event_insert_dispatch(TXM_MO
ALIGN_TYPE return_value;
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
{
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _tx_trace_user_event_insert(
(ULONG) param_0,
(ULONG) param_1,
@@ -3015,6 +3120,9 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, param_1))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[2])))
return(TXM_MODULE_INVALID_MEMORY);
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, extra_parameters[1], sizeof(VOID *)))
return(TXM_MODULE_INVALID_MEMORY);
}

View File

@@ -26,7 +26,7 @@
/* COMPONENT DEFINITION RELEASE */
/* */
/* txm_module_manager_util.h PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -41,6 +41,9 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 04-02-2021 Scott Larson Modified comment(s) and */
/* optimized object checks, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
@@ -53,15 +56,18 @@
(!(TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size)))
#define TXM_MODULE_MANAGER_CHECK_INSIDE_CODE(module_instance, obj_ptr, obj_size) \
(((obj_ptr) >= (ALIGN_TYPE) module_instance -> txm_module_instance_code_start) && \
(((obj_ptr) < ((obj_ptr) + (obj_size))) && \
((obj_ptr) >= (ALIGN_TYPE) module_instance -> txm_module_instance_code_start) && \
(((obj_ptr) + (obj_size)) <= ((ALIGN_TYPE) module_instance -> txm_module_instance_code_end + 1)))
#define TXM_MODULE_MANAGER_CHECK_OUTSIDE_CODE(module_instance, obj_ptr, obj_size) \
(!(TXM_MODULE_MANAGER_CHECK_INSIDE_CODE(module_instance, obj_ptr, obj_size)))
/* Add sizeof(TXM_MODULE_ALLOCATED_OBJECT) to pool start because the object can't exist before that. */
#define TXM_MODULE_MANAGER_CHECK_INSIDE_OBJ_POOL(module_instance, obj_ptr, obj_size) \
((_txm_module_manager_object_pool_created == TX_TRUE) && \
(((obj_ptr) >= (ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start) && \
((obj_ptr) < ((obj_ptr) + (obj_size))) && \
(((obj_ptr) >= ((ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start + sizeof(TXM_MODULE_ALLOCATED_OBJECT))) && \
(((obj_ptr) + (obj_size)) <= (ALIGN_TYPE) (_txm_module_manager_object_pool.tx_byte_pool_start + _txm_module_manager_object_pool.tx_byte_pool_size))))
/* Define macros for module. */
@@ -84,29 +90,29 @@
/* Buffers we read from can be in RW/RO/Shared areas. */
#define TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_READ(module_instance, buffer_ptr, buffer_size) \
(((void *) (buffer_ptr) == TX_NULL) || \
(TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE(module_instance, buffer_ptr, buffer_size)))
((TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE(module_instance, buffer_ptr, buffer_size)) || \
((void *) (buffer_ptr) == TX_NULL))
/* Buffers we write to can only be in RW/Shared areas. */
#define TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, buffer_ptr, buffer_size) \
(((void *) (buffer_ptr) == TX_NULL) || \
(TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, buffer_ptr, buffer_size)))
((TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, buffer_ptr, buffer_size)) || \
((void *) (buffer_ptr) == TX_NULL))
/* Kernel objects should be outside the module at the very least. */
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, obj_ptr, obj_size) \
(((void *) (obj_ptr) == TX_NULL) || \
(TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, obj_ptr, obj_size)))
((TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, obj_ptr, obj_size)) || \
((void *) (obj_ptr) == TX_NULL))
/* When creating an object, the object must be inside the object pool. */
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_CREATION(module_instance, obj_ptr, obj_size) \
(((void *) (obj_ptr) == TX_NULL) || \
(TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL(module_instance, obj_ptr, obj_size) && \
(_txm_module_manager_object_size_check(obj_ptr, obj_size) == TX_SUCCESS)))
((TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL(module_instance, obj_ptr, obj_size) && \
(_txm_module_manager_object_size_check(obj_ptr, obj_size) == TX_SUCCESS)) || \
((void *) (obj_ptr) == TX_NULL))
/* Strings we dereference can be in RW/RO/Shared areas. */
#define TXM_MODULE_MANAGER_PARAM_CHECK_DEREFERENCE_STRING(module_instance, string_ptr) \
(((void *) (string_ptr) == TX_NULL) || \
(TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE(module_instance, string_ptr, 1)))
((TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE(module_instance, string_ptr, 1)) || \
((void *) (string_ptr) == TX_NULL))
#define TXM_MODULE_MANAGER_UTIL_MAX_VALUE_OF_TYPE_UNSIGNED(type) ((1ULL << (sizeof(type) * 8)) - 1)

View File

@@ -0,0 +1,439 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_initialize.h"
#include "tx_mutex.h"
#include "tx_thread.h"
#include "tx_byte_pool.h"
#include "txm_module.h"
#include "txm_module_manager_util.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_absolute_load PORTABLE C */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Andres Mlinar, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function ensures the code-related and data-related parts of */
/* the module preamble are valid and prepares the module for */
/* execution. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* module_name Module name pointer */
/* module_location Module code location */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_allocate Allocate data area */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 12-31-2020 Andres Mlinar Initial Version 6.1.3 */
/* */
/**************************************************************************/
UINT _txm_module_manager_absolute_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, VOID *module_location)
{
TX_INTERRUPT_SAVE_AREA
TXM_MODULE_PREAMBLE *module_preamble;
ULONG code_size;
ULONG code_alignment;
ULONG code_allocation_size_ignored;
UINT status;
TXM_MODULE_INSTANCE *next_module, *previous_module;
ULONG start_stop_stack_size;
ULONG callback_stack_size;
ULONG code_size_ignored;
ULONG code_alignment_ignored;
ALIGN_TYPE data_start;
ULONG data_size;
ULONG data_alignment;
ULONG data_allocation_size;
ULONG module_properties;
CHAR *memory_ptr;
/* Check for interrupt call. */
if (TX_THREAD_GET_SYSTEM_STATE() != 0)
{
/* Now, make sure the call is from an interrupt and not initialization. */
if (TX_THREAD_GET_SYSTEM_STATE() < TX_INITIALIZE_IN_PROGRESS)
{
/* Invalid caller of this function, return appropriate error code. */
return(TX_CALLER_ERROR);
}
}
/* Determine if the module manager has not been initialized yet. */
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
/* Get module manager protection mutex. */
_tx_mutex_get(&_txm_module_manager_mutex, TX_WAIT_FOREVER);
/* Determine if the module is already valid. */
if (module_instance -> txm_module_instance_id == TXM_MODULE_ID)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Module already loaded. */
return(TXM_MODULE_ALREADY_LOADED);
}
/* Pickup the module's information. */
module_preamble = (TXM_MODULE_PREAMBLE *) module_location;
/* Check to make sure there is a valid module to load. */
if (module_preamble -> txm_module_preamble_id != TXM_MODULE_ID)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Invalid module preamble. */
return(TXM_MODULE_INVALID);
}
/* Check the properties of this module. */
module_properties = module_preamble -> txm_module_preamble_property_flags & TXM_MODULE_OPTIONS_MASK;
if (/* Ensure the requested properties are supported. */
((module_properties & _txm_module_manager_properties_supported) != module_properties) ||
/* Ensure the required properties are there. */
((_txm_module_manager_properties_required & module_properties) != _txm_module_manager_properties_required) ||
/* If memory protection is enabled, then so must user mode. */
((module_properties & TXM_MODULE_MEMORY_PROTECTION) && !(module_properties & TXM_MODULE_USER_MODE))
)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Invalid properties. Return error. */
return(TXM_MODULE_INVALID_PROPERTIES);
}
/* Check for valid module entry offsets. */
if ((module_preamble -> txm_module_preamble_shell_entry_function == 0) ||
(module_preamble -> txm_module_preamble_start_function == 0))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Invalid module preamble. */
return(TXM_MODULE_INVALID);
}
/* Check for valid sizes. */
if ((module_preamble -> txm_module_preamble_code_size == 0) ||
/* (module_preamble -> txm_module_preamble_data_size == 0) || *** a zero data size is valid */
(module_preamble -> txm_module_preamble_start_stop_stack_size == 0) ||
(module_preamble -> txm_module_preamble_callback_stack_size == 0))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Invalid module preamble. */
return(TXM_MODULE_INVALID);
}
/* Get the amount of the bytes we need to allocate for the module's code
as well as the required alignment. Note that because this is an absolute
load, we only want the code alignment so we can check it. */
status = _txm_module_manager_util_code_allocation_size_and_alignment_get(module_preamble, &code_alignment, &code_allocation_size_ignored);
if (status != TX_SUCCESS)
{
/* Math overflow error occurred. */
return(status);
}
/* Since this is an absolute load, check the alignment of the module's instruction area (code). */
TXM_MODULE_MANAGER_CHECK_CODE_ALIGNMENT(module_location, code_alignment)
/* Initialize module control block to all zeros. */
TX_MEMSET(module_instance, 0, sizeof(TXM_MODULE_INSTANCE));
/* Pickup the basic module sizes. */
code_size = module_preamble -> txm_module_preamble_code_size;
data_size = module_preamble -> txm_module_preamble_data_size;
start_stop_stack_size = module_preamble -> txm_module_preamble_start_stop_stack_size;
callback_stack_size = module_preamble -> txm_module_preamble_callback_stack_size;
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_size, TXM_MODULE_DATA_ALIGNMENT, data_size);
data_size = ((data_size - 1)/TXM_MODULE_DATA_ALIGNMENT) * TXM_MODULE_DATA_ALIGNMENT;
/* Adjust the size of the module elements to be aligned to the default alignment. We do this
so that when we partition the allocated memory, we can simply place these regions right beside
each other without having to align their pointers. Note this only works when they all have
the same alignment. */
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(start_stop_stack_size, TXM_MODULE_DATA_ALIGNMENT, start_stop_stack_size);
start_stop_stack_size = ((start_stop_stack_size - 1)/TXM_MODULE_DATA_ALIGNMENT) * TXM_MODULE_DATA_ALIGNMENT;
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(callback_stack_size, TXM_MODULE_DATA_ALIGNMENT, callback_stack_size);
callback_stack_size = ((callback_stack_size - 1)/TXM_MODULE_DATA_ALIGNMENT) * TXM_MODULE_DATA_ALIGNMENT;
/* Update the data size to account for the default thread stacks. */
data_allocation_size = 0;
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_allocation_size, start_stop_stack_size, data_allocation_size);
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_allocation_size, callback_stack_size, data_allocation_size);
/* Setup the default code and data alignments. */
data_alignment = (ULONG) TXM_MODULE_DATA_ALIGNMENT;
/* Get the port-specific alignment for the data size. Note we only want data
so we pass values of 1 for code (to avoid any possible div by 0 errors). */
code_size_ignored = 1;
code_alignment_ignored = 1;
TXM_MODULE_MANAGER_ALIGNMENT_ADJUST(module_preamble, code_size_ignored, code_alignment_ignored, data_allocation_size, data_alignment)
/* Calculate the module's total RAM memory requirement. This entire area is allocated from the module
manager's byte pool. The general layout is defined as follows:
Lowest Address: Start of start/stop thread stack
... [note: thread entry info is embedded near end of stack areas]
End of start/stop thread stack
Start of callback thread stack
... [note: thread entry info is embedded near end of stack areas]
End of callback thread stack
Highest Address: */
/* Add an extra alignment increment so we can align the pointer after allocation. */
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_allocation_size, data_alignment, data_allocation_size);
/* Allocate memory for the module. */
status = _tx_byte_allocate(&_txm_module_manager_byte_pool, (VOID **) &memory_ptr, data_allocation_size, TX_NO_WAIT);
/* Determine if the module memory allocation was successful. */
if (status)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* No memory, return an error. */
return(TX_NO_MEMORY);
}
/* Clear the allocated memory. */
TX_MEMSET(memory_ptr, ((UCHAR) 0), data_allocation_size);
/* Disable interrupts. */
TX_DISABLE
/* Setup the module instance structure. */
module_instance -> txm_module_instance_id = TXM_MODULE_ID;
/* Save the module name. */
module_instance -> txm_module_instance_name = module_name;
/* Save the module properties. */
module_instance -> txm_module_instance_property_flags = module_preamble -> txm_module_preamble_property_flags;
/* Set the module data memory allocation. This is the address released
when the module is unloaded. */
module_instance -> txm_module_instance_data_allocation_ptr = (VOID *) memory_ptr;
/* Save the data allocation size. */
module_instance -> txm_module_instance_data_allocation_size = data_allocation_size;
/* Calculate the actual start of the data area. This needs to be adjusted based on the alignment. */
data_start = (ALIGN_TYPE) memory_ptr;
data_start = (data_start + (((ALIGN_TYPE)data_alignment) - 1)) & ~(((ALIGN_TYPE)data_alignment) - 1);
memory_ptr = (CHAR *) data_start;
/* Compute the beginning and end of the data area. */
#ifdef ALIGN_TYPE_DEFINED
module_instance -> txm_module_instance_data_start = (VOID *) (((CHAR *) (ALIGN_TYPE) module_preamble->txm_module_preamble_code_size) + sizeof(TXM_MODULE_PREAMBLE));
module_instance -> txm_module_instance_data_end = (VOID *) (((CHAR *) (ALIGN_TYPE) module_instance -> txm_module_instance_data_start) + module_preamble->txm_module_preamble_data_size);
#else
module_instance -> txm_module_instance_data_start = (VOID *) (((CHAR *) module_preamble->txm_module_preamble_code_size) + sizeof(TXM_MODULE_PREAMBLE));
module_instance -> txm_module_instance_data_end = (VOID *) (((CHAR *) module_instance -> txm_module_instance_data_start) + module_preamble->txm_module_preamble_data_size);
#endif
/* Save the size of the data area. */
module_instance -> txm_module_instance_data_size = data_size;
/* Set the module code memory allocation. This is the address released
when the module is unloaded. */
module_instance -> txm_module_instance_code_allocation_ptr = (VOID *) NULL;
/* Save the code allocation size. */
module_instance -> txm_module_instance_code_allocation_size = 0;
/* Setup the code pointers. Since the code was loaded in-place, this is effectively just the values supplied in the API call. */
module_instance -> txm_module_instance_code_start = (VOID *) module_location;
module_instance -> txm_module_instance_code_end = (VOID *) (((CHAR *) module_location) + (code_size - 1));
/* Setup the code size. */
module_instance -> txm_module_instance_code_size = code_size;
/* Save the module's total memory usage. */
module_instance -> txm_module_instance_total_ram_usage = 0 /* Code is executed in place */ + data_allocation_size /* just the size of stacks */;
/* Set the module state to started. */
module_instance -> txm_module_instance_state = TXM_MODULE_LOADED;
/* Save the preamble pointer. */
module_instance -> txm_module_instance_preamble_ptr = module_preamble;
/* Save the module application ID in the module instance. */
module_instance -> txm_module_instance_application_module_id = module_preamble -> txm_module_preamble_application_module_id;
/* Setup the module's start/stop thread stack area. */
module_instance -> txm_module_instance_start_stop_stack_start_address = (VOID *) (memory_ptr);
module_instance -> txm_module_instance_start_stop_stack_size = start_stop_stack_size;
module_instance -> txm_module_instance_start_stop_stack_end_address = (VOID *) (memory_ptr + (start_stop_stack_size - 1));
/* Move the memory pointer forward. */
memory_ptr = memory_ptr + start_stop_stack_size;
/* Save the start/stop thread priority. */
module_instance -> txm_module_instance_start_stop_priority = module_preamble -> txm_module_preamble_start_stop_priority;
/* Setup the module's callback thread stack area. */
module_instance -> txm_module_instance_callback_stack_start_address = (VOID *) (memory_ptr);
module_instance -> txm_module_instance_callback_stack_size = callback_stack_size;
module_instance -> txm_module_instance_callback_stack_end_address = (VOID *) (memory_ptr + (callback_stack_size - 1));
/* Move the memory pointer forward. */
memory_ptr = memory_ptr + callback_stack_size;
/* Save the callback thread priority. */
module_instance -> txm_module_instance_callback_priority = module_preamble -> txm_module_preamble_callback_priority;
/* Setup the start of the module data section. */
module_instance -> txm_module_instance_module_data_base_address = (VOID *) (memory_ptr);
/* Build actual addresses based on load... Setup all the function pointers. Any adjustments needed to shell entry, start function, and callback function are defined in the
module preamble. */
#ifdef ALIGN_TYPE_DEFINED
module_instance -> txm_module_instance_shell_entry_function = (VOID (*)(TX_THREAD *, TXM_MODULE_INSTANCE *)) ((VOID *) (ALIGN_TYPE) module_preamble -> txm_module_preamble_shell_entry_function);
module_instance -> txm_module_instance_start_thread_entry = (VOID (*)(ULONG)) ((VOID *) (ALIGN_TYPE) module_preamble -> txm_module_preamble_start_function);
module_instance -> txm_module_instance_callback_request_thread_entry = (VOID (*)(ULONG)) ((VOID *) (ALIGN_TYPE) module_preamble -> txm_module_preamble_callback_function);
#else
module_instance -> txm_module_instance_shell_entry_function = (VOID (*)(TX_THREAD *, TXM_MODULE_INSTANCE *)) ((VOID *) module_preamble -> txm_module_preamble_shell_entry_function);
module_instance -> txm_module_instance_start_thread_entry = (VOID (*)(ULONG)) ((VOID *) module_preamble -> txm_module_preamble_start_function);
module_instance -> txm_module_instance_callback_request_thread_entry = (VOID (*)(ULONG)) ((VOID *) module_preamble -> txm_module_preamble_callback_function);
#endif
/* Determine if there is a stop function for this module. */
if (module_preamble -> txm_module_preamble_stop_function)
{
/* Yes, there is a stop function, build the address. */
#ifdef ALIGN_TYPE_DEFINED
module_instance -> txm_module_instance_stop_thread_entry = (VOID (*)(ULONG)) ((VOID *) (ALIGN_TYPE) module_preamble -> txm_module_preamble_stop_function);
#else
module_instance -> txm_module_instance_stop_thread_entry = (VOID (*)(ULONG)) ((VOID *) module_preamble -> txm_module_preamble_stop_function);
#endif
}
else
{
/* No, there is no stop function. Just set the pointer to NULL. */
module_instance -> txm_module_instance_stop_thread_entry = TX_NULL;
}
/* Load the module control block with port-specific information. */
TXM_MODULE_MANAGER_MODULE_SETUP(module_instance);
/* Now add the module to the linked list of created modules. */
if (_txm_module_manger_loaded_count++ == 0)
{
/* The loaded module list is empty. Add module to empty list. */
_txm_module_manager_loaded_list_ptr = module_instance;
module_instance -> txm_module_instance_loaded_next = module_instance;
module_instance -> txm_module_instance_loaded_previous = module_instance;
}
else
{
/* This list is not NULL, add to the end of the list. */
next_module = _txm_module_manager_loaded_list_ptr;
previous_module = next_module -> txm_module_instance_loaded_previous;
/* Place the new module in the list. */
next_module -> txm_module_instance_loaded_previous = module_instance;
previous_module -> txm_module_instance_loaded_next = module_instance;
/* Setup this module's created links. */
module_instance -> txm_module_instance_loaded_previous = previous_module;
module_instance -> txm_module_instance_loaded_next = next_module;
}
/* Restore interrupts. */
TX_RESTORE
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Return success. */
return(TX_SUCCESS);
}

View File

@@ -40,8 +40,8 @@
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_kernel_dispatch PORTABLE C */
/* 6.1 */
/* _txm_module_manager_kernel_dispatch PORTABLE C */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -50,6 +50,8 @@
/* */
/* This function dispatches the module's kernel request based upon the */
/* ID and parameters specified in the request. */
/* To disallow modules to use specific ThreadX services, define */
/* TXM_***_CALL_NOT_USED (see #ifndefs surrounding each case). */
/* */
/* INPUT */
/* */
@@ -80,6 +82,13 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 12-31-2020 Scott Larson Modified comment(s), added */
/* port-specific dispatch, */
/* resulting in version 6.1.3 */
/* 04-02-2021 Scott Larson Modified comment(s), */
/* added optional defines to */
/* remove unneeded functions, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
ALIGN_TYPE _txm_module_manager_kernel_dispatch(ULONG kernel_request, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE param_2)
@@ -101,584 +110,785 @@ TXM_MODULE_INSTANCE *module_instance;
switch (kernel_request)
{
#ifndef TXM_BLOCK_ALLOCATE_CALL_NOT_USED
case TXM_BLOCK_ALLOCATE_CALL:
{
return_value = _txm_module_manager_tx_block_allocate_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_CREATE_CALL_NOT_USED
case TXM_BLOCK_POOL_CREATE_CALL:
{
return_value = _txm_module_manager_tx_block_pool_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_DELETE_CALL_NOT_USED
case TXM_BLOCK_POOL_DELETE_CALL:
{
return_value = _txm_module_manager_tx_block_pool_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_INFO_GET_CALL_NOT_USED
case TXM_BLOCK_POOL_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_block_pool_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_BLOCK_POOL_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_block_pool_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_BLOCK_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_block_pool_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BLOCK_POOL_PRIORITIZE_CALL_NOT_USED
case TXM_BLOCK_POOL_PRIORITIZE_CALL:
{
return_value = _txm_module_manager_tx_block_pool_prioritize_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_BLOCK_RELEASE_CALL_NOT_USED
case TXM_BLOCK_RELEASE_CALL:
{
return_value = _txm_module_manager_tx_block_release_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_BYTE_ALLOCATE_CALL_NOT_USED
case TXM_BYTE_ALLOCATE_CALL:
{
return_value = _txm_module_manager_tx_byte_allocate_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BYTE_POOL_CREATE_CALL_NOT_USED
case TXM_BYTE_POOL_CREATE_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BYTE_POOL_DELETE_CALL_NOT_USED
case TXM_BYTE_POOL_DELETE_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_BYTE_POOL_INFO_GET_CALL_NOT_USED
case TXM_BYTE_POOL_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BYTE_POOL_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_BYTE_POOL_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BYTE_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_BYTE_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_BYTE_POOL_PRIORITIZE_CALL_NOT_USED
case TXM_BYTE_POOL_PRIORITIZE_CALL:
{
return_value = _txm_module_manager_tx_byte_pool_prioritize_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_BYTE_RELEASE_CALL_NOT_USED
case TXM_BYTE_RELEASE_CALL:
{
return_value = _txm_module_manager_tx_byte_release_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_CREATE_CALL_NOT_USED
case TXM_EVENT_FLAGS_CREATE_CALL:
{
return_value = _txm_module_manager_tx_event_flags_create_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_DELETE_CALL_NOT_USED
case TXM_EVENT_FLAGS_DELETE_CALL:
{
return_value = _txm_module_manager_tx_event_flags_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_GET_CALL_NOT_USED
case TXM_EVENT_FLAGS_GET_CALL:
{
return_value = _txm_module_manager_tx_event_flags_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_INFO_GET_CALL_NOT_USED
case TXM_EVENT_FLAGS_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_event_flags_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_EVENT_FLAGS_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_event_flags_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_EVENT_FLAGS_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_event_flags_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_SET_CALL_NOT_USED
case TXM_EVENT_FLAGS_SET_CALL:
{
return_value = _txm_module_manager_tx_event_flags_set_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_EVENT_FLAGS_SET_NOTIFY_CALL_NOT_USED
case TXM_EVENT_FLAGS_SET_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_event_flags_set_notify_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_MUTEX_CREATE_CALL_NOT_USED
case TXM_MUTEX_CREATE_CALL:
{
return_value = _txm_module_manager_tx_mutex_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_MUTEX_DELETE_CALL_NOT_USED
case TXM_MUTEX_DELETE_CALL:
{
return_value = _txm_module_manager_tx_mutex_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_MUTEX_GET_CALL_NOT_USED
case TXM_MUTEX_GET_CALL:
{
return_value = _txm_module_manager_tx_mutex_get_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_MUTEX_INFO_GET_CALL_NOT_USED
case TXM_MUTEX_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_mutex_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_MUTEX_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_MUTEX_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_mutex_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_MUTEX_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_MUTEX_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_mutex_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_MUTEX_PRIORITIZE_CALL_NOT_USED
case TXM_MUTEX_PRIORITIZE_CALL:
{
return_value = _txm_module_manager_tx_mutex_prioritize_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_MUTEX_PUT_CALL_NOT_USED
case TXM_MUTEX_PUT_CALL:
{
return_value = _txm_module_manager_tx_mutex_put_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_QUEUE_CREATE_CALL_NOT_USED
case TXM_QUEUE_CREATE_CALL:
{
return_value = _txm_module_manager_tx_queue_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_QUEUE_DELETE_CALL_NOT_USED
case TXM_QUEUE_DELETE_CALL:
{
return_value = _txm_module_manager_tx_queue_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_QUEUE_FLUSH_CALL_NOT_USED
case TXM_QUEUE_FLUSH_CALL:
{
return_value = _txm_module_manager_tx_queue_flush_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_QUEUE_FRONT_SEND_CALL_NOT_USED
case TXM_QUEUE_FRONT_SEND_CALL:
{
return_value = _txm_module_manager_tx_queue_front_send_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_QUEUE_INFO_GET_CALL_NOT_USED
case TXM_QUEUE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_queue_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_QUEUE_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_QUEUE_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_queue_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_QUEUE_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_QUEUE_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_queue_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_QUEUE_PRIORITIZE_CALL_NOT_USED
case TXM_QUEUE_PRIORITIZE_CALL:
{
return_value = _txm_module_manager_tx_queue_prioritize_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_QUEUE_RECEIVE_CALL_NOT_USED
case TXM_QUEUE_RECEIVE_CALL:
{
return_value = _txm_module_manager_tx_queue_receive_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_QUEUE_SEND_CALL_NOT_USED
case TXM_QUEUE_SEND_CALL:
{
return_value = _txm_module_manager_tx_queue_send_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_QUEUE_SEND_NOTIFY_CALL_NOT_USED
case TXM_QUEUE_SEND_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_queue_send_notify_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_SEMAPHORE_CEILING_PUT_CALL_NOT_USED
case TXM_SEMAPHORE_CEILING_PUT_CALL:
{
return_value = _txm_module_manager_tx_semaphore_ceiling_put_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_SEMAPHORE_CREATE_CALL_NOT_USED
case TXM_SEMAPHORE_CREATE_CALL:
{
return_value = _txm_module_manager_tx_semaphore_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_SEMAPHORE_DELETE_CALL_NOT_USED
case TXM_SEMAPHORE_DELETE_CALL:
{
return_value = _txm_module_manager_tx_semaphore_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_SEMAPHORE_GET_CALL_NOT_USED
case TXM_SEMAPHORE_GET_CALL:
{
return_value = _txm_module_manager_tx_semaphore_get_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_SEMAPHORE_INFO_GET_CALL_NOT_USED
case TXM_SEMAPHORE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_semaphore_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_SEMAPHORE_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_SEMAPHORE_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_semaphore_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_SEMAPHORE_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_SEMAPHORE_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_semaphore_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_SEMAPHORE_PRIORITIZE_CALL_NOT_USED
case TXM_SEMAPHORE_PRIORITIZE_CALL:
{
return_value = _txm_module_manager_tx_semaphore_prioritize_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_SEMAPHORE_PUT_CALL_NOT_USED
case TXM_SEMAPHORE_PUT_CALL:
{
return_value = _txm_module_manager_tx_semaphore_put_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_SEMAPHORE_PUT_NOTIFY_CALL_NOT_USED
case TXM_SEMAPHORE_PUT_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_semaphore_put_notify_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_THREAD_CREATE_CALL_NOT_USED
case TXM_THREAD_CREATE_CALL:
{
return_value = _txm_module_manager_tx_thread_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_DELETE_CALL_NOT_USED
case TXM_THREAD_DELETE_CALL:
{
return_value = _txm_module_manager_tx_thread_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_ENTRY_EXIT_NOTIFY_CALL_NOT_USED
case TXM_THREAD_ENTRY_EXIT_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_thread_entry_exit_notify_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_THREAD_IDENTIFY_CALL_NOT_USED
case TXM_THREAD_IDENTIFY_CALL:
{
return_value = _txm_module_manager_tx_thread_identify_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_INFO_GET_CALL_NOT_USED
case TXM_THREAD_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_thread_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_INTERRUPT_CONTROL_CALL_NOT_USED
case TXM_THREAD_INTERRUPT_CONTROL_CALL:
{
return_value = _txm_module_manager_tx_thread_interrupt_control_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_THREAD_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_thread_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_THREAD_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_thread_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_PREEMPTION_CHANGE_CALL_NOT_USED
case TXM_THREAD_PREEMPTION_CHANGE_CALL:
{
return_value = _txm_module_manager_tx_thread_preemption_change_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_THREAD_PRIORITY_CHANGE_CALL_NOT_USED
case TXM_THREAD_PRIORITY_CHANGE_CALL:
{
return_value = _txm_module_manager_tx_thread_priority_change_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_THREAD_RELINQUISH_CALL_NOT_USED
case TXM_THREAD_RELINQUISH_CALL:
{
return_value = _txm_module_manager_tx_thread_relinquish_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_THREAD_RESET_CALL_NOT_USED
case TXM_THREAD_RESET_CALL:
{
return_value = _txm_module_manager_tx_thread_reset_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_RESUME_CALL_NOT_USED
case TXM_THREAD_RESUME_CALL:
{
return_value = _txm_module_manager_tx_thread_resume_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_SLEEP_CALL_NOT_USED
case TXM_THREAD_SLEEP_CALL:
{
return_value = _txm_module_manager_tx_thread_sleep_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_STACK_ERROR_NOTIFY_CALL_NOT_USED
case TXM_THREAD_STACK_ERROR_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_thread_stack_error_notify_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_SUSPEND_CALL_NOT_USED
case TXM_THREAD_SUSPEND_CALL:
{
return_value = _txm_module_manager_tx_thread_suspend_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_SYSTEM_SUSPEND_CALL_NOT_USED
case TXM_THREAD_SYSTEM_SUSPEND_CALL:
{
return_value = _txm_module_manager_tx_thread_system_suspend_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_TERMINATE_CALL_NOT_USED
case TXM_THREAD_TERMINATE_CALL:
{
return_value = _txm_module_manager_tx_thread_terminate_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_THREAD_TIME_SLICE_CHANGE_CALL_NOT_USED
case TXM_THREAD_TIME_SLICE_CHANGE_CALL:
{
return_value = _txm_module_manager_tx_thread_time_slice_change_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_THREAD_WAIT_ABORT_CALL_NOT_USED
case TXM_THREAD_WAIT_ABORT_CALL:
{
return_value = _txm_module_manager_tx_thread_wait_abort_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TIME_GET_CALL_NOT_USED
case TXM_TIME_GET_CALL:
{
return_value = _txm_module_manager_tx_time_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TIME_SET_CALL_NOT_USED
case TXM_TIME_SET_CALL:
{
return_value = _txm_module_manager_tx_time_set_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TIMER_ACTIVATE_CALL_NOT_USED
case TXM_TIMER_ACTIVATE_CALL:
{
return_value = _txm_module_manager_tx_timer_activate_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TIMER_CHANGE_CALL_NOT_USED
case TXM_TIMER_CHANGE_CALL:
{
return_value = _txm_module_manager_tx_timer_change_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_TIMER_CREATE_CALL_NOT_USED
case TXM_TIMER_CREATE_CALL:
{
return_value = _txm_module_manager_tx_timer_create_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TIMER_DEACTIVATE_CALL_NOT_USED
case TXM_TIMER_DEACTIVATE_CALL:
{
return_value = _txm_module_manager_tx_timer_deactivate_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TIMER_DELETE_CALL_NOT_USED
case TXM_TIMER_DELETE_CALL:
{
return_value = _txm_module_manager_tx_timer_delete_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TIMER_INFO_GET_CALL_NOT_USED
case TXM_TIMER_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_timer_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TIMER_PERFORMANCE_INFO_GET_CALL_NOT_USED
case TXM_TIMER_PERFORMANCE_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_timer_performance_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TIMER_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
case TXM_TIMER_PERFORMANCE_SYSTEM_INFO_GET_CALL:
{
return_value = _txm_module_manager_tx_timer_performance_system_info_get_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TRACE_BUFFER_FULL_NOTIFY_CALL_NOT_USED
case TXM_TRACE_BUFFER_FULL_NOTIFY_CALL:
{
return_value = _txm_module_manager_tx_trace_buffer_full_notify_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_DISABLE_CALL_NOT_USED
case TXM_TRACE_DISABLE_CALL:
{
return_value = _txm_module_manager_tx_trace_disable_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_TRACE_ENABLE_CALL_NOT_USED
case TXM_TRACE_ENABLE_CALL:
{
return_value = _txm_module_manager_tx_trace_enable_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_TRACE_EVENT_FILTER_CALL_NOT_USED
case TXM_TRACE_EVENT_FILTER_CALL:
{
return_value = _txm_module_manager_tx_trace_event_filter_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_EVENT_UNFILTER_CALL_NOT_USED
case TXM_TRACE_EVENT_UNFILTER_CALL:
{
return_value = _txm_module_manager_tx_trace_event_unfilter_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_INTERRUPT_CONTROL_CALL_NOT_USED
case TXM_TRACE_INTERRUPT_CONTROL_CALL:
{
return_value = _txm_module_manager_tx_trace_interrupt_control_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_ISR_ENTER_INSERT_CALL_NOT_USED
case TXM_TRACE_ISR_ENTER_INSERT_CALL:
{
return_value = _txm_module_manager_tx_trace_isr_enter_insert_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_ISR_EXIT_INSERT_CALL_NOT_USED
case TXM_TRACE_ISR_EXIT_INSERT_CALL:
{
return_value = _txm_module_manager_tx_trace_isr_exit_insert_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_TRACE_USER_EVENT_INSERT_CALL_NOT_USED
case TXM_TRACE_USER_EVENT_INSERT_CALL:
{
return_value = _txm_module_manager_tx_trace_user_event_insert_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
#ifndef TXM_MODULE_OBJECT_ALLOCATE_CALL_NOT_USED
case TXM_MODULE_OBJECT_ALLOCATE_CALL:
{
return_value = _txm_module_manager_txm_module_object_allocate_dispatch(module_instance, param_0, param_1);
break;
}
#endif
#ifndef TXM_MODULE_OBJECT_DEALLOCATE_CALL_NOT_USED
case TXM_MODULE_OBJECT_DEALLOCATE_CALL:
{
return_value = _txm_module_manager_txm_module_object_deallocate_dispatch(module_instance, param_0);
break;
}
#endif
#ifndef TXM_MODULE_OBJECT_POINTER_GET_CALL_NOT_USED
case TXM_MODULE_OBJECT_POINTER_GET_CALL:
{
return_value = _txm_module_manager_txm_module_object_pointer_get_dispatch(module_instance, param_0, param_1, param_2);
break;
}
#endif
#ifndef TXM_MODULE_OBJECT_POINTER_GET_EXTENDED_CALL_NOT_USED
case TXM_MODULE_OBJECT_POINTER_GET_EXTENDED_CALL:
{
return_value = _txm_module_manager_txm_module_object_pointer_get_extended_dispatch(module_instance, param_0, param_1, (ALIGN_TYPE *) param_2);
break;
}
#endif
default:
{
#ifdef TXM_MODULE_PORT_DISPATCH
/* Is this a port-specific request? */
if ((kernel_request >= TXM_MODULE_PORT_EXTENSION_API_ID_START) && (kernel_request <= TXM_MODULE_PORT_EXTENSION_API_ID_END))
{
/* Yes, call the port-specific dispatcher. */
return_value = (ALIGN_TYPE) _txm_module_manager_port_dispatch(module_instance, kernel_request, param_0, param_1, param_2);
}
#endif
/* Determine if an application request is present. */
if (kernel_request >= TXM_APPLICATION_REQUEST_ID_BASE)
{

View File

@@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_start PORTABLE C */
/* 6.1 */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -53,7 +53,6 @@
/* */
/* CALLS */
/* */
/* _txm_module_manager_name_build Build module:thread name */
/* _txm_module_manager_thread_create Module thread create */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
@@ -70,6 +69,8 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 12-31-2020 Scott Larson Modified comment(s), */
/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
UINT _txm_module_manager_start(TXM_MODULE_INSTANCE *module_instance)

View File

@@ -60,7 +60,7 @@ extern UINT _txm_module_manager_usbx_stop(TXM_MODULE_INSTANCE *module_instance)
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_stop PORTABLE C */
/* 6.1 */
/* 6.1.5 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -109,6 +109,9 @@ extern UINT _txm_module_manager_usbx_stop(TXM_MODULE_INSTANCE *module_instance)
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 03-02-2021 Scott Larson Modified comments, fix */
/* object delete underflow, */
/* resulting in version 6.1.5 */
/* */
/**************************************************************************/
UINT _txm_module_manager_stop(TXM_MODULE_INSTANCE *module_instance)
@@ -531,9 +534,8 @@ TXM_MODULE_ALLOCATED_OBJECT *object_ptr;
#endif
/* Delete the allocated objects for this module. */
while (module_instance -> txm_module_instance_object_list_count--)
while (module_instance -> txm_module_instance_object_list_count != 0)
{
/* Pickup the current object pointer. */
object_ptr = module_instance -> txm_module_instance_object_list_head;
@@ -542,6 +544,9 @@ TXM_MODULE_ALLOCATED_OBJECT *object_ptr;
/* Release the object. */
_tx_byte_release((VOID *) object_ptr);
/* Decrement count. */
module_instance -> txm_module_instance_object_list_count--;
}
/* Set the allocated list head pointer to NULL. */

View File

@@ -21,11 +21,15 @@
/**************************************************************************/
#define TX_SOURCE_CODE
#define TX_THREAD_SMP_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_trace.h"
#include "tx_initialize.h"
#include "tx_thread.h"
#include "tx_initialize.h"
#include "tx_timer.h"
#include "txm_module.h"
@@ -35,7 +39,7 @@
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_thread_create PORTABLE C */
/* 6.1 */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -62,7 +66,7 @@
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* return status Thread create return status */
/* */
/* CALLS */
/* */
@@ -82,34 +86,38 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 12-31-2020 Scott Larson Modified comment(s), */
/* fix stack overlap checking, */
/* added 64-bit support, */
/* added SMP support, */
/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
UINT _txm_module_manager_thread_create(TX_THREAD *thread_ptr, CHAR *name, VOID (*shell_function)(TX_THREAD *, TXM_MODULE_INSTANCE *),
VOID (*entry_function)(ULONG), ULONG entry_input,
UINT _txm_module_manager_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
VOID (*shell_function)(TX_THREAD *, TXM_MODULE_INSTANCE *),
VOID (*entry_function)(ULONG id), ULONG entry_input,
VOID *stack_start, ULONG stack_size, UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start, UINT thread_control_block_size, TXM_MODULE_INSTANCE *module_instance)
ULONG time_slice, UINT auto_start,
UINT thread_control_block_size, TXM_MODULE_INSTANCE *module_instance)
{
TX_INTERRUPT_SAVE_AREA
#ifdef TX_THREAD_SMP
UINT core_index;
#endif
TX_THREAD *next_thread;
TX_THREAD *previous_thread;
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
TX_THREAD *saved_thread_ptr;
UINT saved_threshold = 0;
#endif
UINT saved_threshold = ((UINT) 0);
UCHAR *temp_ptr;
#ifdef TX_ENABLE_STACK_CHECKING
ULONG new_stack_start;
ALIGN_TYPE new_stack_start;
ALIGN_TYPE updated_stack_start;
#endif
TXM_MODULE_THREAD_ENTRY_INFO *thread_entry_info;
VOID *stack_end;
ULONG i;
#ifndef TX_TIMER_PROCESS_IN_ISR
TX_THREAD *current_thread;
#endif
#if TXM_MODULE_MEMORY_PROTECTION
ULONG status;
#endif
/* First, check for an invalid thread pointer. */
if (thread_ptr == TX_NULL)
@@ -150,38 +158,13 @@ ULONG status;
}
/* Check the stack pointer to see if it overlaps with this thread's stack. */
/*lint -e{946} suppress pointer comparison, since this is necessary. */
if (((UCHAR *) ((VOID *) stack_start)) >= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_start)))
if ((((UCHAR *) ((VOID *) stack_start)) <= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_end))) &&
(((UCHAR *) ((VOID *) stack_end)) >= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_start))))
{
/*lint -e{946} suppress pointer comparison, since this is necessary. */
if (((UCHAR *) ((VOID *) stack_start)) < ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_end)))
{
/* This stack overlaps with an existing thread, clear the stack pointer to
force a stack error below. */
/* Stacks overlap, clear the stack pointer to force a stack error below. */
stack_start = TX_NULL;
break;
}
}
/* Check the end of the stack to see if it is inside this thread's stack area as well. */
/*lint -e{946} suppress pointer comparison, since this is necessary. */
if (((UCHAR *) ((VOID *) stack_end)) >= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_start)))
{
/*lint -e{946} suppress pointer comparison, since this is necessary. */
if (((UCHAR *) ((VOID *) stack_end)) < ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_end)))
{
/* This stack overlaps with an existing thread, clear the stack pointer to
force a stack error below. */
stack_start = TX_NULL;
break;
}
}
/* Move to the next thread. */
next_thread = next_thread -> tx_thread_created_next;
@@ -256,6 +239,8 @@ ULONG status;
}
#ifndef TX_TIMER_PROCESS_IN_ISR
{
TX_THREAD *current_thread;
/* Pickup thread pointer. */
TX_THREAD_GET_CURRENT(current_thread)
@@ -267,6 +252,7 @@ ULONG status;
/* Invalid caller of this function, return appropriate error code. */
return(TX_CALLER_ERROR);
}
}
#endif
/* Check for interrupt call. */
@@ -295,21 +281,22 @@ ULONG status;
/* Ensure that there are two ULONG of 0xEF patterns at the top and
bottom of the thread's stack. This will be used to check for stack
overflow conditions during run-time. */
stack_size = ((stack_size/sizeof(ULONG)) * sizeof(ULONG)) - sizeof(ULONG);
stack_size = ((stack_size/(sizeof(ULONG))) * (sizeof(ULONG))) - (sizeof(ULONG));
/* Ensure the starting stack address is evenly aligned. */
new_stack_start = ((((ULONG) stack_start) + (sizeof(ULONG) - 1) ) & (~(sizeof(ULONG) - 1)));
new_stack_start = TX_POINTER_TO_ALIGN_TYPE_CONVERT(stack_start);
updated_stack_start = ((((ULONG) new_stack_start) + ((sizeof(ULONG)) - ((ULONG) 1)) ) & (~((sizeof(ULONG)) - ((ULONG) 1))));
/* Determine if the starting stack address is different. */
if (new_stack_start != ((ULONG) stack_start))
if (new_stack_start != updated_stack_start)
{
/* Yes, subtract another ULONG from the size to avoid going past the stack area. */
stack_size = stack_size - sizeof(ULONG);
stack_size = stack_size - (sizeof(ULONG));
}
/* Update the starting stack pointer. */
stack_start = (VOID *) new_stack_start;
stack_start = TX_ALIGN_TYPE_TO_POINTER_CONVERT(updated_stack_start);
#endif
/* Allocate the thread entry information at the top of thread's stack - Leaving one
@@ -326,6 +313,8 @@ ULONG status;
/* If this is a memory protected module, allocate a kernel stack. */
if((module_instance -> txm_module_instance_property_flags) & TXM_MODULE_MEMORY_PROTECTION)
{
ULONG status;
/* Allocate kernel stack space. */
status = _txm_module_manager_object_allocate((VOID **) &(thread_ptr -> tx_thread_module_kernel_stack_start), TXM_MODULE_KERNEL_STACK_SIZE, module_instance);
if(status)
@@ -353,20 +342,46 @@ ULONG status;
#endif
/* Place the supplied parameters into the thread's control block. */
thread_ptr -> tx_thread_name = name;
thread_ptr -> tx_thread_name = name_ptr;
thread_ptr -> tx_thread_entry = entry_function;
thread_ptr -> tx_thread_entry_parameter = entry_input;
thread_ptr -> tx_thread_stack_start = stack_start;
thread_ptr -> tx_thread_stack_size = stack_size;
thread_ptr -> tx_thread_stack_end = (VOID *) (((UCHAR *) stack_start) + (stack_size-1));
#if TXM_MODULE_MEMORY_PROTECTION
thread_ptr -> tx_thread_module_stack_end = thread_ptr -> tx_thread_stack_end;
#endif
thread_ptr -> tx_thread_priority = priority;
thread_ptr -> tx_thread_user_priority = priority;
thread_ptr -> tx_thread_time_slice = time_slice;
thread_ptr -> tx_thread_new_time_slice = time_slice;
thread_ptr -> tx_thread_inherit_priority = TX_MAX_PRIORITIES;
thread_ptr -> tx_thread_inherit_priority = ((UINT) TX_MAX_PRIORITIES);
#ifdef TX_THREAD_SMP
thread_ptr -> tx_thread_smp_core_executing = ((UINT) TX_THREAD_SMP_MAX_CORES);
thread_ptr -> tx_thread_smp_cores_excluded = ((ULONG) 0);
#ifndef TX_THREAD_SMP_DYNAMIC_CORE_MAX
thread_ptr -> tx_thread_smp_cores_allowed = ((ULONG) TX_THREAD_SMP_CORE_MASK);
#else
thread_ptr -> tx_thread_smp_cores_allowed = (((ULONG) 1) << _tx_thread_smp_max_cores) - 1;
#endif
#ifdef TX_THREAD_SMP_ONLY_CORE_0_DEFAULT
/* Default thread creation such that core0 is the only allowed core for execution, i.e., bit 1 is set to exclude core1. */
thread_ptr -> tx_thread_smp_cores_excluded = (TX_THREAD_SMP_CORE_MASK & 0xFFFFFFFE);
thread_ptr -> tx_thread_smp_cores_allowed = 1;
/* Default the timers to run on core 0 as well. */
thread_ptr -> tx_thread_timer.tx_timer_internal_smp_cores_excluded = (TX_THREAD_SMP_CORE_MASK & 0xFFFFFFFE);
/* Default the mapped to 0 too. */
thread_ptr -> tx_thread_smp_core_mapped = 0;
#endif
#endif
/* Calculate the end of the thread's stack area. */
temp_ptr = TX_VOID_TO_UCHAR_POINTER_CONVERT(stack_start);
temp_ptr = (TX_UCHAR_POINTER_ADD(temp_ptr, (stack_size - ((ULONG) 1))));
thread_ptr -> tx_thread_stack_end = TX_UCHAR_TO_VOID_POINTER_CONVERT(temp_ptr);
#if TXM_MODULE_MEMORY_PROTECTION
thread_ptr -> tx_thread_module_stack_end = thread_ptr -> tx_thread_stack_end;
#endif /* TXM_MODULE_MEMORY_PROTECTION */
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
@@ -381,8 +396,8 @@ ULONG status;
/* Preemption-threshold specified. Since specific preemption-threshold is not supported,
disable all preemption. */
thread_ptr -> tx_thread_preempt_threshold = 0;
thread_ptr -> tx_thread_user_preempt_threshold = 0;
thread_ptr -> tx_thread_preempt_threshold = ((UINT) 0);
thread_ptr -> tx_thread_user_preempt_threshold = ((UINT) 0);
}
else
{
@@ -399,6 +414,9 @@ ULONG status;
/* Setup the necessary fields in the thread timer block. */
TX_THREAD_CREATE_TIMEOUT_SETUP(thread_ptr)
/* Perform any additional thread setup activities for tool or user purpose. */
TX_THREAD_CREATE_INTERNAL_EXTENSION(thread_ptr)
/* Setup pointer to the thread entry information structure, which will live at the top of each
module thread's stack. This will allow the module thread entry function to avoid direct
access to the actual thread control block. */
@@ -420,9 +438,9 @@ ULONG status;
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
thread_entry_info -> txm_module_thread_entry_info_exit_notify = thread_ptr -> tx_thread_entry_exit_notify;
#else
#else /* TX_DISABLE_NOTIFY_CALLBACKS */
thread_entry_info -> txm_module_thread_entry_info_exit_notify = TX_NULL;
#endif
#endif /* TX_DISABLE_NOTIFY_CALLBACKS */
if (thread_ptr -> tx_thread_entry == module_instance -> txm_module_instance_start_thread_entry)
thread_entry_info -> txm_module_thread_entry_info_start_thread = TX_TRUE;
else
@@ -457,7 +475,7 @@ ULONG status;
/* Place the thread on the list of created threads. First,
check for an empty list. */
if (_tx_thread_created_count++ == 0)
if (_tx_thread_created_count == TX_EMPTY)
{
/* The created thread list is empty. Add thread to empty list. */
@@ -481,11 +499,14 @@ ULONG status;
thread_ptr -> tx_thread_created_next = next_thread;
}
/* Increment the thread created count. */
_tx_thread_created_count++;
/* If trace is enabled, register this object. */
TX_TRACE_OBJECT_REGISTER(TX_TRACE_OBJECT_TYPE_THREAD, thread_ptr, name, stack_start, stack_size)
TX_TRACE_OBJECT_REGISTER(TX_TRACE_OBJECT_TYPE_THREAD, thread_ptr, name_ptr, TX_POINTER_TO_ULONG_CONVERT(stack_start), stack_size)
/* If trace is enabled, insert this event into the trace buffer. */
TX_TRACE_IN_LINE_INSERT(TX_TRACE_THREAD_CREATE, thread_ptr, priority, stack_start, stack_size, TX_TRACE_THREAD_EVENTS)
TX_TRACE_IN_LINE_INSERT(TX_TRACE_THREAD_CREATE, thread_ptr, priority, TX_POINTER_TO_ULONG_CONVERT(stack_start), stack_size, TX_TRACE_THREAD_EVENTS)
/* Register thread in the thread array structure. */
TX_EL_THREAD_REGISTER(thread_ptr)
@@ -493,13 +514,131 @@ ULONG status;
/* Log this kernel call. */
TX_EL_THREAD_CREATE_INSERT
#ifdef TX_THREAD_SMP
#ifndef TX_NOT_INTERRUPTABLE
/* Temporarily disable preemption. */
_tx_thread_preempt_disable++;
#endif
/* Determine if an automatic start was requested. If so, call the resume
thread function and then check for a preemption condition. */
if (auto_start == TX_AUTO_START)
{
#ifdef TX_NOT_INTERRUPTABLE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Resume the thread! */
_tx_thread_system_ni_resume(thread_ptr);
#else
/* Restore previous interrupt posture. */
TX_RESTORE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Call the resume thread function to make this thread ready. */
_tx_thread_system_resume(thread_ptr);
/* Disable interrupts again. */
TX_DISABLE
#endif
/* Determine if the execution list needs to be re-evaluated. */
if (_tx_thread_smp_current_state_get() >= TX_INITIALIZE_IN_PROGRESS)
{
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
/* Clear the preemption bit maps, since nothing has yet run during initialization. */
TX_MEMSET(_tx_thread_preempted_maps, 0, sizeof(_tx_thread_preempted_maps));
#if TX_MAX_PRIORITIES > 32
_tx_thread_preempted_map_active = ((ULONG) 0);
#endif
/* Clear the entry in the preempted thread list. */
_tx_thread_preemption_threshold_list[priority] = TX_NULL;
#endif
/* Set the pointer to the thread currently with preemption-threshold set to NULL. */
_tx_thread_preemption__threshold_scheduled = TX_NULL;
#ifdef TX_THREAD_SMP_DEBUG_ENABLE
/* Debug entry. */
_tx_thread_smp_debug_entry_insert(12, 0, thread_ptr);
#endif
/* Get the core index. */
core_index = TX_SMP_CORE_ID;
/* Call the rebalance routine. This routine maps cores and ready threads. */
_tx_thread_smp_rebalance_execute_list(core_index);
#ifdef TX_THREAD_SMP_DEBUG_ENABLE
/* Debug entry. */
_tx_thread_smp_debug_entry_insert(13, 0, thread_ptr);
#endif
}
#ifndef TX_NOT_INTERRUPTABLE
/* Restore interrupts. */
TX_RESTORE
#endif
}
else
{
#ifdef TX_NOT_INTERRUPTABLE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Restore interrupts. */
TX_RESTORE
#else
/* Restore interrupts. */
TX_RESTORE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Disable interrupts. */
TX_DISABLE
/* Re-enable preemption. */
_tx_thread_preempt_disable--;
/* Restore interrupts. */
TX_RESTORE
/* Check for preemption. */
_tx_thread_system_preempt_check();
#endif
}
#else /* TX_THREAD_SMP */
#ifndef TX_NOT_INTERRUPTABLE
/* Temporarily disable preemption. */
_tx_thread_preempt_disable++;
#endif
/* Determine if an automatic start was requested. If so, call the resume
thread function and then check for a preemption condition. */
if (auto_start == TX_AUTO_START)
{
/* Determine if the create call is being called from initialization. */
if (TX_THREAD_GET_SYSTEM_STATE() >= TX_INITIALIZE_IN_PROGRESS)
{
@@ -533,7 +672,6 @@ ULONG status;
/* Simply set the saved thread pointer to NULL. */
saved_thread_ptr = TX_NULL;
}
#endif
#ifdef TX_NOT_INTERRUPTABLE
@@ -547,9 +685,6 @@ ULONG status;
TX_RESTORE
#else
/* Temporarily disable preemption. */
_tx_thread_preempt_disable++;
/* Restore previous interrupt posture. */
TX_RESTORE
@@ -560,8 +695,6 @@ ULONG status;
_tx_thread_system_resume(thread_ptr);
#endif
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
/* Determine if the thread's preemption-threshold needs to be restored. */
if (saved_thread_ptr != TX_NULL)
{
@@ -570,14 +703,40 @@ ULONG status;
can only happen if this routine is called from initialization. */
saved_thread_ptr -> tx_thread_preempt_threshold = saved_threshold;
}
#endif
/* Interrupts are already restored, simply return success. */
return(TX_SUCCESS);
}
else
{
#ifdef TX_NOT_INTERRUPTABLE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Restore interrupts. */
TX_RESTORE
#else
/* Restore interrupts. */
TX_RESTORE
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
/* Disable interrupts. */
TX_DISABLE
/* Re-enable preemption. */
_tx_thread_preempt_disable--;
/* Restore interrupts. */
TX_RESTORE
/* Check for preemption. */
_tx_thread_system_preempt_check();
#endif
}
#endif /* TX_THREAD_SMP */
/* Return success. */
return(TX_SUCCESS);

View File

@@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* tx_api.h PORTABLE SMP */
/* 6.1 */
/* 6.1.9 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -44,6 +44,29 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 10-16-2020 William E. Lamie Modified comment(s), and */
/* increased patch version, */
/* resulting in version 6.1.1 */
/* 12-31-2020 William E. Lamie Modified comment(s), and */
/* increased patch version, */
/* resulting in version 6.1.3 */
/* 03-02-2021 Scott Larson Modified comment(s), and */
/* order defines numerically, */
/* add option to remove FileX */
/* pointer, fix whitespace, */
/* resulting in version 6.1.5 */
/* 04-02-2021 Scott Larson Modified comment(s), and */
/* update patch number, */
/* resulting in version 6.1.6 */
/* 06-02-2021 Scott Larson Added options for multiple */
/* block pool search & delay, */
/* resulting in version 6.1.7 */
/* 08-02-2021 Scott Larson Modified comment(s), and */
/* update patch number, */
/* resulting in version 6.1.8 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), */
/* update patch number, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
@@ -74,6 +97,15 @@ extern "C" {
#endif
/* Define default block pool search and delay values. */
#ifndef TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH
#define TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH 20
#endif
#ifndef TX_BTYE_POOL_DELAY_VALUE
#define TX_BYTE_POOL_DELAY_VALUE 3
#endif
/* Define basic constants for the ThreadX kernel. */
@@ -83,7 +115,7 @@ extern "C" {
#define AZURE_RTOS_THREADX
#define THREADX_MAJOR_VERSION 6
#define THREADX_MINOR_VERSION 1
#define THREADX_PATCH_VERSION 0
#define THREADX_PATCH_VERSION 9
/* Define the following symbol for backward compatibility */
#define EL_PRODUCT_THREADX
@@ -144,7 +176,6 @@ extern "C" {
#define TX_SUCCESS ((UINT) 0x00)
#define TX_DELETED ((UINT) 0x01)
#define TX_NO_MEMORY ((UINT) 0x10)
#define TX_POOL_ERROR ((UINT) 0x02)
#define TX_PTR_ERROR ((UINT) 0x03)
#define TX_WAIT_ERROR ((UINT) 0x04)
@@ -159,6 +190,7 @@ extern "C" {
#define TX_NO_INSTANCE ((UINT) 0x0D)
#define TX_THREAD_ERROR ((UINT) 0x0E)
#define TX_PRIORITY_ERROR ((UINT) 0x0F)
#define TX_NO_MEMORY ((UINT) 0x10)
#define TX_START_ERROR ((UINT) 0x10)
#define TX_DELETE_ERROR ((UINT) 0x11)
#define TX_RESUME_ERROR ((UINT) 0x12)
@@ -443,7 +475,9 @@ typedef struct TX_THREAD_STRUCT
/************* End of ThreadX SMP thread control block extensions. *************/
/* Define a pointer type for FileX extensions. */
#ifndef TX_NO_FILEX_POINTER
VOID *tx_thread_filex_ptr;
#endif
/* Define the priority inheritance variables. These will be used
to manage priority inheritance changes applied to this thread
@@ -1178,7 +1212,6 @@ UINT _tx_el_interrupt_control(UINT new_posture);
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
/* Services with MULTI runtime error checking ThreadX. */
#define tx_block_allocate _txr_block_allocate
@@ -1736,7 +1769,6 @@ UINT _tx_trace_user_event_insert(ULONG event_id, ULONG info_field_1, ULON
UINT _tx_trace_interrupt_control(UINT new_posture);
/* Add a default macro that can be re-defined in tx_port.h to add default processing when a thread starts. Common usage
would be for enabling floating point for a thread by default, however, the additional processing could be anything
defined in tx_port.h. */

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -41,7 +41,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/

View File

@@ -201,8 +201,10 @@ TIMER_DECLARE ULONG _tx_timer_performance_expiration_count;
TIMER_DECLARE ULONG _tx_timer_performance__expiration_adjust_count;
#endif
/* Define default post timer delete macro to whitespace, if it hasn't been defined previously (typically in tx_port.h). */
#ifndef TX_TIMER_DELETE_PORT_COMPLETION
@@ -211,4 +213,3 @@ TIMER_DECLARE ULONG _tx_timer_performance__expiration_adjust_count;
#endif

View File

@@ -40,7 +40,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
@@ -524,6 +526,7 @@ VOID _tx_trace_initialize(VOID);
VOID _tx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2);
VOID _tx_trace_object_unregister(VOID *object_ptr);
#ifdef TX_ENABLE_EVENT_TRACE
/* Check for MISRA compliance requirements. */
@@ -556,6 +559,5 @@ UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFE
#endif
#endif
#endif
#endif

View File

@@ -26,7 +26,7 @@
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* tx_user.h PORTABLE C */
/* 6.1 */
/* 6.1.9 */
/* */
/* AUTHOR */
/* */
@@ -44,7 +44,20 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 03-02-2021 Scott Larson Modified comment(s), */
/* added option to remove */
/* FileX pointer, */
/* resulting in version 6.1.5 */
/* 06-02-2021 Scott Larson Added options for multiple */
/* block pool search & delay, */
/* resulting in version 6.1.7 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), added */
/* user-configurable symbol */
/* TX_TIMER_TICKS_PER_SECOND */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
@@ -74,6 +87,7 @@
TX_DISABLE_PREEMPTION_THRESHOLD
TX_DISABLE_REDUNDANT_CLEARING
TX_DISABLE_NOTIFY_CALLBACKS
TX_NO_FILEX_POINTER
TX_NOT_INTERRUPTABLE
TX_TIMER_PROCESS_IN_ISR
@@ -96,6 +110,25 @@
#define TX_TIMER_THREAD_PRIORITY ????
*/
/* Define the common timer tick reference for use by other middleware components. The default
value is 10ms (i.e. 100 ticks, defined in tx_api.h), but may be replaced by a port-specific
version in tx_port.h or here.
Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */
/*
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
*/
/* Determine if there is a FileX pointer in the thread control block.
By default, the pointer is there for legacy/backwards compatibility.
The pointer must also be there for applications using FileX.
Define this to save space in the thread control block.
*/
/*
#define TX_NO_FILEX_POINTER
*/
/* Determine if timer expirations (application timers, timeouts, and tx_thread_sleep calls
should be processed within the a system timer thread or directly in the timer ISR.
By default, the timer thread is used. When the following is defined, the timer expiration
@@ -153,7 +186,7 @@
processing when not needed. The user will also have to comment out the call to
tx_timer_interrupt, which is typically made from assembly language in
tx_initialize_low_level. Note: if TX_NO_TIMER is used, the define TX_TIMER_PROCESS_IN_ISR
must also be used. */
must also be used and tx_timer_initialize must be removed from ThreadX library. */
/*
#define TX_NO_TIMER
@@ -253,5 +286,17 @@
#define TX_TIMER_ENABLE_PERFORMANCE_INFO
*/
/* Override options for byte pool searches of multiple blocks. */
/*
#define TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH 20
*/
/* Override options for byte pool search delay to avoid thrashing. */
/*
#define TX_BYTE_POOL_DELAY_VALUE 3
*/
#endif

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_block_pool_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_delete(TX_BLOCK_POOL *pool_ptr)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,

View File

@@ -102,7 +102,12 @@ ULONG _tx_block_pool_performance_timeout_count;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* opt out of function when */
/* TX_INLINE_INITIALIZATION is */
/* defined, */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_block_pool_initialize(VOID)

View File

@@ -75,7 +75,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_performance_info_get(TX_BLOCK_POOL *pool_ptr, ULONG *allocates, ULONG *releases,

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_performance_system_info_get(ULONG *allocates, ULONG *releases, ULONG *suspensions, ULONG *timeouts)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_block_release(VOID *block_ptr)

View File

@@ -74,7 +74,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size, ULONG wait_option)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_byte_pool_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)

View File

@@ -68,7 +68,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start, ULONG pool_size)

View File

@@ -73,7 +73,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes,

View File

@@ -117,7 +117,12 @@ ULONG _tx_byte_pool_performance_timeout_count;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* opt out of function when */
/* TX_INLINE_INITIALIZATION is */
/* defined, */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_byte_pool_initialize(VOID)

View File

@@ -83,7 +83,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_performance_info_get(TX_BYTE_POOL *pool_ptr, ULONG *allocates, ULONG *releases,

View File

@@ -80,7 +80,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_performance_system_info_get(ULONG *allocates, ULONG *releases,

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr)

View File

@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _tx_byte_pool_search PORTABLE SMP */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
@@ -77,6 +77,10 @@
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 06-02-2021 Scott Larson Improve possible free bytes */
/* calculation, and reduced */
/* number of search resets, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
@@ -94,7 +98,8 @@ UINT first_free_block_found = TX_FALSE;
TX_THREAD *thread_ptr;
ALIGN_TYPE *free_ptr;
UCHAR *work_ptr;
volatile ULONG delay_count;
ULONG total_theoretical_available;
#ifdef TX_BYTE_POOL_MULTIPLE_BLOCK_SEARCH
UINT blocks_searched = ((UINT) 0);
#endif
@@ -104,7 +109,9 @@ UINT blocks_searched = ((UINT) 0);
TX_DISABLE
/* First, determine if there are enough bytes in the pool. */
if (memory_size >= pool_ptr -> tx_byte_pool_available)
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
if (memory_size >= total_theoretical_available)
{
/* Restore interrupts. */
@@ -148,7 +155,6 @@ UINT blocks_searched = ((UINT) 0);
/* Determine if this is the first free block. */
if (first_free_block_found == TX_FALSE)
{
/* This is the first free block. */
pool_ptr->tx_byte_pool_search = current_ptr;
@@ -171,7 +177,6 @@ UINT blocks_searched = ((UINT) 0);
has been satisfied! */
if (available_bytes >= memory_size)
{
/* Get out of the search loop! */
break;
}
@@ -210,14 +215,12 @@ UINT blocks_searched = ((UINT) 0);
/* See if the search pointer is affected. */
if (pool_ptr -> tx_byte_pool_search == next_ptr)
{
/* Yes, update the search pointer. */
pool_ptr -> tx_byte_pool_search = current_ptr;
}
}
else
{
/* Neighbor is not free so we can skip over it! */
next_block_link_ptr = TX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr);
current_ptr = *next_block_link_ptr;
@@ -283,11 +286,22 @@ UINT blocks_searched = ((UINT) 0);
/* Disable interrupts. */
TX_DISABLE
#endif
/* Determine if anything has changed in terms of pool ownership. */
if (pool_ptr -> tx_byte_pool_owner != thread_ptr)
{
/* Loop to delay changing the ownership back to avoid thrashing. */
delay_count = 0;
do
{
/* Restore interrupts temporarily. */
TX_RESTORE
/* Increment the delay counter. */
delay_count++;
/* Disable interrupts. */
TX_DISABLE
} while (delay_count < ((ULONG) TX_BYTE_POOL_DELAY_VALUE));
/* Pool changed ownership in the brief period interrupts were
enabled. Reset the search. */
current_ptr = pool_ptr -> tx_byte_pool_search;

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_byte_release(VOID *memory_ptr)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_event_flags_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr)

View File

@@ -73,7 +73,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,

View File

@@ -74,7 +74,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_flags,

View File

@@ -103,7 +103,12 @@ ULONG _tx_event_flags_performance_timeout_count;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* opt out of function when */
/* TX_INLINE_INITIALIZATION is */
/* defined, */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_event_flags_initialize(VOID)

View File

@@ -76,7 +76,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_performance_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG *sets, ULONG *gets,

View File

@@ -73,7 +73,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_performance_system_info_get(ULONG *sets, ULONG *gets, ULONG *suspensions, ULONG *timeouts)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_event_flags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *notify_group_ptr))

View File

@@ -105,7 +105,9 @@ VOID *_tx_initialize_unused_memory;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_initialize_high_level(VOID)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_mutex_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)
@@ -249,7 +251,9 @@ TX_THREAD *previous_thread;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_mutex_thread_release(TX_THREAD *thread_ptr)

View File

@@ -68,7 +68,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_delete(TX_MUTEX *mutex_ptr)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option)

View File

@@ -73,7 +73,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,

View File

@@ -112,7 +112,12 @@ ULONG _tx_mutex_performance__priority_inheritance_count;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* opt out of function when */
/* TX_INLINE_INITIALIZATION is */
/* defined, */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_mutex_initialize(VOID)

View File

@@ -78,7 +78,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_performance_info_get(TX_MUTEX *mutex_ptr, ULONG *puts, ULONG *gets,

View File

@@ -77,7 +77,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_performance_system_info_get(ULONG *puts, ULONG *gets, ULONG *suspensions,

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_prioritize(TX_MUTEX *mutex_ptr)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_mutex_put(TX_MUTEX *mutex_ptr)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_queue_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,

View File

@@ -68,7 +68,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_delete(TX_QUEUE *queue_ptr)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_flush(TX_QUEUE *queue_ptr)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,

View File

@@ -110,7 +110,12 @@ ULONG _tx_queue_performance_timeout_count;
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* opt out of function when */
/* TX_INLINE_INITIALIZATION is */
/* defined, */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_queue_initialize(VOID)

View File

@@ -77,7 +77,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_performance_info_get(TX_QUEUE *queue_ptr, ULONG *messages_sent, ULONG *messages_received,

View File

@@ -77,7 +77,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_performance_system_info_get(ULONG *messages_sent, ULONG *messages_received,

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_prioritize(TX_QUEUE *queue_ptr)

View File

@@ -74,7 +74,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option)

View File

@@ -72,7 +72,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr))

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling)

View File

@@ -70,7 +70,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_semaphore_cleanup(TX_THREAD *thread_ptr, ULONG suspension_sequence)

View File

@@ -67,7 +67,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count)

View File

@@ -69,7 +69,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_semaphore_delete(TX_SEMAPHORE *semaphore_ptr)

View File

@@ -68,7 +68,9 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option)

Some files were not shown because too many files have changed in this diff Show More