xref: /reactos/sdk/lib/crt/wine/rosglue_i386.s (revision 0c2cdcae)
1
2#include <asm.inc>
3
4.code
5
6EXTERN _RtlUnwind@16:PROC
7
8// ASM wrapper for Wine code. This is needed, because Wine code expects
9// RtlUnwind to restore the non-volatile registers, before returning, but
10// ours / the native one does not do that.
11//
12// void
13// WINAPI
14// __wine__RtlUnwind(
15//     PVOID TargetFrame,
16//     PVOID TargetIp ,
17//     PEXCEPTION_RECORD ExceptionRecord ,
18//     PVOID ReturnValue);
19//
20PUBLIC ___wine__RtlUnwind@16
21___wine__RtlUnwind@16:
22
23    push ebp
24    mov ebp, esp
25
26    /* Save non-volatile registers */
27    push ebx
28    push esi
29    push edi
30
31    /* Call the native function */
32    push dword ptr [ebp + 20] // ReturnValue
33    push dword ptr [ebp + 16] // ExceptionRecord
34    push dword ptr [ebp + 12] // TargetIp
35    push dword ptr [ebp + 8]  // TargetFrame
36    call _RtlUnwind@16
37
38    /* Restore non-volatile registers */
39    pop edi
40    pop esi
41    pop ebx
42
43    mov esp, ebp
44    pop ebp
45    ret 16
46
47END
48