Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81098 - in trunk/libs/context: build src/asm
From: oliver.kowalke_at_[hidden]
Date: 2012-10-29 12:53:36


Author: olli
Date: 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
New Revision: 81098
URL: http://svn.boost.org/trac/boost/changeset/81098

Log:
context: fixes for Mac OS X (32bit)

Text files modified:
   trunk/libs/context/build/Jamfile.v2 | 15 ++-------------
   trunk/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm | 2 +-
   trunk/libs/context/src/asm/make_i386_sysv_elf_gas.S | 2 +-
   trunk/libs/context/src/asm/make_i386_sysv_macho_gas.S | 14 +++++++-------
   trunk/libs/context/src/asm/make_x86_64_ms_pe_masm.asm | 4 ++--
   trunk/libs/context/src/asm/make_x86_64_sysv_macho_gas.S | 2 +-
   6 files changed, 14 insertions(+), 25 deletions(-)

Modified: trunk/libs/context/build/Jamfile.v2
==============================================================================
--- trunk/libs/context/build/Jamfile.v2 (original)
+++ trunk/libs/context/build/Jamfile.v2 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -256,18 +256,7 @@
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
- <toolset>gcc
- ;
-
-alias asm_context_sources
- : asm/make_i386_sysv_macho_gas.S
- asm/jump_i386_sysv_macho_gas.S
- : <abi>sysv
- <address-model>32
- <architecture>x86
- <binary-format>mach-o
- <target-os>darwin
- <toolset>qcc
+ <toolset>darwin
    ;
 
 alias asm_context_sources
@@ -371,7 +360,7 @@
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
- <toolset>gcc
+ <toolset>darwin
    ;
 
 alias asm_context_sources

Modified: trunk/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm
==============================================================================
--- trunk/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm (original)
+++ trunk/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -54,7 +54,7 @@
 ; | XMM6 | XMM7 |
 ; ----------------------------------------------------------------------------------
 ; ----------------------------------------------------------------------------------
-; | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
+; | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
 ; ----------------------------------------------------------------------------------
 ; | 0x100 | 0x104 | 0x108 | 0x10c | 0x110 | 0x114 | 0x118 | 0x11c |
 ; ----------------------------------------------------------------------------------

Modified: trunk/libs/context/src/asm/make_i386_sysv_elf_gas.S
==============================================================================
--- trunk/libs/context/src/asm/make_i386_sysv_elf_gas.S (original)
+++ trunk/libs/context/src/asm/make_i386_sysv_elf_gas.S 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -62,7 +62,7 @@
     stmxcsr 0x20(%eax) /* save MMX control and status word */
     fnstcw 0x24(%eax) /* save x87 control word */
 
- leal -0xc(%eax), %edx /* reserve space for the last frame on context stack; (ESP - 0x4) % 16 == 0 */
+ leal -0x8(%eax), %edx /* reserve space for the last frame on context stack; (ESP - 0x4) % 16 == 0 */
     movl %edx, 0x10(%eax) /* save address in EDX as stack pointer for context function */
 
     call 2f

Modified: trunk/libs/context/src/asm/make_i386_sysv_macho_gas.S
==============================================================================
--- trunk/libs/context/src/asm/make_i386_sysv_macho_gas.S (original)
+++ trunk/libs/context/src/asm/make_i386_sysv_macho_gas.S 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -35,9 +35,9 @@
 .globl _make_fcontext
 .align 2
 _make_fcontext:
- pushl %ebp /* save previous frame pointer; get the stack 16 byte aligned */
+ pushl %ebp /* save previous frame pointer */
     movl %esp, %ebp /* set EBP to ESP */
- subl $0x10, %esp /* allocate stack space */
+ subl $0x8, %esp /* allocate stack space */
 
     movl 0x8(%ebp), %eax /* load 1. arg of make_fcontext, pointer to context stack (base) */
     leal -0x28(%eax), %eax /* reserve space for fcontext_t at top of context stack */
@@ -55,17 +55,17 @@
     stmxcsr 0x20(%eax) /* save MMX control and status word */
     fnstcw 0x24(%eax) /* save x87 control word */
 
- leal -0xc(%eax), %edx /* reserve space for the last frame on context stack, (ESP - 0x4) % 16 == 0 */
+ leal -0x14(%eax), %edx /* reserve space for the last frame on context stack */
     movl %edx, 0x10(%eax) /* save address in EDX as stack pointer for context function */
 
     call 1f
 1: popl %ecx /* address of label 1 */
     addl $finish-1b, %ecx /* compute abs address of label finish */
- movl %ecx, (%edx) /* save address of finish as return address for context function */
+ movl %ecx, (%edx) /* save address of finish as return address for context function */
                                         /* entered after context function returns */
 
- addl $0x10, %esp /* deallocate stack space */
- pop %ebp
+ addl $0x8, %esp /* deallocate stack space */
+ popl %ebp
 
     ret
 
@@ -73,5 +73,5 @@
     /* ESP points to same address as ESP on entry of context function + 0x4 */
     xorl %eax, %eax
     movl %eax, (%esp) /* exit code is zero */
- call _exit /* exit application */
+ call __exit /* exit application */
     hlt

Modified: trunk/libs/context/src/asm/make_x86_64_ms_pe_masm.asm
==============================================================================
--- trunk/libs/context/src/asm/make_x86_64_ms_pe_masm.asm (original)
+++ trunk/libs/context/src/asm/make_x86_64_ms_pe_masm.asm 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -54,7 +54,7 @@
 ; | XMM6 | XMM7 |
 ; ----------------------------------------------------------------------------------
 ; ----------------------------------------------------------------------------------
-; | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
+; | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
 ; ----------------------------------------------------------------------------------
 ; | 0x100 | 0x104 | 0x108 | 0x10c | 0x110 | 0x114 | 0x118 | 0x11c |
 ; ----------------------------------------------------------------------------------
@@ -129,7 +129,7 @@
     ret
 
 finish:
- ; RSP points to same address as RSP on entry of context function + 0x8
+ ; RSP points to same address as RSP on entry of context function + 0x8
     xor rcx, rcx ; exit code is zero
     call _exit ; exit application
     hlt

Modified: trunk/libs/context/src/asm/make_x86_64_sysv_macho_gas.S
==============================================================================
--- trunk/libs/context/src/asm/make_x86_64_sysv_macho_gas.S (original)
+++ trunk/libs/context/src/asm/make_x86_64_sysv_macho_gas.S 2012-10-29 12:53:35 EDT (Mon, 29 Oct 2012)
@@ -78,5 +78,5 @@
 finish:
     /* RSP points to same address as RSP on entry of context function + 0x8 */
     xorq %rdi, %rdi /* exit code is zero */
- call _exit /* exit application */
+ call __exit /* exit application */
     hlt


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk