Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81766 - in trunk/libs/context: build src/asm
From: oliver.kowalke_at_[hidden]
Date: 2012-12-07 12:53:27


Author: olli
Date: 2012-12-07 12:53:27 EST (Fri, 07 Dec 2012)
New Revision: 81766
URL: http://svn.boost.org/trac/boost/changeset/81766

Log:
context: initial support for iOS on ARM; used newer vector ld/sr ops

Added:
   trunk/libs/context/src/asm/jump_arm_aapcs_macho_gas.S (contents, props changed)
   trunk/libs/context/src/asm/make_arm_aapcs_macho_gas.S (contents, props changed)
Text files modified:
   trunk/libs/context/build/Jamfile.v2 | 104 +++++++++++++++------------------------
   trunk/libs/context/src/asm/jump_arm_aapcs_elf_gas.S | 4
   2 files changed, 42 insertions(+), 66 deletions(-)

Modified: trunk/libs/context/build/Jamfile.v2
==============================================================================
--- trunk/libs/context/build/Jamfile.v2 (original)
+++ trunk/libs/context/build/Jamfile.v2 2012-12-07 12:53:27 EST (Fri, 07 Dec 2012)
@@ -98,8 +98,7 @@
 alias asm_context_sources
    : asm/make_arm_aapcs_elf_gas.S
      asm/jump_arm_aapcs_elf_gas.S
- : <abi>aapcs
- <architecture>arm
+ : <architecture>arm
      <binary-format>elf
      <toolset>gcc
    ;
@@ -107,17 +106,23 @@
 alias asm_context_sources
    : asm/make_arm_aapcs_elf_gas.S
      asm/jump_arm_aapcs_elf_gas.S
- : <abi>aapcs
- <architecture>arm
+ : <architecture>arm
      <binary-format>elf
      <toolset>qcc
    ;
 
 alias asm_context_sources
+ : asm/make_arm_aapcs_macho_gas.S
+ asm/jump_arm_aapcs_macho_gas.S
+ : <architecture>arm
+ <binary-format>mach-o
+ <toolset>darwin
+ ;
+
+alias asm_context_sources
    : [ make asm/make_arm_aapcs_elf_gas.o : asm/make_arm_aapcs_elf_gas.S : @gas ]
      [ make asm/jump_arm_aapcs_elf_gas.o : asm/jump_arm_aapcs_elf_gas.S : @gas ]
- : <abi>aapcs
- <architecture>arm
+ : <architecture>arm
      <binary-format>elf
    ;
 
@@ -125,8 +130,7 @@
 alias asm_context_sources
    : asm/make_mips32_o32_elf_gas.S
      asm/jump_mips32_o32_elf_gas.S
- : <abi>o32
- <architecture>mips1
+ : <architecture>mips1
      <binary-format>elf
      <toolset>gcc
    ;
@@ -134,8 +138,7 @@
 alias asm_context_sources
    : asm/make_mips32_o32_elf_gas.S
      asm/jump_mips32_o32_elf_gas.S
- : <abi>o32
- <architecture>mips1
+ : <architecture>mips1
      <binary-format>elf
      <toolset>qcc
    ;
@@ -143,8 +146,7 @@
 alias asm_context_sources
    : [ make asm/make_mips32_o32_elf_gas.o : asm/make_mips32_o32_elf_gas.S : @gas ]
      [ make asm/jump_mips32_o32_elf_gas.o : asm/jump_mips32_o32_elf_gas.S : @gas ]
- : <abi>o32
- <architecture>mips1
+ : <architecture>mips1
      <binary-format>elf
    ;
 
@@ -152,8 +154,7 @@
 alias asm_context_sources
    : asm/make_ppc32_sysv_elf_gas.S
      asm/jump_ppc32_sysv_elf_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>power
      <binary-format>elf
      <toolset>gcc
@@ -162,8 +163,7 @@
 alias asm_context_sources
    : asm/make_ppc32_sysv_elf_gas.S
      asm/jump_ppc32_sysv_elf_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>power
      <binary-format>elf
      <toolset>qcc
