From 9435942487fba809a5448523a8ee31c09656aa74 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 16 Apr 2012 17:04:42 +0000 Subject: [PATCH] Removed unused function from IAR CM4F port.c. Modified the stack alignment when a task first starts in the IAR CM4F port. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1733 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/IAR/ARM_CM4F/port.c | 4 ++-- Source/portable/IAR/ARM_CM4F/portasm.s | 13 +++---------- Source/portable/IAR/ARM_CM4F/portmacro.h | 4 ++++ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Source/portable/IAR/ARM_CM4F/port.c b/Source/portable/IAR/ARM_CM4F/port.c index cade67224..49453ec14 100644 --- a/Source/portable/IAR/ARM_CM4F/port.c +++ b/Source/portable/IAR/ARM_CM4F/port.c @@ -119,7 +119,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE /* Offset added to account for the way the MCU uses the stack on entry/exit of interrupts, and to ensure alignment. */ - pxTopOfStack -= 2; + pxTopOfStack--; *pxTopOfStack = portINITIAL_XPSR; /* xPSR */ pxTopOfStack--; @@ -131,7 +131,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxTopOfStack -= 5; /* R12, R3, R2 and R1. */ *pxTopOfStack = ( portSTACK_TYPE ) pvParameters; /* R0 */ - /* A save method is being used that requiers each task to maintain its + /* A save method is being used that requires each task to maintain its own exec return value. */ pxTopOfStack--; *pxTopOfStack = portINITIAL_EXEC_RETURN; diff --git a/Source/portable/IAR/ARM_CM4F/portasm.s b/Source/portable/IAR/ARM_CM4F/portasm.s index 85f1d7ce3..759e18c52 100644 --- a/Source/portable/IAR/ARM_CM4F/portasm.s +++ b/Source/portable/IAR/ARM_CM4F/portasm.s @@ -56,11 +56,9 @@ RSEG CODE:CODE(2) thumb - EXTERN vPortYieldFromISR EXTERN pxCurrentTCB EXTERN vTaskSwitchContext - PUBLIC vSetMSP PUBLIC xPortPendSVHandler PUBLIC vPortSetInterruptMask PUBLIC vPortClearInterruptMask @@ -68,12 +66,7 @@ PUBLIC vPortStartFirstTask PUBLIC vPortEnableVFP -/*-----------------------------------------------------------*/ -vSetMSP - msr msp, r0 - bx lr - /*-----------------------------------------------------------*/ xPortPendSVHandler: @@ -137,7 +130,7 @@ vPortClearInterruptMask: /*-----------------------------------------------------------*/ -vPortSVCHandler; +vPortSVCHandler: /* Get the location of the current TCB. */ ldr r3, =pxCurrentTCB ldr r1, [r3] @@ -151,7 +144,7 @@ vPortSVCHandler; /*-----------------------------------------------------------*/ -vPortStartFirstTask +vPortStartFirstTask: /* Use the NVIC offset register to locate the stack. */ ldr r0, =0xE000ED08 ldr r0, [r0] @@ -164,7 +157,7 @@ vPortStartFirstTask /*-----------------------------------------------------------*/ -vPortEnableVFP +vPortEnableVFP: /* The FPU enable bits are in the CPACR. */ ldr.w r0, =0xE000ED88 ldr r1, [r0] diff --git a/Source/portable/IAR/ARM_CM4F/portmacro.h b/Source/portable/IAR/ARM_CM4F/portmacro.h index 7ad59b0f9..5c812107e 100644 --- a/Source/portable/IAR/ARM_CM4F/portmacro.h +++ b/Source/portable/IAR/ARM_CM4F/portmacro.h @@ -117,6 +117,10 @@ extern void vPortClearInterruptMask( void ); #define portSET_INTERRUPT_MASK_FROM_ISR() 0;vPortSetInterruptMask() #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask();(void)x +/* There are an uneven number of items on the initial stack, so +portALIGNMENT_ASSERT_pxCurrentTCB() will trigger false positive asserts. */ +#define portALIGNMENT_ASSERT_pxCurrentTCB ( void ) + /*-----------------------------------------------------------*/ /* Task function macros as described on the FreeRTOS.org WEB site. */ -- 2.39.5