]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/FreeRTOS.h
Fix spelling issues.
[freertos] / FreeRTOS / Source / include / FreeRTOS.h
index f974c73e779f37a71e8685900f528b886d6f3795..4df39db39cbf4db6a969c7fa9b1e409cab332d47 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * FreeRTOS Kernel V10.0.1\r
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ * FreeRTOS Kernel V10.2.1\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
  * this software and associated documentation files (the "Software"), to deal in\r
@@ -156,6 +156,10 @@ extern "C" {
        #define INCLUDE_uxTaskGetStackHighWaterMark 0\r
 #endif\r
 \r
+#ifndef INCLUDE_uxTaskGetStackHighWaterMark2\r
+       #define INCLUDE_uxTaskGetStackHighWaterMark2 0\r
+#endif\r
+\r
 #ifndef INCLUDE_eTaskGetState\r
        #define INCLUDE_eTaskGetState 0\r
 #endif\r
@@ -237,6 +241,26 @@ extern "C" {
        #define configASSERT_DEFINED 1\r
 #endif\r
 \r
+/* configPRECONDITION should be defined as configASSERT.\r
+The CBMC proofs need a way to track assumptions and assertions.\r
+A configPRECONDITION statement should express an implicit invariant or\r
+assumption made.  A configASSERT statement should express an invariant that must\r
+hold explicit before calling the code. */\r
+#ifndef configPRECONDITION\r
+       #define configPRECONDITION( X ) configASSERT(X)\r
+       #define configPRECONDITION_DEFINED 0\r
+#else\r
+       #define configPRECONDITION_DEFINED 1\r
+#endif\r
+\r
+#ifndef portMEMORY_BARRIER\r
+       #define portMEMORY_BARRIER()\r
+#endif\r
+\r
+#ifndef portSOFTWARE_BARRIER\r
+       #define portSOFTWARE_BARRIER()\r
+#endif\r
+\r
 /* The timers module relies on xTaskGetSchedulerState(). */\r
 #if configUSE_TIMERS == 1\r
 \r
@@ -758,8 +782,12 @@ extern "C" {
        #define portTASK_USES_FLOATING_POINT()\r
 #endif\r
 \r
-#ifndef portTASK_CALLS_SECURE_FUNCTIONS\r
-       #define portTASK_CALLS_SECURE_FUNCTIONS()\r
+#ifndef portALLOCATE_SECURE_CONTEXT\r
+       #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )\r
+#endif\r
+\r
+#ifndef portDONT_DISCARD\r
+       #define portDONT_DISCARD\r
 #endif\r
 \r
 #ifndef configUSE_TIME_SLICING\r
@@ -806,6 +834,10 @@ extern "C" {
        #define configUSE_TASK_NOTIFICATIONS 1\r
 #endif\r
 \r
+#ifndef configUSE_POSIX_ERRNO\r
+       #define configUSE_POSIX_ERRNO 0\r
+#endif\r
+\r
 #ifndef portTICK_TYPE_IS_ATOMIC\r
        #define portTICK_TYPE_IS_ATOMIC 0\r
 #endif\r
@@ -826,6 +858,13 @@ extern "C" {
        #define configSTACK_DEPTH_TYPE uint16_t\r
 #endif\r
 \r
+#ifndef configMESSAGE_BUFFER_LENGTH_TYPE\r
+       /* Defaults to size_t for backward compatibility, but can be overridden\r
+       in FreeRTOSConfig.h if lengths will always be less than the number of bytes\r
+       in a size_t. */\r
+       #define configMESSAGE_BUFFER_LENGTH_TYPE size_t\r
+#endif\r
+\r
 /* Sanity check the configuration. */\r
 #if( configUSE_TICKLESS_IDLE != 0 )\r
        #if( INCLUDE_vTaskSuspend != 1 )\r
@@ -914,6 +953,7 @@ V8 if desired. */
        #define pcTimerGetTimerName pcTimerGetName\r
        #define pcQueueGetQueueName pcQueueGetName\r
        #define vTaskGetTaskInfo vTaskGetInfo\r
+       #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter\r
 \r
        /* Backward compatibility within the scheduler code only - these definitions\r
        are not really required but are included for completeness. */\r
@@ -921,6 +961,10 @@ V8 if desired. */
        #define pdTASK_CODE TaskFunction_t\r
        #define xListItem ListItem_t\r
        #define xList List_t\r
+\r
+       /* For libraries that break the list data hiding, and access list structure\r
+       members directly (which is not supposed to be done). */\r
+       #define pxContainer pvContainer\r
 #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
 \r
 #if( configUSE_ALTERNATIVE_API != 0 )\r
@@ -935,6 +979,75 @@ point support. */
        #define configUSE_TASK_FPU_SUPPORT 1\r
 #endif\r
 \r
+/* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is\r
+currently used in ARMv8M ports. */\r
+#ifndef configENABLE_MPU\r
+       #define configENABLE_MPU 0\r
+#endif\r
+\r
+/* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is\r
+currently used in ARMv8M ports. */\r
+#ifndef configENABLE_FPU\r
+       #define configENABLE_FPU 1\r
+#endif\r
+\r
+/* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.\r
+This is currently used in ARMv8M ports. */\r
+#ifndef configENABLE_TRUSTZONE\r
+       #define configENABLE_TRUSTZONE 1\r
+#endif\r
+\r
+/* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on\r
+the Secure Side only. */\r
+#ifndef configRUN_FREERTOS_SECURE_ONLY\r
+       #define configRUN_FREERTOS_SECURE_ONLY 0\r
+#endif\r
+\r
+/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using\r
+ * dynamically allocated RAM, in which case when any task is deleted it is known\r
+ * that both the task's stack and TCB need to be freed.  Sometimes the\r
+ * FreeRTOSConfig.h settings only allow a task to be created using statically\r
+ * allocated RAM, in which case when any task is deleted it is known that neither\r
+ * the task's stack or TCB should be freed.  Sometimes the FreeRTOSConfig.h\r
+ * settings allow a task to be created using either statically or dynamically\r
+ * allocated RAM, in which case a member of the TCB is used to record whether the\r
+ * stack and/or TCB were allocated statically or dynamically, so when a task is\r
+ * deleted the RAM that was allocated dynamically is freed again and no attempt is\r
+ * made to free the RAM that was allocated statically.\r
+ * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a\r
+ * task to be created using either statically or dynamically allocated RAM.  Note\r
+ * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with\r
+ * a statically allocated stack and a dynamically allocated TCB.\r
+ *\r
+ * The following table lists various combinations of portUSING_MPU_WRAPPERS,\r
+ * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and\r
+ * when it is possible to have both static and dynamic allocation:\r
+ *  +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
+ * | MPU | Dynamic | Static |     Available Functions     |       Possible Allocations        | Both Dynamic and | Need Free |\r
+ * |     |         |        |                             |                                   | Static Possible  |           |\r
+ * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
+ * | 0   | 0       | 1      | xTaskCreateStatic           | TCB - Static, Stack - Static      | No               | No        |\r
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
+ * | 0   | 1       | 0      | xTaskCreate                 | TCB - Dynamic, Stack - Dynamic    | No               | Yes       |\r
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
+ * | 0   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
+ * |     |         |        | xTaskCreateStatic           | 2. TCB - Static, Stack - Static   |                  |           |\r
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
+ * | 1   | 0       | 1      | xTaskCreateStatic,          | TCB - Static, Stack - Static      | No               | No        |\r
+ * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
+ * | 1   | 1       | 0      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
+ * |     |         |        | xTaskCreateRestricted       | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
+ * | 1   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
+ * |     |         |        | xTaskCreateStatic,          | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
+ * |     |         |        | xTaskCreateRestricted,      | 3. TCB - Static, Stack - Static   |                  |           |\r
+ * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
+ * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
+ */\r
+#define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE      ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \\r
+                                                                                                         ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )\r
+\r
 /*\r
  * In line with software engineering best practice, FreeRTOS implements a strict\r
  * data hiding policy, so the real structures used by FreeRTOS to maintain the\r
@@ -947,25 +1060,40 @@ point support. */
  */\r
 struct xSTATIC_LIST_ITEM\r
 {\r
-       TickType_t xDummy1;\r
-       void *pvDummy2[ 4 ];\r
+       #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
+               TickType_t xDummy1;\r
+       #endif\r
+       TickType_t xDummy2;\r
+       void *pvDummy3[ 4 ];\r
+       #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
+               TickType_t xDummy4;\r
+       #endif\r
 };\r
 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;\r
 \r
 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
 struct xSTATIC_MINI_LIST_ITEM\r
 {\r
-       TickType_t xDummy1;\r
-       void *pvDummy2[ 2 ];\r
+       #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
+               TickType_t xDummy1;\r
+       #endif\r
+       TickType_t xDummy2;\r
+       void *pvDummy3[ 2 ];\r
 };\r
 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;\r
 \r
 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
 typedef struct xSTATIC_LIST\r
 {\r
-       UBaseType_t uxDummy1;\r
-       void *pvDummy2;\r
-       StaticMiniListItem_t xDummy3;\r
+       #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
+               TickType_t xDummy1;\r
+       #endif\r
+       UBaseType_t uxDummy2;\r
+       void *pvDummy3;\r
+       StaticMiniListItem_t xDummy4;\r
+       #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
+               TickType_t xDummy5;\r
+       #endif\r
 } StaticList_t;\r
 \r
 /*\r
@@ -1019,14 +1147,16 @@ typedef struct xSTATIC_TCB
                uint32_t                ulDummy18;\r
                uint8_t                 ucDummy19;\r
        #endif\r
-       #if( ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) || ( portUSING_MPU_WRAPPERS == 1 ) )\r
+       #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
                uint8_t                 uxDummy20;\r
        #endif\r
 \r
        #if( INCLUDE_xTaskAbortDelay == 1 )\r
                uint8_t ucDummy21;\r
        #endif\r
-\r
+       #if ( configUSE_POSIX_ERRNO == 1 )\r
+               int                             iDummy22;\r
+       #endif\r
 } StaticTask_t;\r
 \r
 /*\r
@@ -1121,15 +1251,12 @@ typedef struct xSTATIC_TIMER
        void                            *pvDummy1;\r
        StaticListItem_t        xDummy2;\r
        TickType_t                      xDummy3;\r
-       UBaseType_t                     uxDummy4;\r
-       void                            *pvDummy5[ 2 ];\r
+       void                            *pvDummy5;\r
+       TaskFunction_t          pvDummy6;\r
        #if( configUSE_TRACE_FACILITY == 1 )\r
-               UBaseType_t             uxDummy6;\r
-       #endif\r
-\r
-       #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
-               uint8_t                 ucDummy7;\r
+               UBaseType_t             uxDummy7;\r
        #endif\r
+       uint8_t                         ucDummy8;\r
 \r
 } StaticTimer_t;\r
 \r