Related to Zynq demo: Remove compiler warnings when configASSERT() is not defined and set the type of the assembly functions to allow them to be called when the C code is compiled to THUMB instructions.

This commit is contained in:
Richard Barry 2014-02-04 14:53:17 +00:00
parent f843888e60
commit 481db56078
9 changed files with 77 additions and 60 deletions

View file

@ -25,7 +25,7 @@
<inputType id="xilinx.gnu.assembler.input.401366857" superClass="xilinx.gnu.assembler.input"/> <inputType id="xilinx.gnu.assembler.input.401366857" superClass="xilinx.gnu.assembler.input"/>
</tool> </tool>
<tool id="xilinx.gnu.arm.c.toolchain.compiler.debug.399974114" name="ARM gcc compiler" superClass="xilinx.gnu.arm.c.toolchain.compiler.debug"> <tool id="xilinx.gnu.arm.c.toolchain.compiler.debug.399974114" name="ARM gcc compiler" superClass="xilinx.gnu.arm.c.toolchain.compiler.debug">
<option defaultValue="gnu.c.optimization.level.none" id="xilinx.gnu.compiler.option.optimization.level.117590421" name="Optimization Level" superClass="xilinx.gnu.compiler.option.optimization.level" valueType="enumerated"/> <option defaultValue="gnu.c.optimization.level.none" id="xilinx.gnu.compiler.option.optimization.level.117590421" name="Optimization Level" superClass="xilinx.gnu.compiler.option.optimization.level" value="gnu.c.optimization.level.none" valueType="enumerated"/>
<option id="xilinx.gnu.compiler.option.debugging.level.1790313049" name="Debug Level" superClass="xilinx.gnu.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> <option id="xilinx.gnu.compiler.option.debugging.level.1790313049" name="Debug Level" superClass="xilinx.gnu.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="xilinx.gnu.compiler.inferred.swplatform.includes.2019787450" name="Software Platform Include Path" superClass="xilinx.gnu.compiler.inferred.swplatform.includes" valueType="includePath"> <option id="xilinx.gnu.compiler.inferred.swplatform.includes.2019787450" name="Software Platform Include Path" superClass="xilinx.gnu.compiler.inferred.swplatform.includes" valueType="includePath">
<listOptionValue builtIn="false" value="../../RTOSDemo_bsp/ps7_cortexa9_0/include"/> <listOptionValue builtIn="false" value="../../RTOSDemo_bsp/ps7_cortexa9_0/include"/>
@ -79,6 +79,18 @@
<tool id="xilinx.gnu.arm.size.debug.484243311" name="ARM Print Size" superClass="xilinx.gnu.arm.size.debug"/> <tool id="xilinx.gnu.arm.size.debug.484243311" name="ARM Print Size" superClass="xilinx.gnu.arm.size.debug"/>
</toolChain> </toolChain>
</folderInfo> </folderInfo>
<fileInfo id="xilinx.gnu.arm.exe.debug.2107277346.2099160792" name="portASM.S" rcbsApplicability="disable" resourcePath="src/FreeRTOS_Source/portable/GCC/ARM_CA9/portASM.S" toolsToInvoke="xilinx.gnu.arm.c.toolchain.compiler.debug.399974114.1026417292">
<tool id="xilinx.gnu.arm.c.toolchain.compiler.debug.399974114.1026417292" name="ARM gcc compiler" superClass="xilinx.gnu.arm.c.toolchain.compiler.debug.399974114">
<option id="xilinx.gnu.compiler.misc.other.767287753" name="Other flags" superClass="xilinx.gnu.compiler.misc.other" value="-c -fmessage-length=0 -Wextra -mthumb" valueType="string"/>
<inputType id="xilinx.gnu.arm.c.compiler.input.1501099958" name="C source files" superClass="xilinx.gnu.arm.c.compiler.input"/>
</tool>
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.251123203" name="Resource Custom Build Step">
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1170511444" name="Resource Custom Build Step Input Type">
<additionalInput kind="additionalinputdependency" paths=""/>
</inputType>
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.386600654" name="Resource Custom Build Step Output Type"/>
</tool>
</fileInfo>
</configuration> </configuration>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>

View file

