]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Source / portable / RVDS / ARM_CM3 / port.c
index 4142a11df08d01cc034be606f06e3639787b938d..f9528e50aeb789722637f7307e642f7dd91f7b6f 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -8,7 +8,7 @@
 \r
     FreeRTOS is free software; you can redistribute it and/or modify it under\r
     the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
 \r
     ***************************************************************************\r
     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
@@ -133,9 +133,6 @@ is defined. */
 /* Constants required to set up the initial stack. */\r
 #define portINITIAL_XPSR                       ( 0x01000000 )\r
 \r
-/* Constants used with memory barrier intrinsics. */\r
-#define portSY_FULL_READ_WRITE         ( 15 )\r
-\r
 /* The systick is a 24-bit counter. */\r
 #define portMAX_24_BIT_NUMBER                          ( 0xffffffUL )\r
 \r
@@ -362,24 +359,10 @@ void vPortEndScheduler( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortYield( void )\r
-{\r
-       /* Set a PendSV to request a context switch. */\r
-       portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
-\r
-       /* Barriers are normally not required but do ensure the code is completely\r
-       within the specified behaviour for the architecture. */\r
-       __dsb( portSY_FULL_READ_WRITE );\r
-       __isb( portSY_FULL_READ_WRITE );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 void vPortEnterCritical( void )\r
 {\r
        portDISABLE_INTERRUPTS();\r
        uxCriticalNesting++;\r
-       __dsb( portSY_FULL_READ_WRITE );\r
-       __isb( portSY_FULL_READ_WRITE );\r
 \r
        /* This is not the interrupt safe version of the enter critical function so\r
        assert() if it is being called from an interrupt context.  Only API\r
@@ -424,6 +407,8 @@ __asm void xPortPendSVHandler( void )
        stmdb sp!, {r3, r14}\r
        mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
        msr basepri, r0\r
+       dsb\r
+       isb\r
        bl vTaskSwitchContext\r
        mov r0, #0\r
        msr basepri, r0\r
@@ -444,8 +429,9 @@ void xPortSysTickHandler( void )
        /* The SysTick runs at the lowest interrupt priority, so when this interrupt\r
        executes all interrupts must be unmasked.  There is therefore no need to\r
        save and then restore the interrupt mask value as its value is already\r
-       known. */\r
-       ( void ) portSET_INTERRUPT_MASK_FROM_ISR();\r
+       known - therefore the slightly faster vPortRaiseBASEPRI() function is used\r
+       in place of portSET_INTERRUPT_MASK_FROM_ISR(). */\r
+       vPortRaiseBASEPRI();\r
        {\r
                /* Increment the RTOS tick. */\r
                if( xTaskIncrementTick() != pdFALSE )\r
@@ -455,7 +441,7 @@ void xPortSysTickHandler( void )
                        portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
                }\r
        }\r
-       portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );\r
+       vPortClearBASEPRIFromISR();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -589,7 +575,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
@@ -637,26 +623,6 @@ void xPortSysTickHandler( void )
 #endif /* configOVERRIDE_DEFAULT_TICK_CONFIGURATION */\r
 /*-----------------------------------------------------------*/\r
 \r
-__asm uint32_t ulPortSetInterruptMask( void )\r
-{\r
-       PRESERVE8\r
-\r
-       mrs r0, basepri\r
-       mov r1, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
-       msr basepri, r1\r
-       bx r14\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-__asm void vPortClearInterruptMask( uint32_t ulNewMask )\r
-{\r
-       PRESERVE8\r
-\r
-       msr basepri, r0\r
-       bx r14\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 __asm uint32_t vPortGetIPSR( void )\r
 {\r
        PRESERVE8\r