annotate loader/wrapper.S @ 36473:45f770df48de

XvMC: Minor refoactoring of allocate_xvimage().
author iive
date Mon, 06 Jan 2014 19:55:26 +0000
parents 32725ca88fed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
1 #include "config.h"
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
2
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
3 #define GLUE(a, b) a ## b
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
4 #define JOIN(a, b) GLUE(a, b)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
5 #define MANGLE(s) JOIN(EXTERN_ASM, s)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
6
30469
6dd1ae2298f3 Remove '.section' causing the following assembler error on OS/2.
komh
parents: 29263
diff changeset
7 .data
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
8 .globl MANGLE(caller_return)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
9 MANGLE(caller_return):
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
10 .long 0
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
11 .globl MANGLE(report_entry)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
12 MANGLE(report_entry):
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
13 .long MANGLE(null_call)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
14 .globl MANGLE(report_ret)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
15 MANGLE(report_ret):
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
16 .long MANGLE(null_call)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
17 .global MANGLE(wrapper_target)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
18 MANGLE(wrapper_target):
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
19 .long MANGLE(null_call)
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
20
30469
6dd1ae2298f3 Remove '.section' causing the following assembler error on OS/2.
komh
parents: 29263
diff changeset
21 .text
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
22 .globl MANGLE(null_call)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
23 .type MANGLE(null_call), @function
8287
c3eb28f300d0 .align -> .balign
arpi
parents: 8269
diff changeset
24 .balign 16,0x90
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
25 MANGLE(null_call):
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
26 ret
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
27 .globl MANGLE(wrapper)
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
28 .type MANGLE(wrapper), @function
8287
c3eb28f300d0 .align -> .balign
arpi
parents: 8269
diff changeset
29 .balign 16,0x90
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
30 MANGLE(wrapper):
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
31 pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI)
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
32 pushf # store flags
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
33
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
34 push %ebp # set up a stack frame
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
35 movl %esp, %ebp
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
36
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
37 leal 4(%ebp), %eax # push flags addr
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
38 push %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
39 leal 8(%ebp), %eax # push registers addr
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
40 push %eax
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
41
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
42 leal 40(%ebp), %edx
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
43 movl (%ebp), %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
44 subl %edx, %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
45 push %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
46 push %edx
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
47
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
48 call *MANGLE(report_entry) # report entry
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
49
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
50 test %eax, %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
51 jnz .Ldone
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
52
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
53 leave # restore %esp, %ebp
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
54 popf # restore flags
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
55 popa # restore registers
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
56
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
57 popl MANGLE(caller_return) # switch return addresses
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
58 pushl $.Lwrapper_return
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
59
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
60 jmp *MANGLE(wrapper_target) # wrapper_target should return at .Lwrapper_return
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
61
8287
c3eb28f300d0 .align -> .balign
arpi
parents: 8269
diff changeset
62 .balign 16, 0x90
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
63 .Lwrapper_return:
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
64 pushl MANGLE(caller_return) # restore the original return address
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
65 pusha # more for reference sake here
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
66 pushf
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
67
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
68 push %ebp # set up a stack frame
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
69 movl %esp, %ebp
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
70
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
71 leal 4(%ebp), %eax # push flags addr
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
72 push %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
73 leal 8(%ebp), %eax # push registers addr
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
74 push %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
75
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
76 leal 40(%ebp), %edx # push stack top address (relative to our entry)
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
77 movl (%ebp), %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
78 subl %edx, %eax # calculate difference between entry and previous frame
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
79 push %eax
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
80 push %edx
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
81
30470
9ccf3bea4cf1 Prefix EXTERN_ASM to global variables to match them to an extern prefix of C.
komh
parents: 30469
diff changeset
82 call *MANGLE(report_ret) # report the return information (same args)
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 8287
diff changeset
83 .Ldone:
8269
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
84
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
85 leave
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
86 popf
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
87 popa
8b905703a450 - qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
diff changeset
88 ret