$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r81323 - in branches/release/libs/context: . build src src/asm
From: oliver.kowalke_at_[hidden]
Date: 2012-11-13 09:24:32
Author: olli
Date: 2012-11-13 09:24:31 EST (Tue, 13 Nov 2012)
New Revision: 81323
URL: http://svn.boost.org/trac/boost/changeset/81323
Log:
context: support for Mac OS X 32 bit
Properties modified: 
   branches/release/libs/context/   (props changed)
Text files modified: 
   branches/release/libs/context/build/Jamfile.v2                        |    15 ++-------------                         
   branches/release/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm      |     2 +-                                      
   branches/release/libs/context/src/asm/make_i386_sysv_elf_gas.S        |     2 +-                                      
   branches/release/libs/context/src/asm/make_i386_sysv_macho_gas.S      |    14 +++++++-------                          
   branches/release/libs/context/src/asm/make_x86_64_ms_pe_masm.asm      |     4 ++--                                    
   branches/release/libs/context/src/asm/make_x86_64_sysv_macho_gas.S    |     2 +-                                      
   branches/release/libs/context/src/guarded_stack_allocator_posix.cpp   |     1 +                                       
   branches/release/libs/context/src/guarded_stack_allocator_windows.cpp |     3 ++-                                     
   8 files changed, 17 insertions(+), 26 deletions(-)
Modified: branches/release/libs/context/build/Jamfile.v2
==============================================================================
--- branches/release/libs/context/build/Jamfile.v2	(original)
+++ branches/release/libs/context/build/Jamfile.v2	2012-11-13 09:24:31 EST (Tue, 13 Nov 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: branches/release/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm
==============================================================================
--- branches/release/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm	(original)
+++ branches/release/libs/context/src/asm/jump_x86_64_ms_pe_masm.asm	2012-11-13 09:24:31 EST (Tue, 13 Nov 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: branches/release/libs/context/src/asm/make_i386_sysv_elf_gas.S
==============================================================================
--- branches/release/libs/context/src/asm/make_i386_sysv_elf_gas.S	(original)
+++ branches/release/libs/context/src/asm/make_i386_sysv_elf_gas.S	2012-11-13 09:24:31 EST (Tue, 13 Nov 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: branches/release/libs/context/src/asm/make_i386_sysv_macho_gas.S
==============================================================================
--- branches/release/libs/context/src/asm/make_i386_sysv_macho_gas.S	(original)
+++ branches/release/libs/context/src/asm/make_i386_sysv_macho_gas.S	2012-11-13 09:24:31 EST (Tue, 13 Nov 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: branches/release/libs/context/src/asm/make_x86_64_ms_pe_masm.asm
==============================================================================
--- branches/release/libs/context/src/asm/make_x86_64_ms_pe_masm.asm	(original)
+++ branches/release/libs/context/src/asm/make_x86_64_ms_pe_masm.asm	2012-11-13 09:24:31 EST (Tue, 13 Nov 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: branches/release/libs/context/src/asm/make_x86_64_sysv_macho_gas.S
==============================================================================
--- branches/release/libs/context/src/asm/make_x86_64_sysv_macho_gas.S	(original)
+++ branches/release/libs/context/src/asm/make_x86_64_sysv_macho_gas.S	2012-11-13 09:24:31 EST (Tue, 13 Nov 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
Modified: branches/release/libs/context/src/guarded_stack_allocator_posix.cpp
==============================================================================
--- branches/release/libs/context/src/guarded_stack_allocator_posix.cpp	(original)
+++ branches/release/libs/context/src/guarded_stack_allocator_posix.cpp	2012-11-13 09:24:31 EST (Tue, 13 Nov 2012)
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include <cmath>
 #include <cstring>
+#include <new>
 #include <stdexcept>
 
 #include <boost/assert.hpp>
Modified: branches/release/libs/context/src/guarded_stack_allocator_windows.cpp
==============================================================================
--- branches/release/libs/context/src/guarded_stack_allocator_windows.cpp	(original)
+++ branches/release/libs/context/src/guarded_stack_allocator_windows.cpp	2012-11-13 09:24:31 EST (Tue, 13 Nov 2012)
@@ -17,6 +17,7 @@
 #include <cmath>
 #include <csignal>
 #include <cstring>
+#include <new>
 #include <stdexcept>
 
 #include <boost/assert.hpp>
@@ -100,7 +101,7 @@
     std::size_t size = 64 * 1024; // 64 kB
     if ( is_stack_unbound() )
         return std::max( size, minimum_stacksize() );
-    
+
     BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
     return maximum_stacksize() == minimum_stacksize()
         ? minimum_stacksize()