]> git.sur5r.net Git - freertos/commitdiff
Update register test tasks to include a manual yield. Include the death tasks in...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 13 Jun 2011 14:41:18 +0000 (14:41 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 13 Jun 2011 14:41:18 +0000 (14:41 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1456 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h
Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/RegisterTests.c
Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c

index 63162ec94be9920342865c9761a5161e0e85d88d..81e8b79de425b420c141e30aa3536d5f1ad88f38 100644 (file)
@@ -83,7 +83,7 @@
 #define configCPU_CLOCK_HZ                             ( XPAR_MICROBLAZE_CORE_CLOCK_FREQ_HZ ) /* Not actually used in this demo as the timer is set up in main and uses the peripheral clock, not the CPU clock. */\r
 #define configTICK_RATE_HZ                             ( ( portTickType ) 1000 )\r
 #define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 6 )\r
-#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 200 * 1024 ) )\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 64 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                        ( 10 )\r
 #define configUSE_TRACE_FACILITY               0\r
 #define configUSE_16_BIT_TICKS                 0\r
@@ -96,7 +96,7 @@
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
-#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 250 )\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 200 )\r
 #define configINTERRUPT_STACK_SIZE             configMINIMAL_STACK_SIZE\r
 \r
 /* Co-routine definitions. */\r
index a855e564b29d83ea68026115bb444dd2e653b251..906e306db221db7289eadead0eed5922a38771d8 100644 (file)
@@ -53,6 +53,7 @@
 \r
 /* Scheduler includes. */\r
 #include "FreeRTOS.h"\r
+#include "task.h"\r
 \r
 /*\r
  * The register test task as described at the top of this file.\r
@@ -183,16 +184,7 @@ void vRegisterTest2( void *pvParameters )
        code.\r
        \r
        First fill the registers with known values. */\r
-       asm volatile (  "       addi r3, r0, 103        \n\t" \\r
-                                       "       addi r4, r0, 104        \n\t" \\r
-                                       "       addi r6, r0, 106        \n\t" \\r
-                                       "       addi r7, r0, 107        \n\t" \\r
-                                       "       addi r8, r0, 108        \n\t" \\r
-                                       "       addi r9, r0, 109        \n\t" \\r
-                                       "       addi r10, r0, 1010      \n\t" \\r
-                                       "       addi r11, r0, 1011      \n\t" \\r
-                                       "       addi r12, r0, 1012      \n\t" \\r
-                                       "       addi r16, r0, 1016      \n\t" \\r
+       asm volatile (  "       addi r16, r0, 1016      \n\t" \\r
                                        "       addi r19, r0, 1019      \n\t" \\r
                                        "       addi r20, r0, 1020      \n\t" \\r
                                        "       addi r21, r0, 1021      \n\t" \\r
@@ -205,13 +197,26 @@ void vRegisterTest2( void *pvParameters )
                                        "       addi r28, r0, 1028      \n\t" \\r
                                        "       addi r29, r0, 1029      \n\t" \\r
                                        "       addi r30, r0, 1030      \n\t" \\r
-                                       "       addi r31, r0, 1031      \n\t"\r
+                                       "       addi r31, r0, 1031      \n\t" \\r
+                                       "                                                       " \\r
+                                       "Loop_Start_2:                          "\r
+                               );\r
+\r
+       taskYIELD();\r
+\r
+       asm volatile (  "       addi r3, r0, 103        \n\t" \\r
+                                       "       addi r4, r0, 104        \n\t" \\r
+                                       "       addi r6, r0, 106        \n\t" \\r
+                                       "       addi r7, r0, 107        \n\t" \\r
+                                       "       addi r8, r0, 108        \n\t" \\r
+                                       "       addi r9, r0, 109        \n\t" \\r
+                                       "       addi r10, r0, 1010      \n\t" \\r
+                                       "       addi r11, r0, 1011      \n\t" \\r
+                                       "       addi r12, r0, 1012      \n\t" \\r
                                );\r
 \r
-       /* Yield. */\r
-       asm volatile (  "Loop_Start_2:                          \n\t" \\r
-                                       "bralid r14, VPortYieldASM      \n\t" \\r
-                                       "or r0, r0, r0                          \n\t" );\r
+       /* taskYIELD() could have changed temporaries - set them back to those\r
+       expected by the reg test task. */\r
 \r
        /* Now test the register values to ensure they contain the same value that\r
        was written to them above.       This task will get preempted frequently so \r
index 385f0873a9db57cebb20902cf52e1b18ef8e875a..3d152480549e2ccbc235c77e0e4535dca04dc4a3 100644 (file)
@@ -276,7 +276,7 @@ int main( void )
        /* The suicide tasks must be created last as they need to know how many\r
        tasks were running prior to their creation in order to ascertain whether\r
        or not the correct/expected number of tasks are running at any given time. */\r
-//     vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
+       vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
 \r
        /* Create the 'check' timer - the timer that periodically calls the\r
        check function as described at the top of this file.  Note that, for\r
@@ -297,6 +297,7 @@ int main( void )
        /* If all is well we will never reach here as the scheduler will now be\r
        running.  If we do reach here then it is likely that there was insufficient\r
        heap available for the idle task to be created. */\r
+       taskDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -465,6 +466,7 @@ unsigned long ulCSR;
 of this file. */\r
 void vApplicationMallocFailedHook( void )\r
 {\r
+       taskDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -473,6 +475,7 @@ void vApplicationMallocFailedHook( void )
 of this file. */\r
 void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
 {\r
+       taskDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r