mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update Cortex-A port layers to ensure the ICCRPR and ICCPMR registers are always accessed as 32-bit values.
This commit is contained in:
parent
d59bf60ff9
commit
29a08b5e24
|
@ -120,7 +120,7 @@ this value. */
|
||||||
|
|
||||||
/* In all GICs 255 can be written to the priority mask register to unmask all
|
/* In all GICs 255 can be written to the priority mask register to unmask all
|
||||||
(but the lowest) interrupt priority. */
|
(but the lowest) interrupt priority. */
|
||||||
#define portUNMASK_VALUE ( 0xFF )
|
#define portUNMASK_VALUE ( 0xFFUL )
|
||||||
|
|
||||||
/* Tasks are not created with a floating point context, but can be given a
|
/* Tasks are not created with a floating point context, but can be given a
|
||||||
floating point context after they have been created. A variable is stored as
|
floating point context after they have been created. A variable is stored as
|
||||||
|
@ -407,7 +407,7 @@ void FreeRTOS_Tick_Handler( void )
|
||||||
necessary to turn off interrupts in the CPU itself while the ICCPMR is being
|
necessary to turn off interrupts in the CPU itself while the ICCPMR is being
|
||||||
updated. */
|
updated. */
|
||||||
portCPU_IRQ_DISABLE();
|
portCPU_IRQ_DISABLE();
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "dsb \n"
|
__asm( "dsb \n"
|
||||||
"isb \n" );
|
"isb \n" );
|
||||||
portCPU_IRQ_ENABLE();
|
portCPU_IRQ_ENABLE();
|
||||||
|
@ -453,7 +453,7 @@ uint32_t ulReturn;
|
||||||
/* Interrupt in the CPU must be turned off while the ICCPMR is being
|
/* Interrupt in the CPU must be turned off while the ICCPMR is being
|
||||||
updated. */
|
updated. */
|
||||||
portCPU_IRQ_DISABLE();
|
portCPU_IRQ_DISABLE();
|
||||||
if( portICCPMR_PRIORITY_MASK_REGISTER == ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
||||||
{
|
{
|
||||||
/* Interrupts were already masked. */
|
/* Interrupts were already masked. */
|
||||||
ulReturn = pdTRUE;
|
ulReturn = pdTRUE;
|
||||||
|
@ -461,7 +461,7 @@ uint32_t ulReturn;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturn = pdFALSE;
|
ulReturn = pdFALSE;
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "dsb \n"
|
__asm( "dsb \n"
|
||||||
"isb \n" );
|
"isb \n" );
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ uint32_t ulReturn;
|
||||||
The following links provide detailed information:
|
The following links provide detailed information:
|
||||||
http://www.freertos.org/RTOS-Cortex-M3-M4.html
|
http://www.freertos.org/RTOS-Cortex-M3-M4.html
|
||||||
http://www.freertos.org/FAQHelp.html */
|
http://www.freertos.org/FAQHelp.html */
|
||||||
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
||||||
|
|
||||||
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
||||||
that define each interrupt's priority to be split between bits that
|
that define each interrupt's priority to be split between bits that
|
||||||
|
|
|
@ -215,12 +215,12 @@ number of bits implemented by the interrupt controller. */
|
||||||
#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
|
#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
|
||||||
|
|
||||||
#define portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET )
|
#define portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET )
|
||||||
#define portICCPMR_PRIORITY_MASK_REGISTER ( *( ( volatile uint8_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET ) ) )
|
#define portICCPMR_PRIORITY_MASK_REGISTER ( *( ( volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET ) ) )
|
||||||
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET )
|
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET )
|
||||||
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
||||||
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
||||||
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
||||||
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint8_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ this value. */
|
||||||
|
|
||||||
/* In all GICs 255 can be written to the priority mask register to unmask all
|
/* In all GICs 255 can be written to the priority mask register to unmask all
|
||||||
(but the lowest) interrupt priority. */
|
(but the lowest) interrupt priority. */
|
||||||
#define portUNMASK_VALUE ( 0xFF )
|
#define portUNMASK_VALUE ( 0xFFUL )
|
||||||
|
|
||||||
/* Tasks are not created with a floating point context, but can be given a
|
/* Tasks are not created with a floating point context, but can be given a
|
||||||
floating point context after they have been created. A variable is stored as
|
floating point context after they have been created. A variable is stored as
|
||||||
|
@ -344,7 +344,7 @@ void FreeRTOS_Tick_Handler( void )
|
||||||
handler runs at the lowest priority, so interrupts cannot already be masked,
|
handler runs at the lowest priority, so interrupts cannot already be masked,
|
||||||
so there is no need to save and restore the current mask value. */
|
so there is no need to save and restore the current mask value. */
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "DSB \n"
|
__asm( "DSB \n"
|
||||||
"ISB \n" );
|
"ISB \n" );
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
@ -388,7 +388,7 @@ uint32_t ulPortSetInterruptMask( void )
|
||||||
uint32_t ulReturn;
|
uint32_t ulReturn;
|
||||||
|
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
if( portICCPMR_PRIORITY_MASK_REGISTER == ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
||||||
{
|
{
|
||||||
/* Interrupts were already masked. */
|
/* Interrupts were already masked. */
|
||||||
ulReturn = pdTRUE;
|
ulReturn = pdTRUE;
|
||||||
|
@ -396,7 +396,7 @@ uint32_t ulReturn;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturn = pdFALSE;
|
ulReturn = pdFALSE;
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "DSB \n"
|
__asm( "DSB \n"
|
||||||
"ISB \n" );
|
"ISB \n" );
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ uint32_t ulReturn;
|
||||||
The following links provide detailed information:
|
The following links provide detailed information:
|
||||||
http://www.freertos.org/RTOS-Cortex-M3-M4.html
|
http://www.freertos.org/RTOS-Cortex-M3-M4.html
|
||||||
http://www.freertos.org/FAQHelp.html */
|
http://www.freertos.org/FAQHelp.html */
|
||||||
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
||||||
|
|
||||||
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
||||||
that define each interrupt's priority to be split between bits that
|
that define each interrupt's priority to be split between bits that
|
||||||
|
|
|
@ -228,12 +228,12 @@ number of bits implemented by the interrupt controller. */
|
||||||
#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
|
#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
|
||||||
|
|
||||||
#define portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET )
|
#define portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET )
|
||||||
#define portICCPMR_PRIORITY_MASK_REGISTER ( *( ( volatile uint8_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET ) ) )
|
#define portICCPMR_PRIORITY_MASK_REGISTER ( *( ( volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET ) ) )
|
||||||
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET )
|
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET )
|
||||||
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
||||||
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
||||||
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
||||||
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint8_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ this value. */
|
||||||
|
|
||||||
/* In all GICs 255 can be written to the priority mask register to unmask all
|
/* In all GICs 255 can be written to the priority mask register to unmask all
|
||||||
(but the lowest) interrupt priority. */
|
(but the lowest) interrupt priority. */
|
||||||
#define portUNMASK_VALUE ( 0xFF )
|
#define portUNMASK_VALUE ( 0xFFUL )
|
||||||
|
|
||||||
/* Tasks are not created with a floating point context, but can be given a
|
/* Tasks are not created with a floating point context, but can be given a
|
||||||
floating point context after they have been created. A variable is stored as
|
floating point context after they have been created. A variable is stored as
|
||||||
|
@ -162,7 +162,7 @@ context. */
|
||||||
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
|
||||||
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
|
||||||
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
|
||||||
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint8_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
|
||||||
|
|
||||||
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
|
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
|
||||||
point is zero. */
|
point is zero. */
|
||||||
|
@ -383,7 +383,7 @@ void FreeRTOS_Tick_Handler( void )
|
||||||
handler runs at the lowest priority, so interrupts cannot already be masked,
|
handler runs at the lowest priority, so interrupts cannot already be masked,
|
||||||
so there is no need to save and restore the current mask value. */
|
so there is no need to save and restore the current mask value. */
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "DSB \n"
|
__asm( "DSB \n"
|
||||||
"ISB \n" );
|
"ISB \n" );
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
@ -427,7 +427,7 @@ uint32_t ulPortSetInterruptMask( void )
|
||||||
uint32_t ulReturn;
|
uint32_t ulReturn;
|
||||||
|
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
if( portICCPMR_PRIORITY_MASK_REGISTER == ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
||||||
{
|
{
|
||||||
/* Interrupts were already masked. */
|
/* Interrupts were already masked. */
|
||||||
ulReturn = pdTRUE;
|
ulReturn = pdTRUE;
|
||||||
|
@ -435,7 +435,7 @@ uint32_t ulReturn;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturn = pdFALSE;
|
ulReturn = pdFALSE;
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm( "DSB \n"
|
__asm( "DSB \n"
|
||||||
"ISB \n" );
|
"ISB \n" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -804,7 +804,7 @@ Timer_t *pxTimer = ( Timer_t * ) xTimer;
|
||||||
/* Checking to see if it is in the NULL list in effect checks to see if
|
/* Checking to see if it is in the NULL list in effect checks to see if
|
||||||
it is referenced from either the current or the overflow timer lists in
|
it is referenced from either the current or the overflow timer lists in
|
||||||
one go, but the logic has to be reversed, hence the '!'. */
|
one go, but the logic has to be reversed, hence the '!'. */
|
||||||
xTimerIsInActiveList = !( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) );
|
xTimerIsInActiveList = ( BaseType_t ) !( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) );
|
||||||
}
|
}
|
||||||
taskEXIT_CRITICAL();
|
taskEXIT_CRITICAL();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue