mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Fix MacOS Posix port (#957)
PR #914 caused Posix Port to fail to build on MacOS. This PR fixes teh build failure. This PR also adds a Matrix configuration to the GitHub kernel-demo workflow to build the Posix Demos on MacOS. --------- Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
14dd5b503a
commit
b1ee2e6e14
9
.github/workflows/kernel-demos.yml
vendored
9
.github/workflows/kernel-demos.yml
vendored
|
@ -65,7 +65,13 @@ jobs:
|
||||||
|
|
||||||
POSIX-GCC:
|
POSIX-GCC:
|
||||||
name: Native GCC
|
name: Native GCC
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- macos-latest
|
||||||
|
- ubuntu-latest
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the FreeRTOS/FreeRTOS Repository
|
- name: Checkout the FreeRTOS/FreeRTOS Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -83,6 +89,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install GCC
|
- name: Install GCC
|
||||||
shell: bash
|
shell: bash
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install build-essential
|
sudo apt-get -y install build-essential
|
||||||
|
|
12
portable/ThirdParty/GCC/Posix/port.c
vendored
12
portable/ThirdParty/GCC/Posix/port.c
vendored
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -281,9 +282,14 @@ BaseType_t xPortStartScheduler( void )
|
||||||
*/
|
*/
|
||||||
xSchedulerEnd = pdFALSE;
|
xSchedulerEnd = pdFALSE;
|
||||||
|
|
||||||
/* Reset the pthread_once_t structure. This is required if the port
|
/* Reset pthread_once_t, needed to restart the scheduler again.
|
||||||
* starts the scheduler again. */
|
* memset the internal struct members for MacOS/Linux Compatability */
|
||||||
hSigSetupThread = PTHREAD_ONCE_INIT;
|
#if __APPLE__
|
||||||
|
hSigSetupThread.__sig = _PTHREAD_ONCE_SIG_init;
|
||||||
|
memset( ( void * ) &hSigSetupThread.__opaque, 0, sizeof(hSigSetupThread.__opaque));
|
||||||
|
#else /* Linux PTHREAD library*/
|
||||||
|
hSigSetupThread = PTHREAD_ONCE_INIT;
|
||||||
|
#endif /* __APPLE__*/
|
||||||
|
|
||||||
/* Restore original signal mask. */
|
/* Restore original signal mask. */
|
||||||
( void ) pthread_sigmask( SIG_SETMASK, &xSchedulerOriginalSignalMask, NULL );
|
( void ) pthread_sigmask( SIG_SETMASK, &xSchedulerOriginalSignalMask, NULL );
|
||||||
|
|
Loading…
Reference in a new issue