From e888bb3a55e974475a87fee0371f4405ddab696e Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 6 Apr 2011 15:04:57 +0000 Subject: Integrate syscall with existing svcall logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3472 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/cortexm3/up_switchcontext.S | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'nuttx/arch/arm/src/cortexm3/up_switchcontext.S') diff --git a/nuttx/arch/arm/src/cortexm3/up_switchcontext.S b/nuttx/arch/arm/src/cortexm3/up_switchcontext.S index 2823d325a..1b91e0938 100755 --- a/nuttx/arch/arm/src/cortexm3/up_switchcontext.S +++ b/nuttx/arch/arm/src/cortexm3/up_switchcontext.S @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/cortexm3/up_switchcontext.S * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,9 @@ #include #include + #include "nvic.h" +#include "svcall.h" /************************************************************************************ * Pre-processor Definitions @@ -49,9 +51,9 @@ * Global Symbols ************************************************************************************/ - .syntax unified + .syntax unified .thumb - .file "up_switchcontext.S" + .file "up_switchcontext.S" /************************************************************************************ * Macros @@ -76,20 +78,20 @@ **************************************************************************/ .thumb_func - .globl up_switchcontext - .type up_switchcontext, function + .globl up_switchcontext + .type up_switchcontext, function up_switchcontext: /* Perform the System call with R0=1, R1=saveregs, R2=restoreregs */ - mov r2, r1 /* R2: restoreregs */ - mov r1, r0 /* R1: saveregs */ - mov r0, #2 /* R0: 2 means context switch */ - svc 0 /* Force synchronous SVCall (or Hard Fault) */ + mov r2, r1 /* R2: restoreregs */ + mov r1, r0 /* R1: saveregs */ + mov r0, #SYS_switch_context /* R0: context switch */ + svc 0 /* Force synchronous SVCall (or Hard Fault) */ /* This call should not return */ - bx lr /* Unnecessary ... will not return */ - .size up_switchcontext, .-up_switchcontext + bx lr /* Unnecessary ... will not return */ + .size up_switchcontext, .-up_switchcontext .end -- cgit v1.2.3