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
bea2be5c
Commit
bea2be5c
authored
Jan 27, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Get rid of support for register entry points on x86_64.
parent
b41cc486
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
184 deletions
+3
-184
relay.c
tools/winebuild/relay.c
+0
-183
spec32.c
tools/winebuild/spec32.c
+3
-1
No files found.
tools/winebuild/relay.c
View file @
bea2be5c
...
@@ -992,186 +992,6 @@ void output_asm_relays16(void)
...
@@ -992,186 +992,6 @@ void output_asm_relays16(void)
/*******************************************************************
/*******************************************************************
* build_call_from_regs_x86_64
*
* Build the register saving code for a 'register' entry point.
*
* Stack layout:
* ...
* (rsp+16) first arg
* (rsp+8) ret addr to user code
* (rsp) ret addr to relay code
* (rsp-128) buffer area to allow stack frame manipulation
*
* Parameters:
* %rcx number of args
* %rdx entry point
*/
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 */
output
(
"
\t
.text
\n
"
);
function_header
(
"__wine_call_from_regs"
);
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
subq $%u,%%rsp
\n
"
,
STACK_SPACE
);
output_cfi
(
".cfi_adjust_cfa_offset %u"
,
STACK_SPACE
);
/* save registers into the context */
output
(
"
\t
movq %%rax,0x78(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rax,0x78"
);
output
(
"
\t
movq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
16
);
/* saved %rcx on stack */
output
(
"
\t
movq %%rax,0x80(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rcx,0x80"
);
output
(
"
\t
movq %u(%%rsp),%%rax
\n
"
,
STACK_SPACE
+
24
);
/* saved %rdx on stack */
output_cfi
(
".cfi_rel_offset %%rdx,0x88"
);
output
(
"
\t
movq %%rax,0x88(%%rsp)
\n
"
);
output
(
"
\t
movq %%rbx,0x90(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rbx,0x90"
);
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_cfi
(
".cfi_rel_offset %%rbp,0xa0"
);
output
(
"
\t
movq %%rsi,0xa8(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rsi,0xa8"
);
output
(
"
\t
movq %%rdi,0xb0(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rdi,0xb0"
);
output
(
"
\t
movq %%r8,0xb8(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r8,0xb8"
);
output
(
"
\t
movq %%r9,0xc0(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r9,0xc0"
);
output
(
"
\t
movq %%r10,0xc8(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r10,0xc8"
);
output
(
"
\t
movq %%r11,0xd0(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r11,0xd0"
);
output
(
"
\t
movq %%r12,0xd8(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r12,0xd8"
);
output
(
"
\t
movq %%r13,0xe0(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r13,0xe0"
);
output
(
"
\t
movq %%r14,0xe8(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r14,0xe8"
);
output
(
"
\t
movq %%r15,0xf0(%%rsp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%r15,0xf0"
);
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
"
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
output
(
"
\t
movdqa %%xmm%u,0x%x(%%rsp)
\n
"
,
i
,
0x1a0
+
16
*
i
);
output_cfi
(
".cfi_rel_offset %%xmm%u,0x%x"
,
i
,
0x1a0
+
16
*
i
);
}
output
(
"
\t
movw %%cs,0x38(%%rsp)
\n
"
);
output
(
"
\t
movw %%ds,0x3a(%%rsp)
\n
"
);
output
(
"
\t
movw %%es,0x3c(%%rsp)
\n
"
);
output
(
"
\t
movw %%fs,0x3e(%%rsp)
\n
"
);
output
(
"
\t
movw %%gs,0x40(%%rsp)
\n
"
);
output
(
"
\t
movw %%ss,0x42(%%rsp)
\n
"
);
output
(
"
\t
pushfq
\n
"
);
output
(
"
\t
popq %%rax
\n
"
);
output
(
"
\t
movl %%eax,0x44(%%rsp)
\n
"
);
output
(
"
\t
movl $0x%x,0x30(%%rsp)
\n
"
,
0x0010000f
);
/* transfer the arguments */
output
(
"
\t
movq %%r8,%u(%%rsp)
\n
"
,
STACK_SPACE
+
32
);
output
(
"
\t
movq %%r9,%u(%%rsp)
\n
"
,
STACK_SPACE
+
40
);
output
(
"
\t
movq $4,%%rax
\n
"
);
output
(
"
\t
leaq %u(%%rsp),%%rsi
\n
"
,
STACK_SPACE
+
16
);
output
(
"
\t
cmpq %%rax,%%rcx
\n
"
);
output
(
"
\t
cmovgq %%rcx,%%rax
\n
"
);
output
(
"
\t
movq %%rsp,%%rbx
\n
"
);
output_cfi
(
".cfi_def_cfa_register %%rbx"
);
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
"
);
output
(
"
\t
movq %%rsp,%%rdi
\n
"
);
output
(
"
\t
jrcxz 1f
\n
"
);
output
(
"
\t
cld
\n
"
);
output
(
"
\t
rep
\n\t
movsq
\n
"
);
output
(
"1:
\t
movq %%rbx,0(%%rdi)
\n
"
);
/* context arg */
/* call the entry point */
output
(
"
\t
movq %%rdx,%%rax
\n
"
);
output
(
"
\t
movq 0(%%rsp),%%rcx
\n
"
);
output
(
"
\t
movq 8(%%rsp),%%rdx
\n
"
);
output
(
"
\t
movq 16(%%rsp),%%r8
\n
"
);
output
(
"
\t
movq 24(%%rsp),%%r9
\n
"
);
output
(
"
\t
callq *%%rax
\n
"
);
/* restore the context structure */
output
(
"1:
\t
movq 0x80(%%rbx),%%rcx
\n
"
);
output_cfi
(
".cfi_same_value %%rcx"
);
output
(
"
\t
movq 0x88(%%rbx),%%rdx
\n
"
);
output_cfi
(
".cfi_same_value %%rdx"
);
output
(
"
\t
movq 0xa0(%%rbx),%%rbp
\n
"
);
output_cfi
(
".cfi_same_value %%rbp"
);
output
(
"
\t
movq 0xa8(%%rbx),%%rsi
\n
"
);
output_cfi
(
".cfi_same_value %%rsi"
);
output
(
"
\t
movq 0xb0(%%rbx),%%rdi
\n
"
);
output_cfi
(
".cfi_same_value %%rdi"
);
output
(
"
\t
movq 0xb8(%%rbx),%%r8
\n
"
);
output_cfi
(
".cfi_same_value %%r8"
);
output
(
"
\t
movq 0xc0(%%rbx),%%r9
\n
"
);
output_cfi
(
".cfi_same_value %%r9"
);
output
(
"
\t
movq 0xc8(%%rbx),%%r10
\n
"
);
output_cfi
(
".cfi_same_value %%r10"
);
output
(
"
\t
movq 0xd0(%%rbx),%%r11
\n
"
);
output_cfi
(
".cfi_same_value %%r11"
);
output
(
"
\t
movq 0xd8(%%rbx),%%r12
\n
"
);
output_cfi
(
".cfi_same_value %%r12"
);
output
(
"
\t
movq 0xe0(%%rbx),%%r13
\n
"
);
output_cfi
(
".cfi_same_value %%r13"
);
output
(
"
\t
movq 0xe8(%%rbx),%%r14
\n
"
);
output_cfi
(
".cfi_same_value %%r14"
);
output
(
"
\t
movq 0xf0(%%rbx),%%r15
\n
"
);
output_cfi
(
".cfi_same_value %%r15"
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
output
(
"
\t
movdqa 0x%x(%%rbx),%%xmm%u
\n
"
,
0x1a0
+
16
*
i
,
i
);
output_cfi
(
".cfi_same_value %%xmm%u"
,
i
);
}
output
(
"
\t
fxrstor 0x100(%%rbx)
\n
"
);
output
(
"
\t
ldmxcsr 0x34(%%rbx)
\n
"
);
output
(
"
\t
movq 0xf8(%%rbx),%%rax
\n
"
);
/* rip */
output
(
"
\t
movq %%rax,0(%%rsp)
\n
"
);
output
(
"
\t
movw 0x38(%%rbx),%%ax
\n
"
);
/* cs */
output
(
"
\t
movq %%rax,0x8(%%rsp)
\n
"
);
output
(
"
\t
movl 0x44(%%rbx),%%eax
\n
"
);
/* flags */
output
(
"
\t
movq %%rax,0x10(%%rsp)
\n
"
);
output
(
"
\t
movq 0x98(%%rbx),%%rax
\n
"
);
/* rsp */
output
(
"
\t
movq %%rax,0x18(%%rsp)
\n
"
);
output
(
"
\t
movw 0x42(%%rbx),%%ax
\n
"
);
/* ss */
output
(
"
\t
movq %%rax,0x20(%%rsp)
\n
"
);
output
(
"
\t
movq 0x78(%%rbx),%%rax
\n
"
);
output
(
"
\t
movq 0x90(%%rbx),%%rbx
\n
"
);
output
(
"
\t
iretq
\n
"
);
output_cfi
(
".cfi_endproc"
);
output_function_size
(
"__wine_call_from_regs"
);
function_header
(
"__wine_restore_regs"
);
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
movq %%rcx,%%rbx
\n
"
);
output
(
"
\t
jmp 1b
\n
"
);
output_cfi
(
".cfi_endproc"
);
output_function_size
(
"__wine_restore_regs"
);
}
/*******************************************************************
* output_asm_relays
* output_asm_relays
*
*
* Build all the assembly relay callbacks
* Build all the assembly relay callbacks
...
@@ -1183,9 +1003,6 @@ void output_asm_relays(void)
...
@@ -1183,9 +1003,6 @@ void output_asm_relays(void)
case
CPU_x86
:
case
CPU_x86
:
build_call_from_regs_x86
();
build_call_from_regs_x86
();
break
;
break
;
case
CPU_x86_64
:
build_call_from_regs_x86_64
();
break
;
default:
default:
break
;
break
;
}
}
...
...
tools/winebuild/spec32.c
View file @
bea2be5c
...
@@ -55,6 +55,8 @@ static inline int needs_relay( const ORDDEF *odp )
...
@@ -55,6 +55,8 @@ static inline int needs_relay( const ORDDEF *odp )
if
(
odp
->
type
!=
TYPE_STDCALL
&&
odp
->
type
!=
TYPE_CDECL
&&
odp
->
type
!=
TYPE_THISCALL
)
return
0
;
if
(
odp
->
type
!=
TYPE_STDCALL
&&
odp
->
type
!=
TYPE_CDECL
&&
odp
->
type
!=
TYPE_THISCALL
)
return
0
;
/* skip norelay and forward entry points */
/* skip norelay and forward entry points */
if
(
odp
->
flags
&
(
FLAG_NORELAY
|
FLAG_FORWARD
))
return
0
;
if
(
odp
->
flags
&
(
FLAG_NORELAY
|
FLAG_FORWARD
))
return
0
;
/* skip register entry points on x86_64 */
if
(
target_cpu
==
CPU_x86_64
&&
(
odp
->
flags
&
FLAG_REGISTER
))
return
0
;
return
1
;
return
1
;
}
}
...
@@ -206,7 +208,7 @@ static void output_relay_debug( DLLSPEC *spec )
...
@@ -206,7 +208,7 @@ static void output_relay_debug( DLLSPEC *spec )
output
(
"
\t
leaq 40(%%rsp),%%r8
\n
"
);
output
(
"
\t
leaq 40(%%rsp),%%r8
\n
"
);
output
(
"
\t
movq $%u,%%rdx
\n
"
,
(
flags
<<
24
)
|
(
args
<<
16
)
|
(
i
-
spec
->
base
)
);
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
leaq .L__wine_spec_relay_descr(%%rip),%%rcx
\n
"
);
output
(
"
\t
callq *
%u(%%rcx)
\n
"
,
(
odp
->
flags
&
FLAG_REGISTER
)
?
16
:
8
);
output
(
"
\t
callq *
8(%%rcx)
\n
"
);
output
(
"
\t
addq $40,%%rsp
\n
"
);
output
(
"
\t
addq $40,%%rsp
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset -40
\n
"
);
output
(
"
\t
.cfi_adjust_cfa_offset -40
\n
"
);
output
(
"
\t
ret
\n
"
);
output
(
"
\t
ret
\n
"
);
...
...
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