From 181047eed9e51ded128772bec2f4c9ff2765be52 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Thu, 23 Oct 2008 15:58:17 +0000 Subject: [PATCH] Setup to work with both ARM and THUMB modes. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@516 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/RVDS/ARM7_LPC21xx/portASM.s | 18 +++++++++++++++--- Source/portable/RVDS/ARM7_LPC21xx/portmacro.h | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Source/portable/RVDS/ARM7_LPC21xx/portASM.s b/Source/portable/RVDS/ARM7_LPC21xx/portASM.s index 57740324a..9960fbfee 100644 --- a/Source/portable/RVDS/ARM7_LPC21xx/portASM.s +++ b/Source/portable/RVDS/ARM7_LPC21xx/portASM.s @@ -55,17 +55,15 @@ EXPORT vPortYieldProcessor EXPORT vPortStartFirstTask EXPORT vPreemptiveTick - + EXPORT vPortYield VICVECTADDR EQU 0xFFFFF030 T0IR EQU 0xE0004000 T0MATCHBIT EQU 0x00000001 - ARM AREA PORT_ASM, CODE, READONLY - PRESERVE8 @@ -74,8 +72,17 @@ T0MATCHBIT EQU 0x00000001 ; setup by pxPortInitialiseStack ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; vPortStartFirstTask + + PRESERVE8 + portRESTORE_CONTEXT +vPortYield + + PRESERVE8 + + SVC 0 + bx lr ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Interrupt service routine for the SWI interrupt. The vector table is @@ -87,6 +94,8 @@ vPortStartFirstTask vPortYieldProcessor + PRESERVE8 + ; Within an IRQ ISR the link register has an offset from the true return ; address, but an SWI ISR does not. Add the offset manually so the same ; ISR return code can be used in both cases. @@ -109,6 +118,9 @@ vPortYieldProcessor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; vPreemptiveTick + + PRESERVE8 + portSAVE_CONTEXT ; Save the context of the current task. LDR R0, =vTaskIncrementTick ; Increment the tick count. diff --git a/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h b/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h index daa330655..a659b5d21 100644 --- a/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h +++ b/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h @@ -110,7 +110,8 @@ extern void vTaskSwitchContext(void); \ } \ } \ -#define portYIELD() __asm{ SVC 0 } +extern void vPortYield( void ); +#define portYIELD() vPortYield() /* Critical section management. */ -- 2.39.2