mirror of
https://github.com/mpv-player/mpv
synced 2025-02-18 13:47:04 +00:00
Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30512 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
788b356377
commit
2762207eed
@ -1,27 +1,33 @@
|
|||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#define GLUE(a, b) a ## b
|
||||||
|
#define JOIN(a, b) GLUE(a, b)
|
||||||
|
#define MANGLE(s) JOIN(EXTERN_ASM, s)
|
||||||
|
|
||||||
.data
|
.data
|
||||||
.globl caller_return
|
.globl MANGLE(caller_return)
|
||||||
caller_return:
|
MANGLE(caller_return):
|
||||||
.long 0
|
.long 0
|
||||||
.globl report_entry
|
.globl MANGLE(report_entry)
|
||||||
report_entry:
|
MANGLE(report_entry):
|
||||||
.long null_call
|
.long MANGLE(null_call)
|
||||||
.globl report_ret
|
.globl MANGLE(report_ret)
|
||||||
report_ret:
|
MANGLE(report_ret):
|
||||||
.long null_call
|
.long MANGLE(null_call)
|
||||||
.global wrapper_target
|
.global MANGLE(wrapper_target)
|
||||||
wrapper_target:
|
MANGLE(wrapper_target):
|
||||||
.long null_call
|
.long MANGLE(null_call)
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.globl null_call
|
.globl MANGLE(null_call)
|
||||||
.type null_call, @function
|
.type MANGLE(null_call), @function
|
||||||
.balign 16,0x90
|
.balign 16,0x90
|
||||||
null_call:
|
MANGLE(null_call):
|
||||||
ret
|
ret
|
||||||
.globl wrapper
|
.globl MANGLE(wrapper)
|
||||||
.type wrapper, @function
|
.type MANGLE(wrapper), @function
|
||||||
.balign 16,0x90
|
.balign 16,0x90
|
||||||
wrapper:
|
MANGLE(wrapper):
|
||||||
pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI)
|
pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI)
|
||||||
pushf # store flags
|
pushf # store flags
|
||||||
|
|
||||||
@ -39,7 +45,7 @@ wrapper:
|
|||||||
push %eax
|
push %eax
|
||||||
push %edx
|
push %edx
|
||||||
|
|
||||||
call *report_entry # report entry
|
call *MANGLE(report_entry) # report entry
|
||||||
|
|
||||||
test %eax, %eax
|
test %eax, %eax
|
||||||
jnz .Ldone
|
jnz .Ldone
|
||||||
@ -48,14 +54,14 @@ wrapper:
|
|||||||
popf # restore flags
|
popf # restore flags
|
||||||
popa # restore registers
|
popa # restore registers
|
||||||
|
|
||||||
popl caller_return # switch return addresses
|
popl MANGLE(caller_return) # switch return addresses
|
||||||
pushl $.Lwrapper_return
|
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
|
.balign 16, 0x90
|
||||||
.Lwrapper_return:
|
.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
|
pusha # more for reference sake here
|
||||||
pushf
|
pushf
|
||||||
|
|
||||||
@ -73,7 +79,7 @@ wrapper:
|
|||||||
push %eax
|
push %eax
|
||||||
push %edx
|
push %edx
|
||||||
|
|
||||||
call *report_ret # report the return information (same args)
|
call *MANGLE(report_ret) # report the return information (same args)
|
||||||
.Ldone:
|
.Ldone:
|
||||||
|
|
||||||
leave
|
leave
|
||||||
|
Loading…
Reference in New Issue
Block a user