]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'master' into feature/freertos_static_buffers
authorIvan Grokhotkov <igrokhotkov@gmail.com>
Tue, 11 Oct 2016 05:34:45 +0000 (23:34 -0600)
committerIvan Grokhotkov <igrokhotkov@gmail.com>
Tue, 11 Oct 2016 05:34:45 +0000 (23:34 -0600)
* master: (117 commits)
  build system: Add -fno-rtti when compiling C++ code
  FreeRTOS KConfig: Limit tick rate to 1000Hz
  bootloader: Fix accidental tabs introduced in !78
  build system: Print a WARNING if any submodule is out of date
  Fix stack overflow message format
  'make flash' targets: Print serial port when flashing
  lwip/esp32: support iperf
  Add data memory for RMT peripheral
  syscall write: Should return number of bytes written
  Also push relevant tags over
  esp32: add libsmartconfig.a to link libs
  esp32: not link wps
  esp32/lib: update wifi lib to a1e5f8b9
  esp32: remove esp_wps.h
  add smartconfig header files(merge this after updating libsmartconfig.a version v2.6.2)
  esp32/lib: update wifi lib to 3853d7ae
  Add Comments
  Modify spinlock error in periph_ctrl.c
  Define xcoreid offset, add warning in tcb struct wrt the need to also change that define when struct changes
  components/tcpip_adapter: add some comments
  ...

# Conflicts:
# components/freertos/queue.c
# components/freertos/tasks.c

1  2 
components/freertos/include/freertos/FreeRTOSConfig.h
components/freertos/include/freertos/task.h
components/freertos/queue.c
components/freertos/tasks.c

index 445a9e2e91e58abde8ddae77c5f3d7b9ec94d4c6,168f09f1a18ebfc044ee396a14096295ea9c7109..f404a243e6c56b7334cf6b5b7fc0319e695e2b38
@@@ -163,11 -158,9 +158,8 @@@ typedef struct QueueDefinitio
        UBaseType_t uxLength;                   /*< The length of the queue defined as the number of items it will hold, not the number of bytes. */
        UBaseType_t uxItemSize;                 /*< The size of each items that the queue will hold. */
  
-       volatile BaseType_t xRxLock;    /*< Stores the number of items received from the queue (removed from the queue) while the queue was locked.  Set to queueUNLOCKED when the queue is not locked. */
-       volatile BaseType_t xTxLock;    /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked.  Set to queueUNLOCKED when the queue is not locked. */
 -      #if ( configUSE_TRACE_FACILITY == 1 )
 -              UBaseType_t uxQueueNumber;
 -              uint8_t ucQueueType;
 +      #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
 +              uint8_t ucStaticallyAllocated;  /*< Set to pdTRUE if the memory used by the queue was statically allocated to ensure no attempt is made to free the memory. */
        #endif
  
        #if ( configUSE_QUEUE_SETS == 1 )