@ -159,12 +159,6 @@ readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */ FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 1
/* The following constant describe the hardware, and are correct for the
Zynq MPU. */
#define configINTERRUPT_CONTROLLER_BASE_ADDRESS ( XPAR_PS7_SCUGIC_0_DIST_BASEADDR )
#define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET ( -0xf00 )
#define configUNIQUE_INTERRUPT_PRIORITIES 32
/* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS is not required because the time base /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS is not required because the time base
comes from the ulHighFrequencyTimerCounts variable which is incremented in a comes from the ulHighFrequencyTimerCounts variable which is incremented in a
high frequency timer that is already being started as part of the interrupt high frequency timer that is already being started as part of the interrupt
@ -200,10 +194,14 @@ void vAssertCalled( const char * pcFile, unsigned long ulLine );
void vConfigureTickInterrupt( void ); void vConfigureTickInterrupt( void );
#define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt() #define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt()
#define configINSTALL_FREERTOS_VECTOR_TABLE 1
void vClearTickInterrupt( void ); void vClearTickInterrupt( void );
#define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt() #define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt()
/* The following constant describe the hardware, and are correct for the
Zynq MPU. */
#define configINTERRUPT_CONTROLLER_BASE_ADDRESS ( XPAR_PS7_SCUGIC_0_DIST_BASEADDR )
#define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET ( -0xf00 )
#define configUNIQUE_INTERRUPT_PRIORITIES 32
#endif /* FREERTOS_CONFIG_H */ #endif /* FREERTOS_CONFIG_H */

View file

@ -63,10 +63,9 @@
#include "xil_errata.h" #include "xil_errata.h"
#define __ARM_NEON__ 1
.org 0 .org 0
.text .text
.arm
.global _boot .global _boot
.global _freertos_vector_table .global _freertos_vector_table
@ -74,6 +73,7 @@
.global FIQInterrupt .global FIQInterrupt
.global DataAbortInterrupt .global DataAbortInterrupt
.global PrefetchAbortInterrupt .global PrefetchAbortInterrupt
.global vPortInstallFreeRTOSVectorTable
.extern FreeRTOS_IRQ_Handler .extern FreeRTOS_IRQ_Handler
.extern FreeRTOS_SWI_Handler .extern FreeRTOS_SWI_Handler
@ -93,67 +93,49 @@ _irq: .word FreeRTOS_IRQ_Handler
_swi: .word FreeRTOS_SWI_Handler _swi: .word FreeRTOS_SWI_Handler
.align 4
FreeRTOS_FIQHandler: /* FIQ vector handler */ FreeRTOS_FIQHandler: /* FIQ vector handler */
stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */ stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */
#ifdef __ARM_NEON__
vpush {d0-d7}
vpush {d16-d31}
vmrs r1, FPSCR
push {r1}
vmrs r1, FPEXC
push {r1}
#endif
FIQLoop: FIQLoop:
bl FIQInterrupt /* FIQ vector */ blx FIQInterrupt /* FIQ vector */
#ifdef __ARM_NEON__
pop {r1}
vmsr FPEXC, r1
pop {r1}
vmsr FPSCR, r1
vpop {d16-d31}
vpop {d0-d7}
#endif
ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */ ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */
subs pc, lr, #4 /* adjust return */ subs pc, lr, #4 /* adjust return */
.align 4
FreeRTOS_Undefined: /* Undefined handler */ FreeRTOS_Undefined: /* Undefined handler */
stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */ b .
ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */
b _prestart
movs pc, lr
.align 4
FreeRTOS_DataAbortHandler: /* Data Abort handler */ FreeRTOS_DataAbortHandler: /* Data Abort handler */
#ifdef CONFIG_ARM_ERRATA_775420 #ifdef CONFIG_ARM_ERRATA_775420
dsb dsb
#endif #endif
stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */ stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */
blx DataAbortInterrupt /*DataAbortInterrupt :call C function here */
bl DataAbortInterrupt /*DataAbortInterrupt :call C function here */
ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */ ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */
subs pc, lr, #4 /* adjust return */ subs pc, lr, #4 /* adjust return */
.align 4
FreeRTOS_PrefetchAbortHandler: /* Prefetch Abort handler */ FreeRTOS_PrefetchAbortHandler: /* Prefetch Abort handler */
#ifdef CONFIG_ARM_ERRATA_775420 #ifdef CONFIG_ARM_ERRATA_775420
dsb dsb
#endif #endif
stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */ stmdb sp!,{r0-r3,r12,lr} /* state save from compiled code */
blx PrefetchAbortInterrupt /* PrefetchAbortInterrupt: call C function here */
bl PrefetchAbortInterrupt /* PrefetchAbortInterrupt: call C function here */
ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */ ldmia sp!,{r0-r3,r12,lr} /* state restore from compiled code */
subs pc, lr, #4 /* adjust return */ subs pc, lr, #4 /* adjust return */
.align 4
.type vPortInstallFreeRTOSVectorTable, %function
vPortInstallFreeRTOSVectorTable:
/* Set VBAR to the vector table that contains the FreeRTOS handlers. */
ldr r0, =_freertos_vector_table
mcr p15, 0, r0, c12, c0, 0
dsb
isb
bx lr
.end .end

