diff options
Diffstat (limited to 'libffi/src/x86/win32.S')
-rw-r--r-- | libffi/src/x86/win32.S | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/libffi/src/x86/win32.S b/libffi/src/x86/win32.S index e5c93ecf7b9..deb4a0394d8 100644 --- a/libffi/src/x86/win32.S +++ b/libffi/src/x86/win32.S @@ -264,6 +264,18 @@ ffi_closure_SYSV ENDP #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) #define CIF_FLAGS_OFFSET 20 +ffi_closure_raw_THISCALL PROC NEAR + push ebp + mov ebp, esp + push esi + sub esp, 36 + mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif + mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data + mov [esp + 12], edx + lea edx, [ebp + 12], edx + jmp stubraw +ffi_closure_raw_SYSV ENDP + ffi_closure_raw_SYSV PROC NEAR USES esi ;; the ffi_closure ctx is passed in eax by the trampoline. @@ -272,6 +284,7 @@ ffi_closure_raw_SYSV PROC NEAR USES esi mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data mov [esp + 12], edx ;; user_data lea edx, [ebp + 8] +stubraw: mov [esp + 8], edx ;; raw_args lea edx, [ebp - 24] mov [esp + 4], edx ;; &res @@ -722,7 +735,21 @@ _ffi_closure_SYSV: #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) #define CIF_FLAGS_OFFSET 20 - + .balign 16 + .globl _ffi_closure_raw_THISCALL +#ifndef __OS2__ + .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef +#endif +_ffi_closure_raw_THISCALL: + pushl %ebp + movl %esp, %ebp + pushl %esi + subl $36, %esp + movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ + movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ + movl %edx, 12(%esp) /* user_data */ + leal 12(%ebp), %edx /* __builtin_dwarf_cfa () */ + jmp .stubraw # This assumes we are using gas. .balign 16 .globl _ffi_closure_raw_SYSV @@ -742,6 +769,7 @@ _ffi_closure_raw_SYSV: movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ movl %edx, 12(%esp) /* user_data */ leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */ +.stubraw: movl %edx, 8(%esp) /* raw_args */ leal -24(%ebp), %edx movl %edx, 4(%esp) /* &res */ |