summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/cortexm3/up_switchcontext.S
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 15:04:57 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 15:04:57 +0000
commite888bb3a55e974475a87fee0371f4405ddab696e (patch)
tree2c614deb71dfee72cfb36f54e47cc7c9475ef9c7 /nuttx/arch/arm/src/cortexm3/up_switchcontext.S
parent767a6400de3f6e709a6a453ea3c90422a316a598 (diff)
downloadpx4-nuttx-e888bb3a55e974475a87fee0371f4405ddab696e.tar.gz
px4-nuttx-e888bb3a55e974475a87fee0371f4405ddab696e.tar.bz2
px4-nuttx-e888bb3a55e974475a87fee0371f4405ddab696e.zip
Integrate syscall with existing svcall logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3472 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_switchcontext.S')
-rwxr-xr-xnuttx/arch/arm/src/cortexm3/up_switchcontext.S24
1 files changed, 13 insertions, 11 deletions
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 <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,9 @@
#include <nuttx/config.h>
#include <arch/irq.h>
+
#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