@@ -172,8 +172,7 @@
 alias asm_context_sources
    : [ make asm/make_ppc32_sysv_elf_gas.o : asm/make_ppc32_sysv_elf_gas.S : @gas ]
      [ make asm/jump_ppc32_sysv_elf_gas.o : asm/jump_ppc32_sysv_elf_gas.S : @gas ]
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>power
      <binary-format>elf
    ;
@@ -182,8 +181,7 @@
 alias asm_context_sources
    : asm/make_ppc64_sysv_elf_gas.S
      asm/jump_ppc64_sysv_elf_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>power
      <binary-format>elf
      <toolset>gcc
@@ -192,8 +190,7 @@
 alias asm_context_sources
    : asm/make_ppc64_sysv_elf_gas.S
      asm/jump_ppc64_sysv_elf_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>power
      <binary-format>elf
      <toolset>qcc
@@ -202,8 +199,7 @@
 alias asm_context_sources
    : [ make asm/make_ppc64_sysv_elf_gas.o : asm/make_ppc64_sysv_elf_gas.S : @gas ]
      [ make asm/jump_ppc64_sysv_elf_gas.o : asm/jump_ppc64_sysv_elf_gas.S : @gas ]
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>power
      <binary-format>elf
    ;
@@ -212,8 +208,7 @@
 alias asm_context_sources
    : asm/make_i386_sysv_elf_gas.S
      asm/jump_i386_sysv_elf_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>elf
      <toolset>gcc
@@ -222,8 +217,7 @@
 alias asm_context_sources
    : asm/make_i386_sysv_elf_gas.S
      asm/jump_i386_sysv_elf_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>elf
      <toolset>qcc
@@ -232,8 +226,7 @@
 alias asm_context_sources
    : asm/make_i386_sysv_elf_gas.S
      asm/jump_i386_sysv_elf_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>elf
      <toolset>intel
@@ -242,8 +235,7 @@
 alias asm_context_sources
    : [ make asm/make_i386_sysv_elf_gas.o : asm/make_i386_sysv_elf_gas.S : @gas ]
      [ make asm/jump_i386_sysv_elf_gas.o : asm/jump_i386_sysv_elf_gas.S : @gas ]
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>elf
    ;
@@ -251,8 +243,7 @@
 alias asm_context_sources
    : asm/make_i386_sysv_macho_gas.S
      asm/jump_i386_sysv_macho_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -262,8 +253,7 @@
 alias asm_context_sources
    : asm/make_i386_sysv_macho_gas.S
      asm/jumjumpysv_macho_gas.S
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -273,8 +263,7 @@
 alias asm_context_sources
    : [ make asm/make_i386_sysv_macho_gas.o : asm/make_i386_sysv_macho_gas.S : @gas ]
      [ make asm/jump_i386_sysv_macho_gas.o : asm/jump_i386_sysv_macho_gas.S : @gas ]
- : <abi>sysv
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -283,8 +272,7 @@
 alias asm_context_sources
    : asm/make_i386_ms_pe_masm.asm
      asm/jump_i386_ms_pe_masm.asm
- : <abi>ms
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>pe
      <target-os>windows
@@ -294,8 +282,7 @@
 alias asm_context_sources
    : asm/make_i386_ms_pe_masm.asm
      asm/jump_i386_ms_pe_masm.asm
- : <abi>ms
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>pe
      <target-os>windows
@@ -305,8 +292,7 @@
 alias asm_context_sources
    : [ make asm/make_i386_ms_pe_masm.o : asm/make_i386_ms_pe_masm.asm : @masm ]
      [ make asm/jump_i386_ms_pe_masm.o : asm/jump_i386_ms_pe_masm.asm : @masm ]
- : <abi>ms
- <address-model>32
+ : <address-model>32
      <architecture>x86
      <binary-format>pe
      <target-os>windows
