]> git.sur5r.net Git - freertos/commitdiff
Kernel updates:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 26 Jan 2015 17:40:35 +0000 (17:40 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 26 Jan 2015 17:40:35 +0000 (17:40 +0000)
- Add user configurable thread local storage array, with get/set access function.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2328 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/FreeRTOSConfig.h
FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lscript.ld
FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/main.c
FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/include/task.h
FreeRTOS/Source/tasks.c

index a05871cf8960138c426a22d465e9fe6d3bc3a14d..e192d218b2cad057627336e8d5bf2e8653a13f1b 100644 (file)
@@ -227,7 +227,7 @@ void vRegisterSampleCLICommands( void )
 \r
 static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
 {\r
-const char *const pcHeader = "  State\tPriority\tStack\t#\r\n************************************************\r\n";\r
+const char *const pcHeader = "       State  Priority  Stack    #\r\n************************************************\r\n";\r
 BaseType_t xSpacePadding;\r
 \r
        /* Remove compile time warnings about unused parameters, and check the\r
index ae22e5c227d1cfe784e338a04c9d646911d29a84..717f9895694b5f843fa776621f520f076ae1a310 100644 (file)
@@ -149,7 +149,6 @@ referenced anyway. */
 #define INCLUDE_vTaskPrioritySet                               1\r
 #define INCLUDE_uxTaskPriorityGet                              1\r
 #define INCLUDE_vTaskDelete                                            1\r
-#define INCLUDE_vTaskCleanUpResources                  0\r
 #define INCLUDE_vTaskSuspend                                   1\r
 #define INCLUDE_vTaskDelayUntil                                        1\r
 #define INCLUDE_vTaskDelay                                             1\r
index edc96f23e195789fbb16d9dea5b00c59581e8618..9efe1d14dc310d6b0d45265b0d6716aed86a6c80 100644 (file)
@@ -18,6 +18,7 @@ _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x4;
 MEMORY\r
 {\r
    microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr : ORIGIN = 0x00000050, LENGTH = 0x0003FFB0\r
+   mig_7series_0 : ORIGIN = 0x80000000, LENGTH = 0x40000000\r
 }\r
 \r
 /* Specify the default entry point to the program */\r
@@ -48,15 +49,15 @@ SECTIONS
    *(.text)\r
    *(.text.*)\r
    *(.gnu.linkonce.t.*)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .init : {\r
    KEEP (*(.init))\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .fini : {\r
    KEEP (*(.fini))\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .ctors : {\r
    __CTOR_LIST__ = .;\r
@@ -67,7 +68,7 @@ SECTIONS
    KEEP (*(.ctors))\r
    __CTOR_END__ = .;\r
    ___CTORS_END___ = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .dtors : {\r
    __DTOR_LIST__ = .;\r
@@ -78,7 +79,7 @@ SECTIONS
    KEEP (*(.dtors))\r
    PROVIDE(__DTOR_END__ = .);\r
    PROVIDE(___DTORS_END___ = .);\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .rodata : {\r
    __rodata_start = .;\r
@@ -86,7 +87,7 @@ SECTIONS
    *(.rodata.*)\r
    *(.gnu.linkonce.r.*)\r
    __rodata_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .sdata2 : {\r
    . = ALIGN(8);\r
@@ -96,7 +97,7 @@ SECTIONS
    *(.gnu.linkonce.s2.*)\r
    . = ALIGN(8);\r
    __sdata2_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .sbss2 : {\r
    __sbss2_start = .;\r
@@ -104,7 +105,7 @@ SECTIONS
    *(.sbss2.*)\r
    *(.gnu.linkonce.sb2.*)\r
    __sbss2_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .data : {\r
    . = ALIGN(4);\r
@@ -113,31 +114,31 @@ SECTIONS
    *(.data.*)\r
    *(.gnu.linkonce.d.*)\r
    __data_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .got : {\r
    *(.got)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .got1 : {\r
    *(.got1)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .got2 : {\r
    *(.got2)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .eh_frame : {\r
    *(.eh_frame)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .jcr : {\r
    *(.jcr)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .gcc_except_table : {\r
    *(.gcc_except_table)\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .sdata : {\r
    . = ALIGN(8);\r
@@ -146,7 +147,7 @@ SECTIONS
    *(.sdata.*)\r
    *(.gnu.linkonce.s.*)\r
    __sdata_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .sbss (NOLOAD) : {\r
    . = ALIGN(4);\r
@@ -156,7 +157,7 @@ SECTIONS
    *(.gnu.linkonce.sb.*)\r
    . = ALIGN(8);\r
    __sbss_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .tdata : {\r
    __tdata_start = .;\r
@@ -164,7 +165,7 @@ SECTIONS
    *(.tdata.*)\r
    *(.gnu.linkonce.td.*)\r
    __tdata_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .tbss : {\r
    __tbss_start = .;\r
@@ -172,7 +173,7 @@ SECTIONS
    *(.tbss.*)\r
    *(.gnu.linkonce.tb.*)\r
    __tbss_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .bss (NOLOAD) : {\r
    . = ALIGN(4);\r
@@ -183,7 +184,7 @@ SECTIONS
    *(COMMON)\r
    . = ALIGN(4);\r
    __bss_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 _SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );\r
 \r
@@ -197,7 +198,7 @@ _SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );
    _heap_start = .;\r
    . += _HEAP_SIZE;\r
    _heap_end = .;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 .stack (NOLOAD) : {\r
    _stack_end = .;\r
@@ -205,7 +206,7 @@ _SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );
    . = ALIGN(8);\r
    _stack = .;\r
    __stack = _stack;\r
-} > microblaze_0_local_memory_ilmb_bram_if_cntlr_microblaze_0_local_memory_dlmb_bram_if_cntlr\r
+} > mig_7series_0\r
 \r
 _end = .;\r
 }\r
index fcd21298ef8f7654b2c1dd6d40fa773c26824310..858cb15ea252baf8f0b72300352ad1cc0038a030 100644 (file)
@@ -168,12 +168,14 @@ static void prvSetupHardware( void )
 \r
        #if defined( XPAR_MICROBLAZE_USE_ICACHE ) && ( XPAR_MICROBLAZE_USE_ICACHE != 0 )\r
        {\r
+               Xil_ICacheInvalidate();\r
                Xil_ICacheEnable();\r
        }\r
        #endif\r
 \r
        #if defined( XPAR_MICROBLAZE_USE_DCACHE ) && ( XPAR_MICROBLAZE_USE_DCACHE != 0 )\r
        {\r
+               Xil_DCacheInvalidate();\r
                Xil_DCacheEnable();\r
        }\r
        #endif\r
index 7adafd2c3a6a931e138fd9384c1b4a8fa6648fea..a149c96d68a5772c57a7261677e8a9882c9f53f2 100644 (file)
@@ -195,6 +195,10 @@ extern "C" {
        #define configUSE_APPLICATION_TASK_TAG 0\r
 #endif\r
 \r
+#ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
+       #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0\r
+#endif\r
+\r
 #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
        #define INCLUDE_uxTaskGetStackHighWaterMark 0\r
 #endif\r
index bce009b120bb27f7b2bf9a56b20cf9e23e4484c4..77e9eb6be3175d95026a6a35a4cc7be1db0700af 100644 (file)
@@ -1158,6 +1158,18 @@ constant. */
        #endif /* configUSE_APPLICATION_TASK_TAG ==1 */\r
 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */\r
 \r
+#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
+\r
+       /* Each task contains an array of pointers that is dimensioned by the\r
+       configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h.  The\r
+       kernel does not use the pointers itself, so the application writer can use\r
+       the pointers for any purpose they wish.  The following two functions are\r
+       used to set and query a pointer respectively. */        \r
+       void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue );\r
+       void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex );\r
+\r
+#endif\r
+\r
 /**\r
  * task.h\r
  * <pre>BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );</pre>\r
index e7274dbc63ad67c857d2a70130f4828a16ba2f3d..bce9973d1e93248e32d3186a0c2df1034d5a9bc7 100644 (file)
@@ -168,6 +168,10 @@ typedef struct tskTaskControlBlock
                TaskHookFunction_t pxTaskTag;\r
        #endif\r
 \r
+       #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
+               void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
+       #endif\r
+\r
        #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
                uint32_t                ulRunTimeCounter;       /*< Stores the amount of time the task has spent in the Running state. */\r
        #endif\r
@@ -2882,6 +2886,15 @@ UBaseType_t x;
        }\r
        #endif /* portUSING_MPU_WRAPPERS */\r
 \r
+       #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )\r
+       {\r
+               for( x = 0; x < ( UBaseType_t ) configNUM_THREAD_LOCAL_STORAGE_POINTERS; x++ )\r
+               {\r
+                       pxTCB->pvThreadLocalStoragePointers[ x ] = NULL;\r
+               }\r
+       }\r
+       #endif\r
+\r
        #if ( configUSE_TASK_NOTIFICATIONS == 1 )\r
        {\r
                pxTCB->ulNotifiedValue = 0;\r
@@ -2898,6 +2911,45 @@ UBaseType_t x;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )\r
+\r
+       void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue )\r
+       {\r
+       TCB_t *pxTCB;\r
+\r
+               if( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS )\r
+               {\r
+                       pxTCB = prvGetTCBFromHandle( xTaskToSet );\r
+                       pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue;\r
+               }\r
+       }\r
+\r
+#endif /* configNUM_THREAD_LOCAL_STORAGE_POINTERS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )\r
+\r
+       void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex )\r
+       {\r
+       void *pvReturn = NULL;\r
+       TCB_t *pxTCB;\r
+\r
+               if( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS )\r
+               {\r
+                       pxTCB = prvGetTCBFromHandle( xTaskToQuery );\r
+                       pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ];\r
+               }\r
+               else\r
+               {\r
+                       pvReturn = NULL;\r
+               }\r
+\r
+               return pvReturn;\r
+       }\r
+\r
+#endif /* configNUM_THREAD_LOCAL_STORAGE_POINTERS */\r
+/*-----------------------------------------------------------*/\r
+\r
 #if ( portUSING_MPU_WRAPPERS == 1 )\r
 \r
        void vTaskAllocateMPURegions( TaskHandle_t xTaskToModify, const MemoryRegion_t * const xRegions )\r
@@ -4100,7 +4152,7 @@ TickType_t uxReturn;
                                {\r
                                        /* The notified task has a priority above the currently\r
                                        executing task so a yield is required. */\r
-                                       portYIELD_WITHIN_API();\r
+                                       taskYIELD_IF_USING_PREEMPTION();\r
                                }\r
                                else\r
                                {\r