summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c')
-rw-r--r--FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c b/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
index c57f1fa7f..35124d7ac 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
@@ -99,10 +99,10 @@ is defined. */
#endif
/* Constants required to manipulate the core. Registers first... */
-#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )
-#define portNVIC_SYSTICK_LOAD_REG ( * ( ( volatile unsigned long * ) 0xe000e014 ) )
-#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( * ( ( volatile unsigned long * ) 0xe000e018 ) )
-#define portNVIC_SYSPRI2_REG ( * ( ( volatile unsigned long * ) 0xe000ed20 ) )
+#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000e010 ) )
+#define portNVIC_SYSTICK_LOAD_REG ( * ( ( volatile uint32_t * ) 0xe000e014 ) )
+#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( * ( ( volatile uint32_t * ) 0xe000e018 ) )
+#define portNVIC_SYSPRI2_REG ( * ( ( volatile uint32_t * ) 0xe000ed20 ) )
/* ...then bits in the registers. */
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
@@ -110,16 +110,16 @@ is defined. */
#define portNVIC_PENDSVCLEAR_BIT ( 1UL << 27UL )
#define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL )
-#define portNVIC_PENDSV_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )
-#define portNVIC_SYSTICK_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
+#define portNVIC_PENDSV_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )
+#define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
/* Constants required to check the validity of an interrupt priority. */
#define portFIRST_USER_INTERRUPT_NUMBER ( 16 )
#define portNVIC_IP_REGISTERS_OFFSET_16 ( 0xE000E3F0 )
-#define portAIRCR_REG ( * ( ( volatile unsigned long * ) 0xE000ED0C ) )
-#define portMAX_8_BIT_VALUE ( ( unsigned char ) 0xff )
-#define portTOP_BIT_OF_BYTE ( ( unsigned char ) 0x80 )
-#define portMAX_PRIGROUP_BITS ( ( unsigned char ) 7 )
+#define portAIRCR_REG ( * ( ( volatile uint32_t * ) 0xE000ED0C ) )
+#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
+#define portTOP_BIT_OF_BYTE ( ( uint8_t ) 0x80 )
+#define portMAX_PRIGROUP_BITS ( ( uint8_t ) 7 )
#define portPRIORITY_GROUP_MASK ( 0x07UL << 8UL )
#define portPRIGROUP_SHIFT ( 8UL )
@@ -139,7 +139,7 @@ calculations. */
/* Each task maintains its own interrupt status in the critical nesting
variable. */
-static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;
+static UBaseType_t uxCriticalNesting = 0xaaaaaaaa;
/*
* Setup the timer to generate the tick interrupts. The implementation in this
@@ -171,7 +171,7 @@ static void prvTaskExitError( void );
* The number of SysTick increments that make up one tick period.
*/
#if configUSE_TICKLESS_IDLE == 1
- static unsigned long ulTimerCountsForOneTick = 0;
+ static uint32_t ulTimerCountsForOneTick = 0;
#endif /* configUSE_TICKLESS_IDLE */
/*
@@ -179,7 +179,7 @@ static void prvTaskExitError( void );
* 24 bit resolution of the SysTick timer.
*/
#if configUSE_TICKLESS_IDLE == 1
- static unsigned long xMaximumPossibleSuppressedTicks = 0;
+ static uint32_t xMaximumPossibleSuppressedTicks = 0;
#endif /* configUSE_TICKLESS_IDLE */
/*
@@ -187,7 +187,7 @@ static void prvTaskExitError( void );
* power functionality only.
*/
#if configUSE_TICKLESS_IDLE == 1
- static unsigned long ulStoppedTimerCompensation = 0;
+ static uint32_t ulStoppedTimerCompensation = 0;
#endif /* configUSE_TICKLESS_IDLE */
/*
@@ -196,9 +196,9 @@ static void prvTaskExitError( void );
* a priority above configMAX_SYSCALL_INTERRUPT_PRIORITY.
*/
#if ( configASSERT_DEFINED == 1 )
- static unsigned char ucMaxSysCallPriority = 0;
- static unsigned long ulMaxPRIGROUPValue = 0;
- static const volatile unsigned char * const pcInterruptPriorityRegisters = ( unsigned char * ) portNVIC_IP_REGISTERS_OFFSET_16;
+ static uint8_t ucMaxSysCallPriority = 0;
+ static uint32_t ulMaxPRIGROUPValue = 0;
+ static const volatile uint8_t * const pcInterruptPriorityRegisters = ( uint8_t * ) portNVIC_IP_REGISTERS_OFFSET_16;
#endif /* configASSERT_DEFINED */
/*-----------------------------------------------------------*/
@@ -206,19 +206,19 @@ static void prvTaskExitError( void );
/*
* See header file for description.
*/
-portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
/* Simulate the stack frame as it would be created by a context switch
interrupt. */
pxTopOfStack--; /* Offset added to account for the way the MCU uses the stack on entry/exit of interrupts. */
*pxTopOfStack = portINITIAL_XPSR; /* xPSR */
pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* PC */
+ *pxTopOfStack = ( StackType_t ) pxCode; /* PC */
pxTopOfStack--;
- *pxTopOfStack = ( portSTACK_TYPE ) prvTaskExitError; /* LR */
+ *pxTopOfStack = ( StackType_t ) prvTaskExitError; /* LR */
pxTopOfStack -= 5; /* R12, R3, R2 and R1. */
- *pxTopOfStack = ( portSTACK_TYPE ) pvParameters; /* R0 */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */
return pxTopOfStack;
@@ -279,13 +279,13 @@ __asm void prvStartFirstTask( void )
/*
* See header file for description.
*/
-portBASE_TYPE xPortStartScheduler( void )
+BaseType_t xPortStartScheduler( void )
{
#if( configASSERT_DEFINED == 1 )
{
- volatile unsigned long ulOriginalPriority;
- volatile char * const pcFirstUserPriorityRegister = ( char * ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );
- volatile unsigned char ucMaxPriorityValue;
+ volatile uint32_t ulOriginalPriority;
+ volatile int8_t * const pcFirstUserPriorityRegister = ( int8_t * ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );
+ volatile uint8_t ucMaxPriorityValue;
/* Determine the maximum priority from which ISR safe FreeRTOS API
functions can be called. ISR safe functions are those that end in
@@ -311,7 +311,7 @@ portBASE_TYPE xPortStartScheduler( void )
while( ( ucMaxPriorityValue & portTOP_BIT_OF_BYTE ) == portTOP_BIT_OF_BYTE )
{
ulMaxPRIGROUPValue--;
- ucMaxPriorityValue <<= ( unsigned char ) 0x01;
+ ucMaxPriorityValue <<= ( uint8_t ) 0x01;
}
/* Shift the priority group value back to its position within the AIRCR
@@ -441,10 +441,10 @@ void xPortSysTickHandler( void )
#if configUSE_TICKLESS_IDLE == 1
- __weak void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )
+ __weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
{
- unsigned long ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements, ulSysTickCTRL;
- portTickType xModifiableIdleTime;
+ uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements, ulSysTickCTRL;
+ TickType_t xModifiableIdleTime;
/* Make sure the SysTick reload value does not overflow the counter. */
if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
@@ -530,7 +530,7 @@ void xPortSysTickHandler( void )
if( ( ulSysTickCTRL & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )
{
- unsigned long ulCalculatedLoadValue;
+ uint32_t ulCalculatedLoadValue;
/* The tick interrupt has already executed, and the SysTick
count reloaded with ulReloadValue. Reset the
@@ -617,7 +617,7 @@ void xPortSysTickHandler( void )
#endif /* configOVERRIDE_DEFAULT_TICK_CONFIGURATION */
/*-----------------------------------------------------------*/
-__asm unsigned long ulPortSetInterruptMask( void )
+__asm uint32_t ulPortSetInterruptMask( void )
{
PRESERVE8
@@ -628,7 +628,7 @@ __asm unsigned long ulPortSetInterruptMask( void )
}
/*-----------------------------------------------------------*/
-__asm void vPortClearInterruptMask( unsigned long ulNewMask )
+__asm void vPortClearInterruptMask( uint32_t ulNewMask )
{
PRESERVE8
@@ -637,7 +637,7 @@ __asm void vPortClearInterruptMask( unsigned long ulNewMask )
}
/*-----------------------------------------------------------*/
-__asm unsigned long vPortGetIPSR( void )
+__asm uint32_t vPortGetIPSR( void )
{
PRESERVE8
@@ -650,8 +650,8 @@ __asm unsigned long vPortGetIPSR( void )
void vPortValidateInterruptPriority( void )
{
- unsigned long ulCurrentInterrupt;
- unsigned char ucCurrentPriority;
+ uint32_t ulCurrentInterrupt;
+ uint8_t ucCurrentPriority;
/* Obtain the number of the currently executing interrupt. */
ulCurrentInterrupt = vPortGetIPSR();