@@ -316,8 +302,7 @@
 alias asm_context_sources
    : asm/make_x86_64_sysv_elf_gas.S
      asm/jump_x86_64_sysv_elf_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>elf
      <toolset>gcc
@@ -326,8 +311,7 @@
 alias asm_context_sources
    : asm/make_x86_64_sysv_elf_gas.S
      asm/jump_x86_64_sysv_elf_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>elf
      <toolset>qcc
@@ -336,8 +320,7 @@
 alias asm_context_sources
    : asm/make_x86_64_sysv_elf_gas.S
      asm/jump_x86_64_sysv_elf_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>elf
      <toolset>intel
@@ -346,8 +329,7 @@
 alias asm_context_sources
    : [ make asm/make_x86_64_sysv_elf_gas.o : asm/make_x86_64_sysv_elf_gas.S : @gas ]
      [ make asm/jump_x86_64_sysv_elf_gas.o : asm/jump_x86_64_sysv_elf_gas.S : @gas ]
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>elf
    ;
@@ -355,8 +337,7 @@
 alias asm_context_sources
    : asm/make_x86_64_sysv_macho_gas.S
      asm/jump_x86_64_sysv_macho_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -366,8 +347,7 @@
 alias asm_context_sources
    : asm/make_x86_64_sysv_macho_gas.S
      asm/jump_x86_64_sysv_macho_gas.S
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -377,8 +357,7 @@
 alias asm_context_sources
    : [ make asm/make_x86_64_sysv_macho_gas.o : asm/make_x86_64_sysv_macho_gas.S : @gas ]
      [ make asm/jump_x86_64_sysv_macho_gas.o : asm/jump_x86_64_sysv_macho_gas.S : @gas ]
- : <abi>sysv
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>mach-o
      <target-os>darwin
@@ -387,8 +366,7 @@
 alias asm_context_sources
    : asm/make_x86_64_ms_pe_masm.asm
      asm/jump_x86_64_ms_pe_masm.asm
- : <abi>ms
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>pe
      <target-os>windows
@@ -398,8 +376,7 @@
 alias asm_context_sources
    : asm/make_x86_64_ms_pe_masm.asm
      asm/jump_x86_64_ms_pe_masm.asm
- : <abi>ms
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>pe
      <target-os>windows
@@ -409,8 +386,7 @@
 alias asm_context_sources
    : [ make asm/make_x86_64_ms_pe_masm.o : asm/make_x86_64_ms_pe_masm.asm : @masm64 ]
      [ make asm/jump_x86_64_ms_pe_masm.o : asm/jump_x86_64_ms_pe_masm.asm : @masm64 ]
- : <abi>ms
- <address-model>64
+ : <address-model>64
      <architecture>x86
      <binary-format>pe
      <target-os>windows

Modified: trunk/libs/context/src/asm/jump_arm_aapcs_elf_gas.S
==============================================================================
--- trunk/libs/context/src/asm/jump_arm_aapcs_elf_gas.S (original)
+++ trunk/libs/context/src/asm/jump_arm_aapcs_elf_gas.S 2012-12-07 12:53:27 EST (Fri, 07 Dec 2012)
@@ -59,11 +59,11 @@
 
     mov a4, a1
     add a4, #52
- fstmiax a4, {d8-d15} @ save S16-S31
+ vstmia a4, {d8-d15} @ save S16-S31
 
     mov a4, a2
     add a4, #52
- fldmiax a4, {d8-d15} @ restore S16-S31
+ vldmia a4, {d8-d15} @ restore S16-S31
 1:
 #endif
 

