summaryrefslogtreecommitdiff
path: root/nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-05 01:56:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-05 01:56:44 +0000
commitd1e4881ac3b65fb9486ebc8bc5508ca7ad668eb9 (patch)
treedb72a29ef7fee2f032e9f8b13bef503ca2ec91e7 /nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S
parentd4d884ccde2057574f9846c8a4aad91c68874f81 (diff)
downloadpx4-nuttx-d1e4881ac3b65fb9486ebc8bc5508ca7ad668eb9.tar.gz
px4-nuttx-d1e4881ac3b65fb9486ebc8bc5508ca7ad668eb9.tar.bz2
px4-nuttx-d1e4881ac3b65fb9486ebc8bc5508ca7ad668eb9.zip
Add task init and signal scheduling logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3338 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S')
-rw-r--r--nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S35
1 files changed, 23 insertions, 12 deletions
diff --git a/nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S b/nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S
index 49f1e5ee6..07023e5a0 100644
--- a/nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S
+++ b/nuttx/arch/x86/src/qemu/qemu_fullcontextrestore.S
@@ -1,7 +1,7 @@
/**************************************************************************
* arch/x86/src/qemu/qemu_fullcontextrestore.S
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -96,24 +96,35 @@
.type SYMBOL(up_fullcontextrestore), @function
#endif
SYMBOL(up_fullcontextrestore):
- movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */
- movl 8(%esp), %eax /* Second argument is return value. */
+ movl 4(%esp), %ecx /* Register save area in %ecx. */
- /* Save the return address now. */
+ /* Disable interrupts now (the will be conditionally re-enabled below) */
- movl (REG_PC)(%ecx), %edx
+ cli
+
+ /* Save the return address. */
+
+ movl (REG_PC)(%ecx), %edx
/* Restore registers. */
- movl (REG_EBX)(%ecx), %ebx
- movl (REG_ESI)(%ecx), %esi
- movl (REG_EDI)(%ecx), %edi
- movl (REG_EBP)(%ecx), %ebp
- movl (REG_SP)(%ecx), %esp
+ movl (REG_EBX)(%ecx), %ebx
+ movl (REG_ESI)(%ecx), %esi
+ movl (REG_EDI)(%ecx), %edi
+ movl (REG_EBP)(%ecx), %ebp
+ movl (REG_SP)(%ecx), %esp
+
+ /* Conditionally restore interrupts */
+
+ testl $512, (REG_FLAGS)(%ecx)
+ je .Ldisabled
+ sti
+.Ldisabled:
- /* Jump to saved PC. */
+ /* Jump to saved PC with non-zero return value in %eax. */
- jmp *%edx
+ movl $1, %eax
+ jmp *%edx
#ifndef __CYGWIN__
.size SYMBOL(up_fullcontextrestore), . - SYMBOL(up_fullcontextrestore)
#endif