Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for 64bit Windows port #1011

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions portable/MSVC-MingW/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,19 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
FALSE, /* Start not signalled. */
NULL ); /* No name. */


#ifdef __GNUC__
/* GCC reports the warning for the cast operation from TaskFunction_t to LPTHREAD_START_ROUTINE. */
/* Disable this warning here by the #pragma option. */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
/* Create the thread itself. */
pxThreadState->pvThread = CreateThread( NULL, xStackSize, ( LPTHREAD_START_ROUTINE ) pxCode, pvParameters, CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, NULL );
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

configASSERT( pxThreadState->pvThread ); /* See comment where TerminateThread() is called. */
SetThreadAffinityMask( pxThreadState->pvThread, 0x01 );
SetThreadPriorityBoost( pxThreadState->pvThread, TRUE );
Expand Down
11 changes: 10 additions & 1 deletion portable/MSVC-MingW/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,18 @@ typedef portSTACK_TYPE StackType_t;
typedef uint32_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL

/* 32/64-bit tick type on a 32/64-bit architecture, so reads of the tick
/* 32-bit tick type on a 32/64-bit architecture, so reads of the tick
* count do not need to be guarded with a critical section. */
#define portTICK_TYPE_IS_ATOMIC 1
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
typedef uint64_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffffffffffULL

#if defined( __x86_64__ ) || defined( _M_X64 )
/* 64-bit tick type on a 64-bit architecture, so reads of the tick
* count do not need to be guarded with a critical section. */
#define portTICK_TYPE_IS_ATOMIC 1
#endif
#else
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
#endif
Expand Down
Loading