diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 19:58:02 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 19:58:02 +0200 |
commit | 173beb5608d893c0d9b42c1043f1dfa2db2e4df2 (patch) | |
tree | 9d91be39eb1a2edb2eec45d537630f518e04378a /loader | |
parent | ed0237e7d3c491282fbdc29c5ac294425055de57 (diff) | |
parent | c5b0ff1cfacfa502eb0647f329756ddf7c79fcb6 (diff) | |
download | mpv-173beb5608d893c0d9b42c1043f1dfa2db2e4df2.tar.bz2 mpv-173beb5608d893c0d9b42c1043f1dfa2db2e4df2.tar.xz |
Merge svn changes up to r30514
Diffstat (limited to 'loader')
-rw-r--r-- | loader/wrapper.S | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/loader/wrapper.S b/loader/wrapper.S index f21001f392..fbf3ce2392 100644 --- a/loader/wrapper.S +++ b/loader/wrapper.S @@ -1,27 +1,33 @@ -.section .data -.globl caller_return -caller_return: +#include "config.h" + +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) +#define MANGLE(s) JOIN(EXTERN_ASM, s) + +.data +.globl MANGLE(caller_return) +MANGLE(caller_return): .long 0 -.globl report_entry -report_entry: - .long null_call -.globl report_ret -report_ret: - .long null_call -.global wrapper_target -wrapper_target: - .long null_call - -.section .text -.globl null_call - .type null_call, @function +.globl MANGLE(report_entry) +MANGLE(report_entry): + .long MANGLE(null_call) +.globl MANGLE(report_ret) +MANGLE(report_ret): + .long MANGLE(null_call) +.global MANGLE(wrapper_target) +MANGLE(wrapper_target): + .long MANGLE(null_call) + +.text +.globl MANGLE(null_call) + .type MANGLE(null_call), @function .balign 16,0x90 -null_call: +MANGLE(null_call): ret -.globl wrapper - .type wrapper, @function +.globl MANGLE(wrapper) + .type MANGLE(wrapper), @function .balign 16,0x90 -wrapper: +MANGLE(wrapper): pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) pushf # store flags @@ -39,7 +45,7 @@ wrapper: push %eax push %edx - call *report_entry # report entry + call *MANGLE(report_entry) # report entry test %eax, %eax jnz .Ldone @@ -48,14 +54,14 @@ wrapper: popf # restore flags popa # restore registers - popl caller_return # switch return addresses + popl MANGLE(caller_return) # switch return addresses pushl $.Lwrapper_return - jmp *wrapper_target # wrapper_target should return at .Lwrapper_return + jmp *MANGLE(wrapper_target) # wrapper_target should return at .Lwrapper_return .balign 16, 0x90 .Lwrapper_return: - pushl caller_return # restore the original return address + pushl MANGLE(caller_return) # restore the original return address pusha # more for reference sake here pushf @@ -73,7 +79,7 @@ wrapper: push %eax push %edx - call *report_ret # report the return information (same args) + call *MANGLE(report_ret) # report the return information (same args) .Ldone: leave |