Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f092208
Added tx_thread_extension_ptr to TX_THREAD_EXTENSION_1 for win64
fdesbiens Jun 18, 2026
4d6be52
Reduced the Win64 timer period for faster tests
fdesbiens Jun 18, 2026
00f93ea
Brought win32 port timer and scheduler to parity with win64
fdesbiens Jun 22, 2026
7a73213
Fixed missing closing #endif in tx_port.h
fdesbiens Jun 23, 2026
5340242
Brought the Win32 timer and scheduler to parity with Win64
fdesbiens Jun 25, 2026
a8e65ba
Removed duplicate Win32 scheduler declarations
fdesbiens Jun 25, 2026
6754274
Fixed exit deadlock in win32 port timer infrastructure
fdesbiens Jun 29, 2026
9f187d7
Improved Win64 scheduler performance with spin-poll and tick batching
fdesbiens Jul 24, 2026
f5b4af9
Added idle fast-forward to Win64 simulator for faster tests
fdesbiens Jul 28, 2026
f43e0d6
Added idle fast-forward and tick batching to Win32 simulator
fdesbiens Jul 28, 2026
c7a1e49
Fixed ThreadX win32 regression build and thread execution test
fdesbiens Jul 29, 2026
b41f0b7
Increased the Windows simulator memory pool
fdesbiens Aug 5, 2026
4b96b08
Optimized Windows simulator interrupt locking
fdesbiens Aug 11, 2026
2223751
Aligned Win32 scheduler handoffs with Win64
fdesbiens Aug 11, 2026
0f1b1d9
Bounded Win32 application-thread handoff spins
fdesbiens Aug 11, 2026
7acbd95
Added required Codex disclosures
fdesbiens Sep 1, 2026
3f33633
Fixed trace entry test on 64-bit ports
fdesbiens Sep 2, 2026
9e4ef09
Ported SMP teardown diagnostics to Windows
fdesbiens Sep 2, 2026
2ba4913
Added the required Codex disclosure to the trace regression
fdesbiens Sep 3, 2026
1a87bcb
Merged current dev into the Windows simulator refresh
fdesbiens Sep 11, 2026
1a0247b
Fixed thread-transition tests for MSVC
fdesbiens Sep 11, 2026
649556f
Shortened MSVC thread-transition target paths
fdesbiens Sep 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions ports/win32/vs_2019/inc/tx_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* SPDX-License-Identifier: MIT
**************************************************************************/

// Some portions generated by Codex (gpt-5.6-sol).


/**************************************************************************/
/**************************************************************************/
Expand Down Expand Up @@ -63,6 +65,7 @@

/* Define compiler library include files. */

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -303,9 +306,10 @@ void _tx_initialize_start_interrupts(void);
#define TX_THREAD_EXTENSION_0 HANDLE tx_thread_win32_thread_handle; \
DWORD tx_thread_win32_thread_id; \
HANDLE tx_thread_win32_thread_run_semaphore; \
HANDLE tx_thread_win32_thread_start_semaphore; \
UINT tx_thread_win32_suspension_type; \
UINT tx_thread_win32_int_disabled_flag;
#define TX_THREAD_EXTENSION_1
#define TX_THREAD_EXTENSION_1 VOID *tx_thread_extension_ptr;
#define TX_THREAD_EXTENSION_2
#define TX_THREAD_EXTENSION_3

Expand Down Expand Up @@ -361,13 +365,27 @@ void _tx_initialize_start_interrupts(void);
#define TX_TIMER_DELETE_EXTENSION(timer_ptr)


/* Store the owning object pointer in the internal timer so timeout handlers can
recover it via a pointer field rather than the ULONG timeout parameter. This
matches the Win64 port and satisfies NetXDuo/USBX default extension macros
that reference tx_timer_internal_extension_ptr / tx_thread_extension_ptr. */

#define TX_TIMER_INTERNAL_EXTENSION VOID *tx_timer_internal_extension_ptr;

#define TX_THREAD_CREATE_TIMEOUT_SETUP(t) (t) -> tx_thread_timer.tx_timer_internal_timeout_function = &(_tx_thread_timeout); \
(t) -> tx_thread_timer.tx_timer_internal_timeout_param = 0; \
(t) -> tx_thread_timer.tx_timer_internal_extension_ptr = (VOID *) (t);

#define TX_THREAD_TIMEOUT_POINTER_SETUP(t) (t) = (TX_THREAD *) _tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr;


struct TX_THREAD_STRUCT;

/* Define the Win32 critical section data structure. */

typedef struct TX_WIN32_CRITICAL_SECTION_STRUCT
{
HANDLE tx_win32_critical_section_mutex_handle;
CRITICAL_SECTION tx_win32_critical_section_lock;
DWORD tx_win32_critical_section_owner;
ULONG tx_win32_critical_section_nested_count;
} TX_WIN32_CRITICAL_SECTION;
Expand Down Expand Up @@ -475,24 +493,40 @@ extern CHAR _tx_version_id[];

extern TX_WIN32_CRITICAL_SECTION _tx_win32_critical_section;
extern HANDLE _tx_win32_scheduler_semaphore;
extern HANDLE _tx_win32_scheduler_wake_event;
extern DWORD _tx_win32_scheduler_id;
extern ULONG _tx_win32_global_int_disabled_flag;
extern LARGE_INTEGER _tx_win32_time_stamp;
extern ULONG _tx_win32_system_error;
extern HANDLE _tx_win32_timer_handle;
extern HANDLE _tx_win32_timer_thread_handle;
extern HANDLE _tx_win32_isr_semaphore;
extern UINT _tx_win32_timer_id;
extern LARGE_INTEGER _tx_win32_time_stamp;
extern UINT _tx_win32_timer_waiting;
#ifdef TX_WIN32_NO_IDLE_ENABLE
extern HANDLE _tx_win32_timer_kick_event;
#endif

VOID _tx_win32_scheduler_wake(VOID);


#ifndef TX_WIN32_USE_HIGH_RESOLUTION_TIMER
#define TX_WIN32_USE_HIGH_RESOLUTION_TIMER 1
#endif

#ifndef TX_WIN32_HANDOFF_SPIN_COUNT
#define TX_WIN32_HANDOFF_SPIN_COUNT 64
#endif

#ifndef TX_WIN32_MEMORY_SIZE
#define TX_WIN32_MEMORY_SIZE 64000
#define TX_WIN32_MEMORY_SIZE 256000
#endif

#ifndef TX_TIMER_PERIODIC
#ifdef TX_WIN32_SLOW_TIMER
#define TX_TIMER_PERIODIC TX_WIN32_SLOW_TIMER
#else
#define TX_TIMER_PERIODIC 10
#define TX_TIMER_PERIODIC 1
#endif
#endif

Expand Down
Loading