View file

@ -99,6 +99,7 @@ const uint8_t ucRisingEdge = 3;
pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID ); pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID );
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress ); xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* The priority must be the lowest possible. */ /* The priority must be the lowest possible. */
XScuGic_SetPriorityTriggerType( &xInterruptController, XPAR_SCUTIMER_INTR, portLOWEST_USABLE_INTERRUPT_PRIORITY << portPRIORITY_SHIFT, ucRisingEdge ); XScuGic_SetPriorityTriggerType( &xInterruptController, XPAR_SCUTIMER_INTR, portLOWEST_USABLE_INTERRUPT_PRIORITY << portPRIORITY_SHIFT, ucRisingEdge );
@ -106,11 +107,13 @@ const uint8_t ucRisingEdge = 3;
/* Install the FreeRTOS tick handler. */ /* Install the FreeRTOS tick handler. */
xStatus = XScuGic_Connect( &xInterruptController, XPAR_SCUTIMER_INTR, (Xil_ExceptionHandler) FreeRTOS_Tick_Handler, ( void * ) &xTimer ); xStatus = XScuGic_Connect( &xInterruptController, XPAR_SCUTIMER_INTR, (Xil_ExceptionHandler) FreeRTOS_Tick_Handler, ( void * ) &xTimer );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Initialise the timer. */ /* Initialise the timer. */
pxTimerConfig = XScuTimer_LookupConfig( XPAR_SCUTIMER_DEVICE_ID ); pxTimerConfig = XScuTimer_LookupConfig( XPAR_SCUTIMER_DEVICE_ID );
xStatus = XScuTimer_CfgInitialize( &xTimer, pxTimerConfig, pxTimerConfig->BaseAddr ); xStatus = XScuTimer_CfgInitialize( &xTimer, pxTimerConfig, pxTimerConfig->BaseAddr );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Enable Auto reload mode. */ /* Enable Auto reload mode. */
XScuTimer_EnableAutoReload( &xTimer ); XScuTimer_EnableAutoReload( &xTimer );

View file

@ -81,6 +81,7 @@
.arm .arm
/* This function is explained in the comments at the top of main-full.c. */ /* This function is explained in the comments at the top of main-full.c. */
.type vRegTest1Implementation, %function
vRegTest1Implementation: vRegTest1Implementation:
/* Fill each general purpose register with a known value. */ /* Fill each general purpose register with a known value. */
@ -370,6 +371,7 @@ reg1_error_loop:
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
.type vRegTest2Implementation, %function
vRegTest2Implementation: vRegTest2Implementation:
/* Put a known value in each register. */ /* Put a known value in each register. */

View file