@@@ -259,42 -238,6 +242,21 @@@ static void prvCopyDataFromQueue( Queue
        static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
  #endif
  
- /*-----------------------------------------------------------*/
- /*
-  * Macro to mark a queue as locked.  Locking a queue prevents an ISR from
-  * accessing the queue event lists.
-  */
- #define prvLockQueue( pxQueue )                                                               \
-       taskENTER_CRITICAL(&pxQueue->mux);                                                                      \
-       {                                                                                                               \
-               if( ( pxQueue )->xRxLock == queueUNLOCKED )                     \
-               {                                                                                                       \
-                       ( pxQueue )->xRxLock = queueLOCKED_UNMODIFIED;  \
-               }                                                                                                       \
-               if( ( pxQueue )->xTxLock == queueUNLOCKED )                     \
-               {                                                                                                       \
-                       ( pxQueue )->xTxLock = queueLOCKED_UNMODIFIED;  \
-               }                                                                                                       \
-       }                                                                                                               \
-       taskEXIT_CRITICAL(&pxQueue->mux)
- /*-----------------------------------------------------------*/
 +/*
 + * Called after a Queue_t structure has been allocated either statically or
 + * dynamically to fill in the structure's members.
 + */
 +static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, const uint8_t ucQueueType, Queue_t *pxNewQueue ) PRIVILEGED_FUNCTION;
 +
 +/*
 + * Mutexes are a special type of queue.  When a mutex is created, first the
 + * queue is created, then prvInitialiseMutex() is called to configure the queue
 + * as a mutex.
 + */
 +#if( configUSE_MUTEXES == 1 )
 +      static void prvInitialiseMutex( Queue_t *pxNewQueue ) PRIVILEGED_FUNCTION;
 +#endif
 +
  BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue )
  {
  Queue_t * const pxQueue = ( Queue_t * ) xQueue;
index 034ffc08ed8c0e243c8fd0c9779a22d44ccbef14,5eb4687e0658d9495058cdf301c4120b34482136..63a659b5d7bf91fb9fce4e7c56b84b47ed84568e
@@@ -591,35 -578,6 +590,26 @@@ static void prvResetNextTaskUnblockTime
  
  #endif
  
- /*-----------------------------------------------------------*/
- static void vTaskInitializeLocalMuxes( void )
- {
-       vPortCPUInitializeMutex(&xTaskQueueMutex);
-       vPortCPUInitializeMutex(&xTickCountMutex);
-       xMutexesInitialised = pdTRUE;
- }
 +/*
 + * Called after a Task_t structure has been allocated either statically or
 + * dynamically to fill in the structure's members.
 + */
 +static void prvInitialiseNewTask(     TaskFunction_t pxTaskCode,
 +                                                                      const char * const pcName,
 +                                                                      const uint32_t ulStackDepth,
 +                                                                      void * const pvParameters,
 +                                                                      UBaseType_t uxPriority,
 +                                                                      TaskHandle_t * const pxCreatedTask,
 +                                                                      TCB_t *pxNewTCB,
 +                                                                      const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 +
 +/*
 + * Called after a new task has been created and initialised to place the task
 + * under the control of the scheduler.
 + */
 +static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB, TaskFunction_t pxTaskCode, const BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
 +
 +
  
  /*-----------------------------------------------------------*/
  
@@@ -3488,6 -3264,93 +3474,18 @@@ static void prvAddCurrentTaskToDelayedL
  }
  /*-----------------------------------------------------------*/
  
 -static TCB_t *prvAllocateTCBAndStack( const uint16_t usStackDepth, StackType_t * const puxStackBuffer )
 -{
 -TCB_t *pxNewTCB;
 -
 -      /* If the stack grows down then allocate the stack then the TCB so the stack
 -      does not grow into the TCB.  Likewise if the stack grows up then allocate
 -      the TCB then the stack. */
 -      #if( portSTACK_GROWTH > 0 )
 -      {
 -              /* Allocate space for the TCB.  Where the memory comes from depends on
 -              the implementation of the port malloc function. */
 -              pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
 -
 -              if( pxNewTCB != NULL )
 -              {
 -                      /* Allocate space for the stack used by the task being created.
 -                      The base of the stack memory stored in the TCB so the task can
 -                      be deleted later if required. */
 -                      pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocAligned( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ), puxStackBuffer ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
 -
 -                      if( pxNewTCB->pxStack == NULL )
 -                      {
 -                              /* Could not allocate the stack.  Delete the allocated TCB. */
 -                              vPortFree( pxNewTCB );
 -                              pxNewTCB = NULL;
 -                      }
 -              }
 -      }
 -      #else /* portSTACK_GROWTH */
 -      {
 -      StackType_t *pxStack;
 -
 -              /* Allocate space for the stack used by the task being created. */
 -              pxStack = ( StackType_t * ) pvPortMallocAligned( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ), puxStackBuffer ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
 -
 -              if( pxStack != NULL )
 -              {
 -                      /* Allocate space for the TCB.  Where the memory comes from depends
 -                      on the implementation of the port malloc function. */
 -                      pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
 -
 -                      if( pxNewTCB != NULL )
 -                      {
 -                              /* Store the stack location in the TCB. */
 -                              pxNewTCB->pxStack = pxStack;
 -                      }
 -                      else
 -                      {
 -                              /* The stack cannot be used as the TCB was not created.  Free it
 -                              again. */
 -                              vPortFree( pxStack );
 -                      }
 -              }
 -              else
 -              {
 -                      pxNewTCB = NULL;
 -              }
 -      }
 -      #endif /* portSTACK_GROWTH */
 -
 -      if( pxNewTCB != NULL )
 -      {
 -              /* Avoid dependency on memset() if it is not required. */
 -              #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
 -              {
 -                      /* Just to help debugging. */
 -      ( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) usStackDepth * sizeof( StackType_t ) );
 -              }
 -              #endif /* ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) ) ) */
 -      }
 -
 -      return pxNewTCB;
 -}
 -/*-----------------------------------------------------------*/
 -
+ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
+ {
+       TCB_t *pxTCB;
+       UBaseType_t uxReturn;
+       pxTCB = prvGetTCBFromHandle( xTask );
+       return pxTCB->xCoreID;
+ }
+ /*-----------------------------------------------------------*/
  #if ( configUSE_TRACE_FACILITY == 1 )
  
        static UBaseType_t prvListTaskWithinSingleList( TaskStatus_t *pxTaskStatusArray, List_t *pxList, eTaskState eState )