]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/context/src/asm/make_i386_ms_pe_gas.asm
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / context / src / asm / make_i386_ms_pe_gas.asm
index 966187bd6111a305b72871dff6beb30c380766ac..dcb77000fabb6aadd6c381a64a08e7987dc833aa 100644 (file)
 *  --------------------------------------------------------------------------------- *
 *  |    0h   |   04h   |   08h   |   0ch   |   010h  |   014h  |   018h  |   01ch  | *
 *  --------------------------------------------------------------------------------- *
-*  | fc_strg |fc_deallo|  limit  |   base  |  fc_seh |   EDI   |   ESI   |   EBX   | *
+*  | fc_mxcsr|fc_x87_cw| fc_strg |fc_deallo|  limit  |   base  |  fc_seh |   EDI   | *
 *  --------------------------------------------------------------------------------- *
 *  --------------------------------------------------------------------------------- *
 *  |    8    |    9    |   10    |    11   |    12   |    13   |    14   |    15   | *
 *  --------------------------------------------------------------------------------- *
 *  |   020h  |  024h   |  028h   |   02ch  |   030h  |   034h  |   038h  |   03ch  | *
 *  --------------------------------------------------------------------------------- *
-*  |   EBP   |   EIP   |    to   |   data  |         |  EH NXT |SEH HNDLR|         | *
+*  |   ESI   |   EBX   |   EBP   |   EIP   |    to   |   data  |  EH NXT |SEH HNDLR| *
 *  --------------------------------------------------------------------------------- *
-*************************************************************************************/
+**************************************************************************************/
 
 .file  "make_i386_ms_pe_gas.asm"
 .text
@@ -34,7 +34,7 @@ _make_fcontext:
 
     /* reserve space for first argument of context-function */
     /* EAX might already point to a 16byte border */
-    leal  -0x08(%eax), %eax
+    leal  -0x8(%eax), %eax
 
     /* shift address in EAX to lower 16 byte boundary */
     andl  $-16, %eax
@@ -43,42 +43,47 @@ _make_fcontext:
     /* size for fc_mxcsr .. EIP + return-address for context-function */
     /* on context-function entry: (ESP -0x4) % 8 == 0 */
     /* additional space is required for SEH */
-    leal  -0x48(%eax), %eax
+    leal  -0x40(%eax), %eax
+
+    /* save MMX control- and status-word */
+    stmxcsr  (%eax)
+    /* save x87 control-word */
+    fnstcw  0x4(%eax)
 
     /* first arg of make_fcontext() == top of context-stack */
-    movl  0x04(%esp), %ecx
+    movl  0x4(%esp), %ecx
     /* save top address of context stack as 'base' */
-    movl  %ecx, 0xc(%eax)
+    movl  %ecx, 0x14(%eax)
     /* second arg of make_fcontext() == size of context-stack */
-    movl  0x08(%esp), %edx
+    movl  0x8(%esp), %edx
     /* negate stack size for LEA instruction (== substraction) */
     negl  %edx
     /* compute bottom address of context stack (limit) */
     leal  (%ecx,%edx), %ecx
     /* save bottom address of context-stack as 'limit' */
-    movl  %ecx, 0x8(%eax)
+    movl  %ecx, 0x10(%eax)
     /* save bottom address of context-stack as 'dealloction stack' */
-    movl  %ecx, 0x4(%eax)
+    movl  %ecx, 0xc(%eax)
        /* set fiber-storage to zero */
        xorl  %ecx, %ecx
-    movl  %ecx, (%eax)
+    movl  %ecx, 0x8(%eax)
 
     /* third arg of make_fcontext() == address of context-function */
     /* stored in EBX */
     movl  0xc(%esp), %ecx
-    movl  %ecx, 0x1c(%eax)
+    movl  %ecx, 0x24(%eax)
 
     /* compute abs address of label trampoline */
     movl  $trampoline, %ecx
     /* save address of trampoline as return-address for context-function */
     /* will be entered after calling jump_fcontext() first time */
-    movl  %ecx, 0x24(%eax)
+    movl  %ecx, 0x2c(%eax)
 
     /* compute abs address of label finish */
     movl  $finish, %ecx
     /* save address of finish as return-address for context-function */
     /* will be entered after context-function returns */
-    movl  %ecx, 0x20(%eax)
+    movl  %ecx, 0x28(%eax)
 
     /* traverse current seh chain to get the last exception handler installed by Windows */
     /* note that on Windows Server 2008 and 2008 R2, SEHOP is activated by default */
@@ -104,15 +109,15 @@ found:
     /* load 'handler' member of SEH == address of last SEH handler installed by Windows */
     movl  0x04(%ecx), %ecx
     /* save address in ECX as SEH handler for context */
-    movl  %ecx, 0x38(%eax)
+    movl  %ecx, 0x3c(%eax)
     /* set ECX to -1 */
     movl  $0xffffffff, %ecx
     /* save ECX as next SEH item */
-    movl  %ecx, 0x34(%eax)
+    movl  %ecx, 0x38(%eax)
     /* load address of next SEH item */
-    leal  0x34(%eax), %ecx
+    leal  0x38(%eax), %ecx
     /* save next SEH */
-    movl  %ecx, 0x10(%eax)
+    movl  %ecx, 0x18(%eax)
 
     /* return pointer to context-data */
     ret