@ -150,6 +150,7 @@ XUartPs_Config *pxConfig;
/* Initialise the driver. */ /* Initialise the driver. */
xStatus = XUartPs_CfgInitialize( &xUARTInstance, pxConfig, XPAR_PS7_UART_1_BASEADDR ); xStatus = XUartPs_CfgInitialize( &xUARTInstance, pxConfig, XPAR_PS7_UART_1_BASEADDR );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Misc. parameter configuration. */ /* Misc. parameter configuration. */
XUartPs_SetBaudRate( &xUARTInstance, ulWantedBaud ); XUartPs_SetBaudRate( &xUARTInstance, ulWantedBaud );
@ -159,6 +160,7 @@ XUartPs_Config *pxConfig;
file. */ file. */
xStatus = XScuGic_Connect( &xInterruptController, XPAR_XUARTPS_1_INTR, (Xil_ExceptionHandler) prvUART_Handler, (void *) &xUARTInstance ); xStatus = XScuGic_Connect( &xInterruptController, XPAR_XUARTPS_1_INTR, (Xil_ExceptionHandler) prvUART_Handler, (void *) &xUARTInstance );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Ensure interrupts start clear. */ /* Ensure interrupts start clear. */
XUartPs_WriteReg( XPAR_PS7_UART_1_BASEADDR, XUARTPS_ISR_OFFSET, XUARTPS_IXR_MASK ); XUartPs_WriteReg( XPAR_PS7_UART_1_BASEADDR, XUARTPS_ISR_OFFSET, XUARTPS_IXR_MASK );
@ -243,6 +245,9 @@ char cChar;
configASSERT( pvNotUsed == &xUARTInstance ); configASSERT( pvNotUsed == &xUARTInstance );
/* Remove compile warnings if configASSERT() is not defined. */
( void ) pvNotUsed;
/* Read the interrupt ID register to see which interrupt is active. */ /* Read the interrupt ID register to see which interrupt is active. */
ulActiveInterrupts = XUartPs_ReadReg(XPAR_PS7_UART_1_BASEADDR, XUARTPS_IMR_OFFSET); ulActiveInterrupts = XUartPs_ReadReg(XPAR_PS7_UART_1_BASEADDR, XUARTPS_IMR_OFFSET);
ulActiveInterrupts &= XUartPs_ReadReg(XPAR_PS7_UART_1_BASEADDR, XUARTPS_ISR_OFFSET); ulActiveInterrupts &= XUartPs_ReadReg(XPAR_PS7_UART_1_BASEADDR, XUARTPS_ISR_OFFSET);

View file

@ -99,6 +99,7 @@ BaseType_t xStatus;
pxConfigPtr = XGpioPs_LookupConfig( XPAR_XGPIOPS_0_DEVICE_ID ); pxConfigPtr = XGpioPs_LookupConfig( XPAR_XGPIOPS_0_DEVICE_ID );
xStatus = XGpioPs_CfgInitialize( &xGpio, pxConfigPtr, pxConfigPtr->BaseAddr ); xStatus = XGpioPs_CfgInitialize( &xGpio, pxConfigPtr, pxConfigPtr->BaseAddr );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Enable outputs and set low. */ /* Enable outputs and set low. */
XGpioPs_SetDirectionPin( &xGpio, partstLED_OUTPUT, partstDIRECTION_OUTPUT ); XGpioPs_SetDirectionPin( &xGpio, partstLED_OUTPUT, partstDIRECTION_OUTPUT );

View file

@ -109,7 +109,7 @@
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo, /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
or 0 to run the more comprehensive test and demo application. */ or 0 to run the more comprehensive test and demo application. */
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0 #define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -128,6 +128,14 @@ static void prvSetupHardware( void );
extern void main_full( void ); extern void main_full( void );
#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */ #endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */
/*
* The Xilinx projects use a BSP that do not allow the start up code to be
* altered easily. Therefore the vector table used by FreeRTOS is defined in
* FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
* FreeRTOS vector table.
*/
extern void vPortInstallFreeRTOSVectorTable( void );
/* Prototypes for the standard FreeRTOS callback/hook functions implemented /* Prototypes for the standard FreeRTOS callback/hook functions implemented
within this file. */ within this file. */
void vApplicationMallocFailedHook( void ); void vApplicationMallocFailedHook( void );
@ -187,9 +195,16 @@ XScuGic_Config *pxGICConfig;
/* Install a default handler for each GIC interrupt. */ /* Install a default handler for each GIC interrupt. */
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress ); xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
configASSERT( xStatus == XST_SUCCESS ); configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */
/* Initialise the LED port. */ /* Initialise the LED port. */
vParTestInitialise(); vParTestInitialise();
/* The Xilinx projects use a BSP that do not allow the start up code to be
altered easily. Therefore the vector table used by FreeRTOS is defined in
FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the
FreeRTOS vector table. */
vPortInstallFreeRTOSVectorTable();
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

View file

@ -15,7 +15,6 @@ BEGIN PROCESSOR
PARAMETER DRIVER_NAME = cpu_cortexa9 PARAMETER DRIVER_NAME = cpu_cortexa9
PARAMETER DRIVER_VER = 1.01.a PARAMETER DRIVER_VER = 1.01.a
PARAMETER HW_INSTANCE = ps7_cortexa9_0 PARAMETER HW_INSTANCE = ps7_cortexa9_0
PARAMETER EXTRA_COMPILER_FLAGS = -g -O0
END END