Added: trunk/libs/context/src/asm/jump_arm_aapcs_macho_gas.S
==============================================================================
--- (empty file)
+++ trunk/libs/context/src/asm/jump_arm_aapcs_macho_gas.S 2012-12-07 12:53:27 EST (Fri, 07 Dec 2012)
@@ -0,0 +1,71 @@
+/*
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*******************************************************************
+ * *
+ * ------------------------------------------------------------- *
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *
+ * ------------------------------------------------------------- *
+ * | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| *
+ * ------------------------------------------------------------- *
+ * | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 10 | | *
+ * ------------------------------------------------------------- *
+ * | 0x28| | *
+ * ------------------------------------------------------------- *
+ * | pc | | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 11 | 12 | | *
+ * ------------------------------------------------------------- *
+ * | 0x2c| 0x30| | *
+ * ------------------------------------------------------------- *
+ * | sp | size| | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | *
+ * ------------------------------------------------------------- *
+ * | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | *
+ * ------------------------------------------------------------- *
+ * | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 23 | 24 | 25 | 26 | 27 | 28 | | *
+ * ------------------------------------------------------------- *
+ * | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | *
+ * ------------------------------------------------------------- *
+ * | s26 | s27 | s28 | s29 | s30 | s31 | | *
+ * ------------------------------------------------------------- *
+ * *
+ * *****************************************************************/
+
+.text
+.globl _jump_fcontext
+.align 2
+_jump_fcontext:
+ stmia a1, {v1-v8,sp-lr} @ save V1-V8,SP-LR
+ str lr, [a1,#40] @ save LR as PC
+
+#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
+ cmp a4, #0 @ test if fpu env should be preserved
+ beq 1f
+
+ mov a4, a1
+ add a4, #52
+ vstmia a4, {d8-d15} @ save S16-S31
+
+ mov a4, a2
+ add a4, #52
+ vldmia a4, {d8-d15} @ restore S16-S31
+1:
+#endif
+
+ mov a1, a3 @ use third arg as return value after jump
+ @ and as first arg in context function
+ ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC

Added: trunk/libs/context/src/asm/make_arm_aapcs_macho_gas.S
==============================================================================
--- (empty file)
+++ trunk/libs/context/src/asm/make_arm_aapcs_macho_gas.S 2012-12-07 12:53:27 EST (Fri, 07 Dec 2012)
@@ -0,0 +1,74 @@
+/*
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*******************************************************************
+ * *
+ * ------------------------------------------------------------- *
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *
+ * ------------------------------------------------------------- *
+ * | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| *
+ * ------------------------------------------------------------- *
+ * | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 10 | | *
+ * ------------------------------------------------------------- *
+ * | 0x28| | *
+ * ------------------------------------------------------------- *
+ * | pc | | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 11 | 12 | | *
+ * ------------------------------------------------------------- *
+ * | 0x2c| 0x30| | *
+ * ------------------------------------------------------------- *
+ * | sp | size| | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | *
+ * ------------------------------------------------------------- *
+ * | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | *
+ * ------------------------------------------------------------- *
+ * | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | *
+ * ------------------------------------------------------------- *
+ * ------------------------------------------------------------- *
+ * | 23 | 24 | 25 | 26 | 27 | 28 | | *
+ * ------------------------------------------------------------- *
+ * | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | *
+ * ------------------------------------------------------------- *
+ * | s26 | s27 | s28 | s29 | s30 | s31 | | *
+ * ------------------------------------------------------------- *
+ * *
+ * *****************************************************************/
+
+.text
+.globl _make_fcontext
+.align 2
+_make_fcontext:
+ mov a4, a1 @ save address of context stack (base) A4
+ sub a1, #116 @ reserve space for fcontext_t at top of context stack
+
+ @ shift address in A1 to lower 16 byte boundary
+ @ == pointer to fcontext_t and address of context stack
+ bic a1, a1, #15
+
+ str a4, [a1,#44] @ save address of context stack (base) in fcontext_t
+ str a2, [a1,#48] @ save context stack size in fcontext_t
+ str a3, [a1,#40] @ save address of context function in fcontext_t
+
+ str a1, [a1,#32] @ save address in A4 as stack pointer for context function
+
+ adr a2, finish @ compute abs address of label finish
+ str a2, [a1,#36] @ save address of finish as return address for context function
+ @ entered after context function returns
+
+ bx lr
+
+finish:
+ @ SP points to same addras SP on entry of context function
+ mov a1, #0 @ exit code is zero
+ bl __exit @ exit application


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