diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-21 00:28:48 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-21 00:28:48 +0000 |
commit | 42e211ec796561123142ad4065e80c1cbf89a0f1 (patch) | |
tree | a344d5dba880312fc6272dca432a84ef56354f2f /nuttx/arch/sim/src/up_setjmp.S | |
parent | 708ea8d6fbbabf465e43dd60128a68bea5a0b4e7 (diff) | |
download | px4-nuttx-42e211ec796561123142ad4065e80c1cbf89a0f1.tar.gz px4-nuttx-42e211ec796561123142ad4065e80c1cbf89a0f1.tar.bz2 px4-nuttx-42e211ec796561123142ad4065e80c1cbf89a0f1.zip |
Fixes for CYGWIN
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@348 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sim/src/up_setjmp.S')
-rw-r--r-- | nuttx/arch/sim/src/up_setjmp.S | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/nuttx/arch/sim/src/up_setjmp.S b/nuttx/arch/sim/src/up_setjmp.S index 96b9bfee8..f6388b315 100644 --- a/nuttx/arch/sim/src/up_setjmp.S +++ b/nuttx/arch/sim/src/up_setjmp.S @@ -46,6 +46,12 @@ /************************************************************************** * Private Definitions **************************************************************************/ + +#ifdef __CYGWIN__ +# define SYMBOL(s) _##s +#else +# define SYMBOL(s) s +#endif /************************************************************************** * Private Types @@ -72,58 +78,65 @@ **************************************************************************/ .text - .globl up_setjmp - .type up_setjmp, @function -up_setjmp: + .globl SYMBOL(up_setjmp) +#ifndef __CYGWIN__ + .type SYMBOL(up_setjmp), @function +#endif +SYMBOL(up_setjmp): /* %ebx, %esi, %edi, and %ebp must be preserved. * save %ebx, $esi, and %edi now... */ - movl 4(%esp), %eax - movl %ebx, (JB_EBX)(%eax) - movl %esi, (JB_ESI)(%eax) - movl %edi, (JB_EDI)(%eax) + movl 4(%esp), %eax + movl %ebx, (JB_EBX)(%eax) + movl %esi, (JB_ESI)(%eax) + movl %edi, (JB_EDI)(%eax) - /* Save the value of SP as will be after we return */ + /* Save the value of SP as will be after we return */ - leal 4(%esp), %ecx - movl %ecx, (JB_SP)(%eax) + leal 4(%esp), %ecx + movl %ecx, (JB_SP)(%eax) - /* Save the return PC */ + /* Save the return PC */ - movl 0(%esp), %ecx - movl %ecx, (JB_PC)(%eax) + movl 0(%esp), %ecx + movl %ecx, (JB_PC)(%eax) - /* Save the framepointer */ + /* Save the framepointer */ - movl %ebp, (JB_EBP)(%eax) + movl %ebp, (JB_EBP)(%eax) /* And return 0 */ xorl %eax, %eax - ret - .size up_setjmp, . - up_setjmp - - .globl up_longjmp - .type up_longjmp, @function -up_longjmp: - movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */ - movl 8(%esp), %eax /* Second argument is return value. */ - - /* Save the return address now. */ - - movl (JB_PC)(%ecx), %edx - - /* Restore registers. */ - - movl (JB_EBX)(%ecx), %ebx - movl (JB_ESI)(%ecx), %esi - movl (JB_EDI)(%ecx), %edi - movl (JB_EBP)(%ecx), %ebp - movl (JB_SP)(%ecx), %esp - - /* Jump to saved PC. */ - - jmp *%edx - .size up_longjmp, . - up_longjmp + ret +#ifndef __CYGWIN__ + .size SYMBOL(up_setjmp), . - SYMBOL(up_setjmp) +#endif + .globl SYMBOL(up_longjmp) +#ifndef __CYGWIN__ + .type SYMBOL(up_longjmp), @function +#endif +SYMBOL(up_longjmp): + movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */ + movl 8(%esp), %eax /* Second argument is return value. */ + + /* Save the return address now. */ + + movl (JB_PC)(%ecx), %edx + + /* Restore registers. */ + + movl (JB_EBX)(%ecx), %ebx + movl (JB_ESI)(%ecx), %esi + movl (JB_EDI)(%ecx), %edi + movl (JB_EBP)(%ecx), %ebp + movl (JB_SP)(%ecx), %esp + + /* Jump to saved PC. */ + + jmp *%edx +#ifndef __CYGWIN__ + .size SYMBOL(up_longjmp), . - SYMBOL(up_longjmp) +#endif |