mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Get reg test tasks working correctly.
This commit is contained in:
parent
1aecde4efd
commit
1217e8ce06
|
@ -66,7 +66,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
@ -139,6 +138,9 @@ static void prvSetupHardware( void );
|
|||
discover an unexpected value. */
|
||||
static unsigned portBASE_TYPE xRegTestStatus = pdPASS;
|
||||
|
||||
/* Counters used to ensure the regtest tasks are still running. */
|
||||
static unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
int main( void )
|
||||
|
@ -189,6 +191,7 @@ int main( void )
|
|||
static portSHORT prvCheckOtherTasksAreStillRunning( void )
|
||||
{
|
||||
portBASE_TYPE lReturn = pdPASS;
|
||||
static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
|
||||
|
||||
/* The demo tasks maintain a count that increments every cycle of the task
|
||||
provided that the task has never encountered an error. This function
|
||||
|
@ -252,6 +255,25 @@ portBASE_TYPE lReturn = pdPASS;
|
|||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
/* Are the register test tasks still looping? */
|
||||
if( ulLastRegTest1Counter == ulRegTest1Counter )
|
||||
{
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulLastRegTest1Counter = ulRegTest1Counter;
|
||||
}
|
||||
|
||||
if( ulLastRegTest2Counter == ulRegTest2Counter )
|
||||
{
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulLastRegTest2Counter = ulRegTest2Counter;
|
||||
}
|
||||
|
||||
return lReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -310,6 +332,24 @@ static void prvSetupHardware( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTest1Pass( void )
|
||||
{
|
||||
ulRegTest1Counter++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTest2Pass( void )
|
||||
{
|
||||
ulRegTest2Counter++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTestFail( void )
|
||||
{
|
||||
xRegTestStatus = pdFAIL;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTestTask1( void *pvParameters )
|
||||
{
|
||||
/* The first register test task as described at the top of this file. The
|
||||
|
@ -321,20 +361,12 @@ static void prvRegTestTask1( void *pvParameters )
|
|||
(
|
||||
"RegTest1Start: \n\t" \
|
||||
" \n\t" \
|
||||
" li 0, 101 \n\t" \
|
||||
" mtspr 27, 0 #SSR1 \n\t" \
|
||||
" li 0, 201 \n\t" \
|
||||
" mtspr 990, 0 #SSR2 \n\t" \
|
||||
" li 0, 301 \n\t" \
|
||||
" mtspr 256, 0 #USPRG0 \n\t" \
|
||||
" li 0, 401 \n\t" \
|
||||
" mtspr 9, 0 #CTR \n\t" \
|
||||
" li 0, 501 \n\t" \
|
||||
" mtspr 8, 0 #LR \n\t" \
|
||||
" li 0, 601 \n\t" \
|
||||
" li 0, 4 \n\t" \
|
||||
" mtspr 1, 0 #XER \n\t" \
|
||||
" li 0, 701 \n\t" \
|
||||
" mtcr 0 \n\t" \
|
||||
" \n\t" \
|
||||
" li 0, 1 \n\t" \
|
||||
" li 2, 2 \n\t" \
|
||||
|
@ -434,35 +466,23 @@ static void prvRegTestTask1( void *pvParameters )
|
|||
" cmpwi 31, 31 \n\t" \
|
||||
" bne RegTest1Fail \n\t" \
|
||||
" \n\t" \
|
||||
" mfspr 0, 27 #SSR1 \n\t" \
|
||||
" cmpwi 0, 101 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 990 #SSR2 \n\t" \
|
||||
" cmpwi 0, 201 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 256 #USPRG0 \n\t" \
|
||||
" cmpwi 0, 301 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 9 #CTR \n\t" \
|
||||
" cmpwi 0, 401 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" bne RegTest1Fail \n\t" \
|
||||
" mfspr 0, 8 #LR \n\t" \
|
||||
" cmpwi 0, 501 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" bne RegTest1Fail \n\t" \
|
||||
" mfspr 0, 1 #XER \n\t" \
|
||||
" cmpwi 0, 601 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfcr 0 \n\t" \
|
||||
" cmpwi 0, 701 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" cmpwi 0, 4 \n\t" \
|
||||
" bne RegTest1Fail \n\t" \
|
||||
" \n\t" \
|
||||
" bl prvRegTest1Pass \n\t" \
|
||||
" b RegTest1Start \n\t" \
|
||||
" \n\t" \
|
||||
"RegTest1Fail: \n\t" \
|
||||
" \n\t" \
|
||||
" xor 0, 0, 0 \n\t" \
|
||||
" stw 0, xRegTestStatus( 0 ) \n\t" \
|
||||
" \n\t" \
|
||||
" bl prvRegTestFail \n\t" \
|
||||
" b RegTest1Start \n\t" \
|
||||
);
|
||||
}
|
||||
|
@ -477,20 +497,12 @@ static void prvRegTestTask2( void *pvParameters )
|
|||
(
|
||||
"RegTest2Start: \n\t" \
|
||||
" \n\t" \
|
||||
" li 0, 100 \n\t" \
|
||||
" mtspr 27, 0 #SSR1 \n\t" \
|
||||
" li 0, 200 \n\t" \
|
||||
" mtspr 990, 0 #SSR2 \n\t" \
|
||||
" li 0, 300 \n\t" \
|
||||
" mtspr 256, 0 #USPRG0 \n\t" \
|
||||
" li 0, 400 \n\t" \
|
||||
" mtspr 9, 0 #CTR \n\t" \
|
||||
" li 0, 500 \n\t" \
|
||||
" mtspr 8, 0 #LR \n\t" \
|
||||
" li 0, 600 \n\t" \
|
||||
" li 0, 4 \n\t" \
|
||||
" mtspr 1, 0 #XER \n\t" \
|
||||
" li 0, 700 \n\t" \
|
||||
" mtcr 0 \n\t" \
|
||||
" \n\t" \
|
||||
" li 0, 11 \n\t" \
|
||||
" li 2, 12 \n\t" \
|
||||
|
@ -587,35 +599,23 @@ static void prvRegTestTask2( void *pvParameters )
|
|||
" cmpwi 31, 131 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" \n\t" \
|
||||
" mfspr 0, 27 #SSR1 \n\t" \
|
||||
" cmpwi 0, 100 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 990 #SSR2 \n\t" \
|
||||
" cmpwi 0, 200 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 256 #USPRG0 \n\t" \
|
||||
" cmpwi 0, 300 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 9 #CTR \n\t" \
|
||||
" cmpwi 0, 400 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 8 #LR \n\t" \
|
||||
" cmpwi 0, 500 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfspr 0, 1 #XER \n\t" \
|
||||
" cmpwi 0, 600 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" mfcr 0 \n\t" \
|
||||
" cmpwi 0, 700 \n\t" \
|
||||
" cmpwi 0, 4 \n\t" \
|
||||
" bne RegTest2Fail \n\t" \
|
||||
" \n\t" \
|
||||
" bl prvRegTest2Pass \n\t" \
|
||||
" b RegTest2Start \n\t" \
|
||||
" \n\t" \
|
||||
"RegTest2Fail: \n\t" \
|
||||
" \n\t" \
|
||||
" xor 0, 0, 0 \n\t" \
|
||||
" stw 0, xRegTestStatus( 0 ) \n\t" \
|
||||
" \n\t" \
|
||||
" bl prvRegTestFail \n\t" \
|
||||
" b RegTest2Start \n\t" \
|
||||
);
|
||||
}
|
||||
|
@ -627,6 +627,14 @@ handle needs to be used to determine the offending task. */
|
|||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName );
|
||||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName )
|
||||
{
|
||||
/* The following three calls are simply to stop compiler warnings about the
|
||||
functions not being used - they are called from the inline assembly. */
|
||||
prvRegTest1Pass();
|
||||
prvRegTest2Pass();
|
||||
prvRegTestFail();
|
||||
|
||||
for( ;; );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
ppc405_0
|
||||
RTOSDEMO_SOURCES = RTOSDemo/main.c RTOSDemo/serial/serial.c RTOSDemo/partest/partest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/port.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/tasks.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/list.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/queue.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/MemMang/heap_2.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.s C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flash.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/blocktim.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/dynamic.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flop.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/GenQTest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/integer.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/QPeek.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/semtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/BlockQ.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/death.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/comtest.c
|
||||
RTOSDEMO_SOURCES = RTOSDemo/main.c RTOSDemo/serial/serial.c RTOSDemo/partest/partest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/port.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/tasks.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/list.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/queue.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/MemMang/heap_2.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flash.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/blocktim.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/dynamic.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flop.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/GenQTest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/integer.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/QPeek.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/semtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/BlockQ.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/death.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/comtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.S
|
||||
RTOSDEMO_HEADERS = RTOSDemo/FreeRTOSConfig.h
|
||||
RTOSDEMO_CC = powerpc-eabi-gcc
|
||||
RTOSDEMO_CC_SIZE = powerpc-eabi-size
|
||||
|
|
|
@ -1 +1 @@
|
|||
guiSettings=FILTER=0;BUS_FLAT_VIEW=false;BUS_TREE_VIEW_HEADER=Name,Net,Direction,Range,Class,Sensitivity,Description,Frequency,Reset Polarity,IP Type,IP Version,IP Classification,Bus Connection,Mastership,Bus Standard,Address,Base Address,High Address,Size,Lock,ICache,DCache;BUS_TREE_VIEW_HEADER_MAP=0,15,16,17,18,19,20,21,12,13,14,1,2,4,5,3,7,8,9,10,11,6;BUS_TREE_VIEW_HIDDEN_SECTION=15,16,17,18,19,20,21,13,14,1,2,4,5,3,7,8,11,6;BUS_EXPANDED_NODE=;BUS_TREE_VERTICAL_SCROLL=0;BUS_TREE_HORIZONTAL_SCROLL=0;
|
||||
guiSettings=FILTER=0;BUS_FLAT_VIEW=false;BUS_TREE_VIEW_HEADER=Name,Net,Direction,Range,Class,Sensitivity,Description,Frequency,Reset Polarity,IP Type,IP Version,IP Classification,Bus Connection,Mastership,Bus Standard,Address,Base Address,High Address,Size,Lock,ICache,DCache;BUS_TREE_VIEW_HEADER_MAP=0,15,16,17,18,19,20,21,12,13,14,1,2,4,5,3,7,8,9,10,11,6;BUS_TREE_VIEW_HIDDEN_SECTION=15,16,17,18,19,20,21,13,14,1,2,4,5,3,7,8,11,6;BUS_EXPANDED_NODE=RS232_Uart;BUS_TREE_VERTICAL_SCROLL=0;BUS_TREE_HORIZONTAL_SCROLL=0;
|
||||
|
|
|
@ -45,7 +45,6 @@ Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/tasks.c
|
|||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/list.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/queue.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/MemMang/heap_2.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.s
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flash.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/blocktim.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/dynamic.c
|
||||
|
@ -57,6 +56,7 @@ Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/semtest.c
|
|||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/BlockQ.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/death.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/comtest.c
|
||||
Source: C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.S
|
||||
Header: RTOSDemo/FreeRTOSConfig.h
|
||||
DefaultInit: EXECUTABLE
|
||||
InitBram: 0
|
||||
|
|
|
@ -109,7 +109,7 @@ FPGA_IMP_DEPENDENCY = $(BMM_FILE) $(POSTSYN_NETLIST) $(UCF_FILE) $(BITGEN_UT_FIL
|
|||
# SOFTWARE APPLICATION RTOSDEMO
|
||||
#################################################################
|
||||
|
||||
RTOSDEMO_SOURCES = RTOSDemo/main.c RTOSDemo/serial/serial.c RTOSDemo/partest/partest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/port.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/tasks.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/list.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/queue.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/MemMang/heap_2.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.s C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flash.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/blocktim.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/dynamic.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flop.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/GenQTest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/integer.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/QPeek.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/semtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/BlockQ.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/death.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/comtest.c
|
||||
RTOSDEMO_SOURCES = RTOSDemo/main.c RTOSDemo/serial/serial.c RTOSDemo/partest/partest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/port.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/tasks.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/list.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/queue.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/MemMang/heap_2.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flash.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/blocktim.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/dynamic.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/flop.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/GenQTest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/integer.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/QPeek.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/semtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/BlockQ.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/death.c C:/E/Dev/FreeRTOS/WorkingCopy2/Demo/Common/Minimal/comtest.c C:/E/Dev/FreeRTOS/WorkingCopy2/Source/portable/GCC/PPC405_Xilinx/portasm.S
|
||||
|
||||
RTOSDEMO_HEADERS = RTOSDemo/FreeRTOSConfig.h
|
||||
|
||||
|
|
Loading…
Reference in a new issue