Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
873e027e
Commit
873e027e
authored
Jun 16, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add unwind annotations to all the generated functions for x86_64.
parent
ca4451fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
53 deletions
+81
-53
import.c
tools/winebuild/import.c
+26
-15
relay.c
tools/winebuild/relay.c
+45
-32
spec32.c
tools/winebuild/spec32.c
+10
-6
No files found.
tools/winebuild/import.c
View file @
873e027e
...
...
@@ -668,7 +668,9 @@ static void output_import_thunk( const char *name, const char *table, int pos )
}
break
;
case
CPU_x86_64
:
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
jmpq *%s+%d(%%rip)
\n
"
,
table
,
pos
);
output
(
"
\t
.cfi_endproc
\n
"
);
break
;
case
CPU_SPARC
:
if
(
!
UsePIC
)
...
...
@@ -970,23 +972,27 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
jmp *%%eax
\n
"
);
break
;
case
CPU_x86_64
:
output
(
"
\t
pushq %%rdx
\n
"
);
output
(
"
\t
pushq %%rcx
\n
"
);
output
(
"
\t
pushq %%r8
\n
"
);
output
(
"
\t
pushq %%r9
\n
"
);
output
(
"
\t
pushq %%r10
\n
"
);
output
(
"
\t
pushq %%r11
\n
"
);
output
(
"
\t
subq $40,%%rsp
\n
"
);
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
subq $88,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset 88
\n
"
);
output
(
"
\t
movq %%rdx,80(%%rsp)
\n
"
);
output
(
"
\t
movq %%rcx,72(%%rsp)
\n
"
);
output
(
"
\t
movq %%r8,64(%%rsp)
\n
"
);
output
(
"
\t
movq %%r9,56(%%rsp)
\n
"
);
output
(
"
\t
movq %%r10,48(%%rsp)
\n
"
);
output
(
"
\t
movq %%r11,40(%%rsp)
\n
"
);
output
(
"
\t
movq %%rax,%%rcx
\n
"
);
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
output
(
"
\t
addq $40,%%rsp
\n
"
);
output
(
"
\t
popq %%r11
\n
"
);
output
(
"
\t
popq %%r10
\n
"
);
output
(
"
\t
popq %%r9
\n
"
);
output
(
"
\t
popq %%r8
\n
"
);
output
(
"
\t
popq %%rcx
\n
"
);
output
(
"
\t
popq %%rdx
\n
"
);
output
(
"
\t
movq 40(%%rsp),%%r11
\n
"
);
output
(
"
\t
movq 48(%%rsp),%%r10
\n
"
);
output
(
"
\t
movq 56(%%rsp),%%r9
\n
"
);
output
(
"
\t
movq 64(%%rsp),%%r8
\n
"
);
output
(
"
\t
movq 72(%%rsp),%%rcx
\n
"
);
output
(
"
\t
movq 80(%%rsp),%%rdx
\n
"
);
output
(
"
\t
addq $88,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset -88
\n
"
);
output
(
"
\t
jmp *%%rax
\n
"
);
output
(
"
\t
.cfi_endproc
\n
"
);
break
;
case
CPU_SPARC
:
output
(
"
\t
save %%sp, -96, %%sp
\n
"
);
...
...
@@ -1068,8 +1074,10 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_x86_64
:
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
movq $%d,%%rax
\n
"
,
(
idx
<<
16
)
|
j
);
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
output
(
"
\t
.cfi_endproc
\n
"
);
break
;
case
CPU_SPARC
:
output
(
"
\t
set %d, %%g1
\n
"
,
(
idx
<<
16
)
|
j
);
...
...
@@ -1235,6 +1243,9 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
break
;
case
CPU_x86_64
:
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
subq $8,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset 8
\n
"
);
output
(
"
\t
leaq .L__wine_spec_file_name(%%rip),%%rdi
\n
"
);
if
(
exp_name
)
{
...
...
@@ -1243,8 +1254,8 @@ void output_stubs( DLLSPEC *spec )
}
else
output
(
"
\t
movq $%d,%%rsi
\n
"
,
odp
->
ordinal
);
output
(
"
\t
subq $8,%%rsp
\n
"
);
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"
\t
.cfi_endproc
\n
"
);
break
;
default:
assert
(
0
);
...
...
tools/winebuild/relay.c
View file @
873e027e
...
...
@@ -987,55 +987,62 @@ void BuildRelays16(void)
static
void
build_call_from_regs_x86_64
(
void
)
{
static
const
int
STACK_SPACE
=
128
+
0x4d0
;
/* size of x86_64 context */
int
i
;
/* Function header */
function_header
(
"__wine_call_from_regs"
);
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
subq $%u,%%rsp
\n
"
,
STACK_SPACE
);
output
(
"
\t
.cfi_adjust_cfa_offset %u
\n
"
,
STACK_SPACE
);
/* save registers into the context */
output
(
"
\t
movq %%rax,0x78(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rax,0x78
\n
"
);
output
(
"
\t
movq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
16
);
/* saved %rcx on stack */
output
(
"
\t
movq %%rax,0x80(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rcx,0x80
\n
"
);
output
(
"
\t
movq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
24
);
/* saved %rdx on stack */
output
(
"
\t
.cfi_rel_offset %%rdx,0x88
\n
"
);
output
(
"
\t
movq %%rax,0x88(%%rsp)
\n
"
);
output
(
"
\t
movq %%rbx,0x90(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rbx,0x90
\n
"
);
output
(
"
\t
leaq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
16
);
output
(
"
\t
movq %%rax,0x98(%%rsp)
\n
"
);
output
(
"
\t
movq %%rbp,0xa0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rbp,0xa0
\n
"
);
output
(
"
\t
movq %%rsi,0xa8(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rsi,0xa8
\n
"
);
output
(
"
\t
movq %%rdi,0xb0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%rdi,0xb0
\n
"
);
output
(
"
\t
movq %%r8,0xb8(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r8,0xb8
\n
"
);
output
(
"
\t
movq %%r9,0xc0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r9,0xc0
\n
"
);
output
(
"
\t
movq %%r10,0xc8(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r10,0xc8
\n
"
);
output
(
"
\t
movq %%r11,0xd0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r11,0xd0
\n
"
);
output
(
"
\t
movq %%r12,0xd8(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r12,0xd8
\n
"
);
output
(
"
\t
movq %%r13,0xe0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r13,0xe0
\n
"
);
output
(
"
\t
movq %%r14,0xe8(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r14,0xe8
\n
"
);
output
(
"
\t
movq %%r15,0xf0(%%rsp)
\n
"
);
output
(
"
\t
.cfi_rel_offset %%r15,0xf0
\n
"
);
output
(
"
\t
movq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
8
);
output
(
"
\t
movq %%rax,0xf8(%%rsp)
\n
"
);
output
(
"
\t
stmxcsr 0x34(%%rsp)
\n
"
);
output
(
"
\t
fxsave 0x100(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm0,0x1a0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm1,0x1b0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm2,0x1c0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm3,0x1d0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm4,0x1e0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm5,0x1f0(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm6,0x200(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm7,0x210(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm8,0x220(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm9,0x230(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm10,0x240(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm11,0x250(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm12,0x260(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm13,0x270(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm14,0x280(%%rsp)
\n
"
);
output
(
"
\t
movdqa %%xmm15,0x290(%%rsp)
\n
"
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
output
(
"
\t
movdqa %%xmm%u,0x%x(%%rsp)
\n
"
,
i
,
0x1a0
+
16
*
i
);
output
(
"
\t
.cfi_rel_offset %%xmm%u,0x%x
\n
"
,
i
,
0x1a0
+
16
*
i
);
}
output
(
"
\t
movw %%cs,0x38(%%rsp)
\n
"
);
output
(
"
\t
movw %%ds,0x3a(%%rsp)
\n
"
);
...
...
@@ -1058,6 +1065,7 @@ static void build_call_from_regs_x86_64(void)
output
(
"
\t
cmpq %%rax,%%rcx
\n
"
);
output
(
"
\t
cmovgq %%rcx,%%rax
\n
"
);
output
(
"
\t
movq %%rsp,%%rbx
\n
"
);
output
(
"
\t
.cfi_def_cfa_register %%rbx
\n
"
);
output
(
"
\t
leaq 16(,%%rax,8),%%rax
\n
"
);
/* add 8 for context arg and 8 for rounding */
output
(
"
\t
andq $~15,%%rax
\n
"
);
output
(
"
\t
subq %%rax,%%rsp
\n
"
);
...
...
@@ -1079,35 +1087,37 @@ static void build_call_from_regs_x86_64(void)
/* restore the context structure */
output
(
"1:
\t
movq 0x80(%%rbx),%%rcx
\n
"
);
output
(
"
\t
.cfi_same_value %%rcx
\n
"
);
output
(
"
\t
movq 0x88(%%rbx),%%rdx
\n
"
);
output
(
"
\t
.cfi_same_value %%rdx
\n
"
);
output
(
"
\t
movq 0xa0(%%rbx),%%rbp
\n
"
);
output
(
"
\t
.cfi_same_value %%rbp
\n
"
);
output
(
"
\t
movq 0xa8(%%rbx),%%rsi
\n
"
);
output
(
"
\t
.cfi_same_value %%rsi
\n
"
);
output
(
"
\t
movq 0xb0(%%rbx),%%rdi
\n
"
);
output
(
"
\t
.cfi_same_value %%rdi
\n
"
);
output
(
"
\t
movq 0xb8(%%rbx),%%r8
\n
"
);
output
(
"
\t
.cfi_same_value %%r8
\n
"
);
output
(
"
\t
movq 0xc0(%%rbx),%%r9
\n
"
);
output
(
"
\t
.cfi_same_value %%r9
\n
"
);
output
(
"
\t
movq 0xc8(%%rbx),%%r10
\n
"
);
output
(
"
\t
.cfi_same_value %%r10
\n
"
);
output
(
"
\t
movq 0xd0(%%rbx),%%r11
\n
"
);
output
(
"
\t
.cfi_same_value %%r11
\n
"
);
output
(
"
\t
movq 0xd8(%%rbx),%%r12
\n
"
);
output
(
"
\t
.cfi_same_value %%r12
\n
"
);
output
(
"
\t
movq 0xe0(%%rbx),%%r13
\n
"
);
output
(
"
\t
.cfi_same_value %%r13
\n
"
);
output
(
"
\t
movq 0xe8(%%rbx),%%r14
\n
"
);
output
(
"
\t
.cfi_same_value %%r14
\n
"
);
output
(
"
\t
movq 0xf0(%%rbx),%%r15
\n
"
);
output
(
"
\t
.cfi_same_value %%r15
\n
"
);
output
(
"
\t
movdqa 0x1a0(%%rbx),%%xmm0
\n
"
);
output
(
"
\t
movdqa 0x1b0(%%rbx),%%xmm1
\n
"
);
output
(
"
\t
movdqa 0x1c0(%%rbx),%%xmm2
\n
"
);
output
(
"
\t
movdqa 0x1d0(%%rbx),%%xmm3
\n
"
);
output
(
"
\t
movdqa 0x1e0(%%rbx),%%xmm4
\n
"
);
output
(
"
\t
movdqa 0x1f0(%%rbx),%%xmm5
\n
"
);
output
(
"
\t
movdqa 0x200(%%rbx),%%xmm6
\n
"
);
output
(
"
\t
movdqa 0x210(%%rbx),%%xmm7
\n
"
);
output
(
"
\t
movdqa 0x220(%%rbx),%%xmm8
\n
"
);
output
(
"
\t
movdqa 0x230(%%rbx),%%xmm9
\n
"
);
output
(
"
\t
movdqa 0x240(%%rbx),%%xmm10
\n
"
);
output
(
"
\t
movdqa 0x250(%%rbx),%%xmm11
\n
"
);
output
(
"
\t
movdqa 0x260(%%rbx),%%xmm12
\n
"
);
output
(
"
\t
movdqa 0x270(%%rbx),%%xmm13
\n
"
);
output
(
"
\t
movdqa 0x280(%%rbx),%%xmm14
\n
"
);
output
(
"
\t
movdqa 0x290(%%rbx),%%xmm15
\n
"
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
output
(
"
\t
movdqa 0x%x(%%rbx),%%xmm%u
\n
"
,
0x1a0
+
16
*
i
,
i
);
output
(
"
\t
.cfi_same_value %%xmm%u
\n
"
,
i
);
}
output
(
"
\t
fxrstor 0x100(%%rbx)
\n
"
);
output
(
"
\t
ldmxcsr 0x34(%%rbx)
\n
"
);
...
...
@@ -1124,12 +1134,15 @@ static void build_call_from_regs_x86_64(void)
output
(
"
\t
movq 0x78(%%rbx),%%rax
\n
"
);
output
(
"
\t
movq 0x90(%%rbx),%%rbx
\n
"
);
output
(
"
\t
iretq
\n
"
);
output
(
"
\t
.cfi_endproc
\n
"
);
output_function_size
(
"__wine_call_from_regs"
);
function_header
(
"__wine_restore_regs"
);
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
movq %%rcx,%%rbx
\n
"
);
output
(
"
\t
jmp 1b
\n
"
);
output
(
"
\t
.cfi_endproc
\n
"
);
output_function_size
(
"__wine_restore_regs"
);
}
...
...
tools/winebuild/spec32.c
View file @
873e027e
...
...
@@ -171,17 +171,21 @@ static void output_relay_debug( DLLSPEC *spec )
break
;
case
CPU_x86_64
:
output
(
"
\t
movq %%rcx,8(%%rsp)
\n
"
);
output
(
"
\t
movq %%rdx,16(%%rsp)
\n
"
);
output
(
"
\t
movq %%r8,24(%%rsp)
\n
"
);
output
(
"
\t
movq %%r9,32(%%rsp)
\n
"
);
output
(
"
\t
movq %%rsp,%%r8
\n
"
);
output
(
"
\t
.cfi_startproc
\n
"
);
output
(
"
\t
subq $40,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset 40
\n
"
);
output
(
"
\t
movq %%rcx,48(%%rsp)
\n
"
);
output
(
"
\t
movq %%rdx,56(%%rsp)
\n
"
);
output
(
"
\t
movq %%r8,64(%%rsp)
\n
"
);
output
(
"
\t
movq %%r9,72(%%rsp)
\n
"
);
output
(
"
\t
leaq 40(%%rsp),%%r8
\n
"
);
output
(
"
\t
movq $%u,%%rdx
\n
"
,
(
flags
<<
24
)
|
(
args
<<
16
)
|
(
i
-
spec
->
base
)
);
output
(
"
\t
leaq .L__wine_spec_relay_descr(%%rip),%%rcx
\n
"
);
output
(
"
\t
subq $40,%%rsp
\n
"
);
output
(
"
\t
callq *%u(%%rcx)
\n
"
,
(
odp
->
flags
&
FLAG_REGISTER
)
?
16
:
8
);
output
(
"
\t
addq $40,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset -40
\n
"
);
output
(
"
\t
ret
\n
"
);
output
(
"
\t
.cfi_endproc
\n
"
);
break
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment