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
0d6a3050
Commit
0d6a3050
authored
Nov 28, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve 16-byte stack alignment in 16-bit relays.
parent
c367dc4f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
spec16.c
tools/winebuild/spec16.c
+14
-6
No files found.
tools/winebuild/spec16.c
View file @
0d6a3050
...
...
@@ -286,7 +286,7 @@ static int get_function_argsize( const ORDDEF *odp )
static
void
output_call16_function
(
FILE
*
outfile
,
ORDDEF
*
odp
)
{
char
name
[
256
];
int
i
,
pos
;
int
i
,
pos
,
stack_words
;
const
char
*
args
=
odp
->
u
.
func
.
arg_types
;
int
argsize
=
get_function_argsize
(
odp
);
int
needs_ldt
=
strchr
(
args
,
'p'
)
||
strchr
(
args
,
't'
);
...
...
@@ -298,19 +298,25 @@ static void output_call16_function( FILE *outfile, ORDDEF *odp )
fprintf
(
outfile
,
"%s:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
pushl %%ebp
\n
"
);
fprintf
(
outfile
,
"
\t
movl %%esp,%%ebp
\n
"
);
stack_words
=
2
;
if
(
needs_ldt
)
{
fprintf
(
outfile
,
"
\t
pushl %%esi
\n
"
);
stack_words
++
;
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
call 1f
\n
"
);
fprintf
(
outfile
,
"1:
\t
popl %%eax
\n
"
);
fprintf
(
outfile
,
"
\t
movl wine_ldt_copy_ptr-1b(%%eax),%%esi
\n
"
);
fprintf
(
outfile
,
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
fprintf
(
outfile
,
"1:
\t
movl wine_ldt_copy_ptr-1b(%%eax),%%esi
\n
"
);
}
else
fprintf
(
outfile
,
"
\t
movl $%s,%%esi
\n
"
,
asm_name
(
"wine_ldt_copy"
)
);
}
/* preserve 16-byte stack alignment */
stack_words
+=
strlen
(
args
);
if
((
odp
->
flags
&
FLAG_REGISTER
)
||
(
odp
->
type
==
TYPE_VARARGS
))
stack_words
++
;
if
(
stack_words
%
4
)
fprintf
(
outfile
,
"
\t
subl $%d,%%esp
\n
"
,
16
-
4
*
(
stack_words
%
4
)
);
if
(
args
[
0
]
||
odp
->
type
==
TYPE_VARARGS
)
fprintf
(
outfile
,
"
\t
movl 12(%%ebp),%%ecx
\n
"
);
/* args */
...
...
@@ -456,6 +462,7 @@ static void output_init_code( FILE *outfile, const DLLSPEC *spec, const char *he
fprintf
(
outfile
,
"
\t
.align 4
\n
"
);
fprintf
(
outfile
,
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
fprintf
(
outfile
,
"%s:
\n
"
,
name
);
fprintf
(
outfile
,
"subl $4,%%esp
\n
"
);
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
...
...
@@ -470,7 +477,7 @@ static void output_init_code( FILE *outfile, const DLLSPEC *spec, const char *he
fprintf
(
outfile
,
"
\t
pushl $%s
\n
"
,
header_name
);
}
fprintf
(
outfile
,
"
\t
call %s
\n
"
,
asm_name
(
"__wine_dll_register_16"
)
);
fprintf
(
outfile
,
"
\t
addl $
8
,%%esp
\n
"
);
fprintf
(
outfile
,
"
\t
addl $
12
,%%esp
\n
"
);
fprintf
(
outfile
,
"
\t
ret
\n
"
);
output_function_size
(
outfile
,
name
);
...
...
@@ -479,6 +486,7 @@ static void output_init_code( FILE *outfile, const DLLSPEC *spec, const char *he
fprintf
(
outfile
,
"
\t
.align 4
\n
"
);
fprintf
(
outfile
,
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
fprintf
(
outfile
,
"%s:
\n
"
,
name
);
fprintf
(
outfile
,
"subl $8,%%esp
\n
"
);
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
...
...
@@ -490,7 +498,7 @@ static void output_init_code( FILE *outfile, const DLLSPEC *spec, const char *he
fprintf
(
outfile
,
"
\t
pushl $%s
\n
"
,
header_name
);
}
fprintf
(
outfile
,
"
\t
call %s
\n
"
,
asm_name
(
"__wine_dll_unregister_16"
)
);
fprintf
(
outfile
,
"
\t
addl $
4
,%%esp
\n
"
);
fprintf
(
outfile
,
"
\t
addl $
12
,%%esp
\n
"
);
fprintf
(
outfile
,
"
\t
ret
\n
"
);
output_function_size
(
outfile
,
name
);
...
...
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