2 ; Copyright Oliver Kowalke 2009.
3 ; Distributed under the Boost Software License, Version 1.0.
4 ; (See accompanying file LICENSE_1_0.txt or copy at
5 ; http://www.boost.org/LICENSE_1_0.txt)
7 ; ---------------------------------------------------------------------------------
8 ; | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
9 ; ---------------------------------------------------------------------------------
10 ; | 0h | 04h | 08h | 0ch | 010h | 014h | 018h | 01ch |
11 ; ---------------------------------------------------------------------------------
12 ; | fc_strg |fc_deallo| limit | base | fc_seh | EDI | ESI | EBX |
13 ; ---------------------------------------------------------------------------------
14 ; ---------------------------------------------------------------------------------
15 ; | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 ; ---------------------------------------------------------------------------------
17 ; | 020h | 024h | 028h | 02ch | 030h | 034h | 038h | 03ch |
18 ; ---------------------------------------------------------------------------------
19 ; | EBP | EIP | to | data | | EH NXT |SEH HNDLR| |
20 ; ---------------------------------------------------------------------------------
27 jump_fcontext PROC BOOST_CONTEXT_EXPORT
34 ; load NT_TIB into ECX
38 ; load current SEH exception list
42 ; load current stack base
46 ; load current stack limit
50 ; load current deallocation stack
54 ; load fiber local storage
58 ; store ESP (pointing to context-data) in EAX
61 ; firstarg of jump_fcontext() == fcontext to jump to
64 ; restore ESP (pointing to context-data) from EAX
68 ; load NT_TIB into EDX
72 ; restore fiber local storage
76 ; restore current deallocation stack
80 ; restore current stack limit
84 ; restore current stack base
88 ; restore current SEH exception list
98 ; FCTX == EAX, DATA == EDX