Update to V4.3.0 as described in http://www.FreeRTOS.org/History.txt

This commit is contained in:
Richard Barry 2007-06-05 09:56:16 +00:00
parent 017740b75a
commit 623aa3675f
110 changed files with 680 additions and 606 deletions

View file

@ -1,5 +1,5 @@
/*
FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
This file is part of the FreeRTOS.org distribution.
@ -19,13 +19,13 @@
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS.org, without being obliged to provide
the source code for any proprietary components. See the licensing section
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
@ -33,6 +33,12 @@
***************************************************************************
*/
/*
Change from V4.2.1:
+ Introduced usage of configKERNEL_INTERRUPT_PRIORITY macro to set the
interrupt priority used by the kernel.
*/
/*-----------------------------------------------------------
* Implementation of functions defined in portable.h for the ARM CM3 port.
@ -52,18 +58,24 @@
#define portNVIC_SYSTICK_INT 0x00000002
#define portNVIC_SYSTICK_ENABLE 0x00000001
#define portNVIC_PENDSVSET 0x10000000
#define portNVIC_PENDSV_PRI 0x00ff0000
#define portNVIC_SVCALL_PRI 0xff000000
#define portNVIC_SYSTICK_PRI 0xff000000
#define portNVIC_PENDSV_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 16 )
#define portNVIC_SYSTICK_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24 )
/* Constants required to set up the initial stack. */
#define portINITIAL_XPSR ( 0x01000000 )
/* For backward compatibility, ensure configKERNEL_INTERRUPT_PRIORITY is
defined. The value zero should also ensure backward compatibility.
FreeRTOS.org versions prior to V4.3.0 did not include this definition. */
#ifndef configKERNEL_INTERRUPT_PRIORITY
#define configKERNEL_INTERRUPT_PRIORITY 255
#endif
/* Each task maintains its own interrupt status in the critical nesting
variable. */
unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;
/*
/*
* Setup the timer to generate the tick interrupts.
*/
static void prvSetupTimerInterrupt( void );
@ -76,8 +88,8 @@ extern void vSetPSP( unsigned long ulValue );
/*-----------------------------------------------------------*/
/*
* See header file for description.
/*
* See header file for description.
*/
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
@ -97,12 +109,12 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
}
/*-----------------------------------------------------------*/
/*
* See header file for description.
/*
* See header file for description.
*/
portBASE_TYPE xPortStartScheduler( void )
{
/* Make PendSV, CallSV and SysTick the lowest priority interrupts. */
/* Make PendSV and SysTick the lowest priority interrupts. */
*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;
*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;
@ -169,5 +181,21 @@ void prvSetupTimerInterrupt( void )
*(portNVIC_SYSTICK_LOAD) = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
*(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE;
}
/*-----------------------------------------------------------*/
void vPortSwitchContext( void )
{
vPortSetInterruptMask();
vTaskSwitchContext();
vPortClearInterruptMask();
}
/*-----------------------------------------------------------*/
void vPortIncrementTick( void )
{
vPortSetInterruptMask();
vTaskIncrementTick();
vPortClearInterruptMask();
}

View file

@ -1,5 +1,5 @@
/*
FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
This file is part of the FreeRTOS.org distribution.
@ -19,26 +19,42 @@
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS.org, without being obliged to provide
the source code for any proprietary components. See the licensing section
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
with commercial development and support options.
***************************************************************************
*/
/*
Change from V4.2.1:
+ Introduced usage of configKERNEL_INTERRUPT_PRIORITY macro to set the
interrupt priority used by the kernel.
*/
#include <FreeRTOSConfig.h>
/* For backward compatibility, ensure configKERNEL_INTERRUPT_PRIORITY is
defined. The value zero should also ensure backward compatibility.
FreeRTOS.org versions prior to V4.3.0 did not include this definition. */
#ifndef configKERNEL_INTERRUPT_PRIORITY
#define configKERNEL_INTERRUPT_PRIORITY 0
#endif
RSEG ICODE:CODE
EXTERN vPortYieldFromISR
EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick
EXTERN vPortSwitchContext
EXTERN vPortIncrementTick
EXTERN uxCriticalNesting
EXTERN pxCurrentTCB
@ -46,16 +62,20 @@
PUBLIC vSetMSP
PUBLIC xPortPendSVHandler
PUBLIC xPortSysTickHandler
PUBLIC vPortSetInterruptMask
PUBLIC vPortClearInterruptMask
vSetPSP:
msr psp, r0
bx lr
/*-----------------------------------------------------------*/
vSetMSP
msr msp, r0
bx lr
/*-----------------------------------------------------------*/
xPortPendSVHandler:
@ -73,11 +93,9 @@ xPortPendSVHandler:
ldr r1, [r1]
str r0, [r1]
no_save:
ldr r0, =vTaskSwitchContext
ldr r0, =vPortSwitchContext
push {r14}
cpsid i
blx r0
cpsie i
pop {r14}
/* Restore the context. */
@ -96,37 +114,61 @@ no_save:
bx r14
sv_disable_interrupts:
cpsid i
mov r1, #configKERNEL_INTERRUPT_PRIORITY
msr basepri, R1
bx r14
/*-----------------------------------------------------------*/
xPortSysTickHandler:
/* Call the scheduler tick function. */
ldr r0, =vTaskIncrementTick
ldr r0, =vPortIncrementTick
push {r14}
cpsid i
blx r0
cpsie i
pop {r14}
pop {r14}
/* If using preemption, also force a context switch. */
#if configUSE_PREEMPTION == 1
push {r14}
ldr r0, =vPortYieldFromISR
blx r0
pop {r14}
pop {r14}
#endif
/* Exit with interrupts in the correct state. */
ldr r2, =uxCriticalNesting
ldr r2, [r2]
cbnz r2, tick_disable_interrupts
bx r14
tick_disable_interrupts:
cpsid i
bx r14
END
tick_disable_interrupts:
mov r1, #configKERNEL_INTERRUPT_PRIORITY
msr basepri, R1
bx r14
/*-----------------------------------------------------------*/
vPortSetInterruptMask:
push { r0 }
mov R0, #configKERNEL_INTERRUPT_PRIORITY
msr BASEPRI, R0
pop { R0 }
bx r14
/*-----------------------------------------------------------*/
vPortClearInterruptMask:
PUSH { r0 }
MOV R0, #0
MSR BASEPRI, R0
POP { R0 }
bx r14
/*-----------------------------------------------------------*/
END

View file

@ -1,5 +1,5 @@
/*
FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
This file is part of the FreeRTOS.org distribution.
@ -19,13 +19,13 @@
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS.org, without being obliged to provide
the source code for any proprietary components. See the licensing section
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
@ -33,12 +33,19 @@
***************************************************************************
*/
/*
Change from V4.2.1:
+ Introduced usage of configKERNEL_INTERRUPT_PRIORITY macro to set the
interrupt priority used by the kernel.
*/
#ifndef PORTMACRO_H
#define PORTMACRO_H
/*-----------------------------------------------------------
* Port specific definitions.
* Port specific definitions.
*
* The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler.
@ -86,9 +93,11 @@ extern void vPortYieldFromISR( void );
extern void vPortEnableInterrupts( void );
extern void vPortEnterCritical( void );
extern void vPortExitCritical( void );
extern void vPortSetInterruptMask( void );
extern void vPortClearInterruptMask( void );
#define portDISABLE_INTERRUPTS() __asm ( "cpsid i" )
#define portENABLE_INTERRUPTS() __asm ( "cpsie i" )
#define portDISABLE_INTERRUPTS() vPortSetInterruptMask();
#define portENABLE_INTERRUPTS() vPortClearInterruptMask();
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
/*-----------------------------------------------------------*/
@ -100,5 +109,6 @@ extern void vPortExitCritical( void );
#define inline
#define portNOP()
#endif /* PORTMACRO_H */