]> 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 2588d6c9def6c2642843cd213f2badf999bec5bc..f9528e50aeb789722637f7307e642f7dd91f7b6f 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.0 - 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,14 +8,14 @@
 \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
+    ***************************************************************************\r
     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
     >>!   obliged to provide the source code for proprietary components     !<<\r
     >>!   outside of the FreeRTOS kernel.                                   !<<\r
-       ***************************************************************************\r
+    ***************************************************************************\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
     ***************************************************************************\r
 \r
     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-       the FAQ page "My application does not run, what could be wrong?".  Have you\r
-       defined configASSERT()?\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
 \r
-       http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-       embedded software for free we request you assist our global community by\r
-       participating in the support forum.\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
 \r
-       http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-       be as productive as possible as early as possible.  Now you can receive\r
-       FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-       Ltd, and the world's leading authority on the world's leading RTOS.\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\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
@@ -271,6 +268,7 @@ __asm void prvStartFirstTask( void )
        ldr r0, =0xE000ED08\r
        ldr r0, [r0]\r
        ldr r0, [r0]\r
+\r
        /* Set the msp back to the start of the stack. */\r
        msr msp, r0\r
        /* Globally enable interrupts. */\r
@@ -361,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
@@ -423,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
@@ -443,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
@@ -454,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
@@ -588,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
@@ -636,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