#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
#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
\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
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
" 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
/* 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
/* 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
of this file. */\r
void vApplicationMallocFailedHook( void )\r
{\r
+ taskDISABLE_INTERRUPTS();\r
for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
of this file. */\r
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )\r
{\r
+ taskDISABLE_INTERRUPTS();\r
for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r