diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a319046 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: Build Check +on: + push: + pull_request: + workflow_dispatch: + +env: + bashPass: \033[32;1mPASSED - + bashWarn: \033[33;1mWARNING - + bashFail: \033[31;1mFAILED - + bashEnd: \033[0m + +jobs: + BUILD-CHECK: + name: Build Check + runs-on: ubuntu-latest + steps: + - env: + stepName: Checkout Repository + name: ${{ env.stepName }} + uses: actions/checkout@v4 + + - env: + stepName: Install Tools + name: ${{ env.stepName }} + shell: bash + run: | + # ${{ env.stepName }} + echo -e "::group::${{ env.stepName }}" + set +e + sudo apt-get -y update + sudo apt-get -y install build-essential + exitStatus=$? + set -e + echo -e "::endgroup::" + if [ $exitStatus -eq 0 ]; then + echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" + else + echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" + exit 1 + fi + + - env: + stepName: Build + name: ${{ env.stepName }} + id: build-test + shell: bash + working-directory: test/posix_build_test + run: | + # ${{ env.stepName }} + echo -e "::group::${{ env.stepName }}" + set +e + cmake -S . -B build + make -C build -j + exitStatus=$? + set -e + echo -e "::endgroup::" + if [ $exitStatus -eq 0 ]; then + echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}" + else + echo -e "${{ env.bashFail }} ${{ env.stepName }} ${{ env.bashEnd }}" + exit 1 + fi diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c index 51e592a..6dc024c 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c @@ -202,7 +202,11 @@ int clock_settime( clockid_t clock_id, /* This function is currently unsupported. It will always return -1 and * set errno to EPERM. */ - errno = EPERM; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EPERM; + } + #endif return -1; } @@ -221,7 +225,11 @@ int nanosleep( const struct timespec * rqtp, /* Check rqtp. */ if( UTILS_ValidateTimespec( rqtp ) == false ) { - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif iStatus = -1; } diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c index 9f9079b..88a312b 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c @@ -440,7 +440,11 @@ int mq_close( mqd_t mqdes ) else { /* Queue not found; bad descriptor. */ - errno = EBADF; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EBADF; + } + #endif iStatus = -1; } @@ -479,7 +483,11 @@ int mq_getattr( mqd_t mqdes, else { /* Queue not found; bad descriptor. */ - errno = EBADF; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EBADF; + } + #endif iStatus = -1; } @@ -518,7 +526,11 @@ mqd_t mq_open( const char * name, if( prvValidateQueueName( name, &xNameLength ) == pdFALSE ) { /* Invalid name. */ - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif xMessageQueue = ( mqd_t ) -1; } @@ -528,7 +540,11 @@ mqd_t mq_open( const char * name, if( ( oflag & O_CREAT ) && ( attr != NULL ) && ( ( attr->mq_maxmsg <= 0 ) || ( attr->mq_msgsize <= 0 ) ) ) { /* Invalid mq_attr.mq_maxmsg or mq_attr.mq_msgsize. */ - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif xMessageQueue = ( mqd_t ) -1; } } @@ -548,7 +564,11 @@ mqd_t mq_open( const char * name, * O_CREAT and O_EXCL. */ if( ( oflag & O_EXCL ) && ( oflag & O_CREAT ) ) { - errno = EEXIST; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EEXIST; + } + #endif xMessageQueue = ( mqd_t ) -1; } else @@ -557,7 +577,11 @@ mqd_t mq_open( const char * name, if( ( ( QueueListElement_t * ) xMessageQueue )->xPendingUnlink == pdTRUE ) { /* Queue pending deletion. Don't allow it to be re-opened. */ - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif xMessageQueue = ( mqd_t ) -1; } else @@ -588,13 +612,21 @@ mqd_t mq_open( const char * name, name, xNameLength ) == pdFALSE ) { - errno = ENOSPC; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ENOSPC; + } + #endif xMessageQueue = ( mqd_t ) -1; } } else { - errno = ENOENT; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ENOENT; + } + #endif xMessageQueue = ( mqd_t ) -1; } } @@ -651,7 +683,11 @@ ssize_t mq_timedreceive( mqd_t mqdes, if( prvFindQueueInList( NULL, NULL, mqdes ) == pdFALSE ) { /* Queue not found; bad descriptor. */ - errno = EBADF; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EBADF; + } + #endif xStatus = -1; } @@ -661,7 +697,11 @@ ssize_t mq_timedreceive( mqd_t mqdes, if( msg_len < ( size_t ) pxMessageQueue->xAttr.mq_msgsize ) { /* msg_len too small. */ - errno = EMSGSIZE; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EMSGSIZE; + } + #endif xStatus = -1; } } @@ -675,7 +715,11 @@ ssize_t mq_timedreceive( mqd_t mqdes, if( iCalculateTimeoutReturn != 0 ) { - errno = iCalculateTimeoutReturn; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = iCalculateTimeoutReturn; + } + #endif xStatus = -1; } } @@ -694,12 +738,20 @@ ssize_t mq_timedreceive( mqd_t mqdes, if( pxMessageQueue->xAttr.mq_flags & O_NONBLOCK ) { /* Set errno to EAGAIN for nonblocking mq. */ - errno = EAGAIN; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EAGAIN; + } + #endif } else { /* Otherwise, set errno to ETIMEDOUT. */ - errno = ETIMEDOUT; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ETIMEDOUT; + } + #endif } xStatus = -1; @@ -743,7 +795,11 @@ int mq_timedsend( mqd_t mqdes, if( prvFindQueueInList( NULL, NULL, mqdes ) == pdFALSE ) { /* Queue not found; bad descriptor. */ - errno = EBADF; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EBADF; + } + #endif iStatus = -1; } @@ -753,7 +809,11 @@ int mq_timedsend( mqd_t mqdes, if( msg_len > ( size_t ) pxMessageQueue->xAttr.mq_msgsize ) { /* msg_len too large. */ - errno = EMSGSIZE; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EMSGSIZE; + } + #endif iStatus = -1; } } @@ -767,7 +827,11 @@ int mq_timedsend( mqd_t mqdes, if( iCalculateTimeoutReturn != 0 ) { - errno = iCalculateTimeoutReturn; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = iCalculateTimeoutReturn; + } + #endif iStatus = -1; } } @@ -785,7 +849,11 @@ int mq_timedsend( mqd_t mqdes, if( xSendData.pcData == NULL ) { /* msg_len too large. */ - errno = EMSGSIZE; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EMSGSIZE; + } + #endif iStatus = -1; } else @@ -806,12 +874,20 @@ int mq_timedsend( mqd_t mqdes, if( pxMessageQueue->xAttr.mq_flags & O_NONBLOCK ) { /* Set errno to EAGAIN for nonblocking mq. */ - errno = EAGAIN; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EAGAIN; + } + #endif } else { /* Otherwise, set errno to ETIMEDOUT. */ - errno = ETIMEDOUT; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ETIMEDOUT; + } + #endif } /* Free the allocated queue data. */ @@ -840,7 +916,11 @@ int mq_unlink( const char * name ) if( prvValidateQueueName( name, &xNameSize ) == pdFALSE ) { /* Error with mq name. */ - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif iStatus = -1; } @@ -873,7 +953,11 @@ int mq_unlink( const char * name ) else { /* The named message queue doesn't exist. */ - errno = ENOENT; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ENOENT; + } + #endif iStatus = -1; } diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c index 5fb903f..82ec0f5 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c @@ -54,7 +54,7 @@ static bool prvInitializeStaticCond( pthread_cond_internal_t * pxCond ); static bool prvInitializeStaticCond( pthread_cond_internal_t * pxCond ) { - unsigned i = 0; + int i = 0; /* Check if the condition variable needs to be initialized. */ if( pxCond->xIsInitialized == pdFALSE ) @@ -92,7 +92,7 @@ static bool prvInitializeStaticCond( pthread_cond_internal_t * pxCond ) int pthread_cond_broadcast( pthread_cond_t * cond ) { - unsigned i = 0; + int i = 0; pthread_cond_internal_t * pxCond = ( pthread_cond_internal_t * ) ( cond ); /* If the cond is uninitialized, perform initialization. */ @@ -138,7 +138,7 @@ int pthread_cond_destroy( pthread_cond_t * cond ) int pthread_cond_init( pthread_cond_t * cond, const pthread_condattr_t * attr ) { - unsigned i = 0; + int i = 0; int iStatus = 0; pthread_cond_internal_t * pxCond = ( pthread_cond_internal_t * ) cond; @@ -178,7 +178,7 @@ int pthread_cond_init( pthread_cond_t * cond, int pthread_cond_signal( pthread_cond_t * cond ) { - unsigned i = 0; + int i = 0; TaskHandle_t* xTaskToNotify = NULL; pthread_cond_internal_t * pxCond = ( pthread_cond_internal_t * ) ( cond ); @@ -188,7 +188,7 @@ int pthread_cond_signal( pthread_cond_t * cond ) return ENOMEM; } - /* Enter critical section to protect task list access and + /* Enter critical section to protect task list access and * prevent this task from being switched out while notifying * the blocked task */ taskENTER_CRITICAL(); @@ -238,7 +238,7 @@ int pthread_cond_timedwait( pthread_cond_t * cond, pthread_mutex_t * mutex, const struct timespec * abstime ) { - unsigned i = 0; + int i = 0; int iStatus = 0; bool iSet = pdFALSE; pthread_cond_internal_t * pxCond = ( pthread_cond_internal_t * ) ( cond ); @@ -269,7 +269,7 @@ int pthread_cond_timedwait( pthread_cond_t * cond, if( iStatus == 0 ) { - /* Enter critical section to protect task list access and + /* Enter critical section to protect task list access and * prevent this task from being switched out while adding * itself to the notify list */ taskENTER_CRITICAL(); diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c index 6a83150..bf4acd9 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c @@ -84,7 +84,11 @@ int sem_init( sem_t * sem, /* Check value parameter. */ if( value > SEM_VALUE_MAX ) { - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif iStatus = -1; } @@ -182,11 +186,19 @@ int sem_timedwait( sem_t * sem, { if( iStatus == 0 ) { - errno = ETIMEDOUT; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ETIMEDOUT; + } + #endif } else { - errno = iStatus; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = iStatus; + } + #endif } iStatus = -1; @@ -214,10 +226,14 @@ int sem_trywait( sem_t * sem ) /* POSIX specifies that this function should set errno to EAGAIN and not * ETIMEDOUT. */ - if( ( iStatus == -1 ) && ( errno == ETIMEDOUT ) ) + #if ( configUSE_POSIX_ERRNO == 1 ) { - errno = EAGAIN; + if( ( iStatus == -1 ) && ( errno == ETIMEDOUT ) ) + { + errno = EAGAIN; + } } + #endif return iStatus; } diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c index 8fe20f5..0b945d3 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c @@ -59,6 +59,14 @@ typedef struct timer_internal /*-----------------------------------------------------------*/ +static void * prvInvokeApplicationTimerCallback( void * arg ) +{ + timer_internal_t * pxTimer = ( timer_internal_t * ) arg; + pxTimer->xTimerEvent.sigev_notify_function( pxTimer->xTimerEvent.sigev_value ); + return NULL; +} +/*-----------------------------------------------------------*/ + void prvTimerCallback( TimerHandle_t xTimer ) { timer_internal_t * pxTimer = ( timer_internal_t * ) pvTimerGetTimerID( xTimer ); @@ -91,8 +99,8 @@ void prvTimerCallback( TimerHandle_t xTimer ) { ( void ) pthread_create( &xTimerNotificationThread, pxTimer->xTimerEvent.sigev_notify_attributes, - ( void * ( * )( void * ) )pxTimer->xTimerEvent.sigev_notify_function, - pxTimer->xTimerEvent.sigev_value.sival_ptr ); + prvInvokeApplicationTimerCallback, + pxTimer ); } } pxTimer->uxTimerCallbackInvocations++; @@ -114,7 +122,11 @@ int timer_create( clockid_t clockid, * sigev_notify is SIGEV_SIGNAL. SIGEV_SIGNAL is currently not supported. */ if( ( evp == NULL ) || ( evp->sigev_notify == SIGEV_SIGNAL ) ) { - errno = ENOTSUP; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = ENOTSUP; + } + #endif iStatus = -1; } @@ -125,7 +137,11 @@ int timer_create( clockid_t clockid, if( pxTimer == NULL ) { - errno = EAGAIN; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EAGAIN; + } + #endif iStatus = -1; } } @@ -206,7 +222,11 @@ int timer_settime( timer_t timerid, if( ( UTILS_ValidateTimespec( &value->it_interval ) == false ) || ( UTILS_ValidateTimespec( &value->it_value ) == false ) ) { - errno = EINVAL; + #if ( configUSE_POSIX_ERRNO == 1 ) + { + errno = EINVAL; + } + #endif iStatus = -1; } } diff --git a/test/posix_build_test/.gitignore b/test/posix_build_test/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/test/posix_build_test/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/test/posix_build_test/CMakeLists.txt b/test/posix_build_test/CMakeLists.txt new file mode 100644 index 0000000..6f50e2b --- /dev/null +++ b/test/posix_build_test/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required( VERSION 3.22 ) + +project( posix_demo ) + +include( FetchContent ) + +FetchContent_Declare( FreeRTOS_Kernel + GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Kernel.git + GIT_TAG V11.2.0 ) + +set( FREERTOS_PLUS_POSIX_PATH "../../" ) + +add_compile_options( -Wall -Wextra -Wno-unused-function -Wno-shift-count-overflow ) + +# Add the freertos_config for FreeRTOS-Kernel. +add_library( freertos_config INTERFACE ) + +target_include_directories( freertos_config + INTERFACE + ./ ) + +# Select the heap port. +set( FREERTOS_HEAP "3" CACHE STRING "" FORCE ) + +# Select the FreeRTOS port. +set( FREERTOS_PORT "GCC_POSIX" CACHE STRING "" FORCE ) + +# Fetch FreeRTOS-Kernel. +FetchContent_MakeAvailable( FreeRTOS_Kernel ) + +file( GLOB FREERTOS_PLUS_POSIX_SOURCES + ${FREERTOS_PLUS_POSIX_PATH}/FreeRTOS-Plus-POSIX/source/*.c ) + +add_executable( posix_demo + main.c + ${FREERTOS_PLUS_POSIX_SOURCES} ) + +target_include_directories( posix_demo + PRIVATE + ${FREERTOS_PLUS_POSIX_PATH}/include + ${FREERTOS_PLUS_POSIX_PATH}/include/private + ${FREERTOS_PLUS_POSIX_PATH}/FreeRTOS-Plus-POSIX/include + ${FREERTOS_PLUS_POSIX_PATH}/FreeRTOS-Plus-POSIX/include/portable + ${FREERTOS_PLUS_POSIX_PATH}/FreeRTOS-Plus-POSIX/include/portable/pc/windows ) + +target_link_libraries( posix_demo freertos_kernel freertos_config ) diff --git a/test/posix_build_test/FreeRTOSConfig.h b/test/posix_build_test/FreeRTOSConfig.h new file mode 100644 index 0000000..c5abf20 --- /dev/null +++ b/test/posix_build_test/FreeRTOSConfig.h @@ -0,0 +1,123 @@ +/* + * Amazon FreeRTOS POSIX V1.1.0 + * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://aws.amazon.com/freertos + * http://www.FreeRTOS.org + */ +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- +* Application specific definitions. +* +* These definitions should be adjusted for your particular hardware and +* application requirements. +* +* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE +* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. See +* https://www.FreeRTOS.org/a00110.html +*----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 +#define configTICK_RATE_HZ ( 1000 ) +#define configMINIMAL_STACK_SIZE ( 256 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 64 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 12 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 20 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_ALTERNATIVE_API 0 +#define configUSE_QUEUE_SETS 1 +#define configUSE_TASK_NOTIFICATIONS 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configRECORD_STACK_HIGH_ADDRESS 1 +#define configUSE_MALLOC_FAILED_HOOK 0 +#define configUSE_POSIX_ERRNO 1 +#define configKERNEL_PROVIDED_STATIC_MEMORY 1 + +/* Software timer related configuration options. The maximum possible task + * priority is configMAX_PRIORITIES - 1. The priority of the timer task is + * deliberately set higher to ensure it is correctly capped back to + * configMAX_PRIORITIES - 1. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define configTIMER_QUEUE_LENGTH 20 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) + +#define configMAX_PRIORITIES ( 7 ) + +/* Run time stats gathering configuration options. */ +#define configGENERATE_RUN_TIME_STATS 0 + +/* Co-routine related configuration options. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* This demo can use of one or more example stats formatting functions. These + * format the raw data provided by the uxTaskGetSystemState() function in to human + * readable ASCII form. See the notes in the implementation of vTaskList() within + * FreeRTOS/Source/tasks.c for limitations. */ +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 + +/* Enables the test whereby a stack larger than the total heap size is + * requested. */ +#define configSTACK_DEPTH_TYPE uint32_t + +/* Set the following definitions to 1 to include the API function, or zero + * to exclude the API function. In most cases the linker will remove unused + * functions anyway. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_uxTaskGetStackHighWaterMark2 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1 +#define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xTaskAbortDelay 1 + +/* It is a good idea to define configASSERT() while developing. configASSERT() + * uses the same semantics as the standard C assert() macro. Don't define + * configASSERT() when performing code coverage tests though, as it is not + * intended to asserts() to fail, some some code is intended not to run if no + * errors are present. */ +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for ( ;; ); } + +#endif /* FREERTOS_CONFIG_H */ diff --git a/test/posix_build_test/main.c b/test/posix_build_test/main.c new file mode 100644 index 0000000..86f1295 --- /dev/null +++ b/test/posix_build_test/main.c @@ -0,0 +1,37 @@ +/* + * Amazon FreeRTOS POSIX V1.1.0 + * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://aws.amazon.com/freertos + * http://www.FreeRTOS.org + */ + +/* Standard includes. */ +#include +#include +#include +/*-----------------------------------------------------------*/ + +int main( void ) +{ + return 0; +} + +/*-----------------------------------------------------------*/