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
90ac46fe
Commit
90ac46fe
authored
Jan 16, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Simplify ARM64 import thunks.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
00401d22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
33 deletions
+24
-33
import.c
tools/winebuild/import.c
+24
-33
No files found.
tools/winebuild/import.c
View file @
90ac46fe
...
...
@@ -760,14 +760,11 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"1:
\t
.long %s+%u-(1b+4)
\n
"
,
table
,
pos
);
break
;
case
CPU_ARM64
:
output
(
"
\t
adrp x9, %s
\n
"
,
arm64_page
(
table
)
);
output
(
"
\t
add x9, x9, #%s
\n
"
,
arm64_pageoff
(
table
)
);
if
(
pos
&
0xf000
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0xf000
);
if
(
pos
&
0x0f00
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0x0f00
);
if
(
pos
&
0x00f0
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0x00f0
);
if
(
pos
&
0x000f
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0x000f
);
output
(
"
\t
ldur x9, [x9, #0]
\n
"
);
output
(
"
\t
br x9
\n
"
);
output
(
"
\t
adrp x16, %s
\n
"
,
arm64_page
(
table
)
);
output
(
"
\t
add x16, x16, #%s
\n
"
,
arm64_pageoff
(
table
)
);
if
(
pos
&
~
0x7fff
)
output
(
"
\t
add x16, x16, #%u
\n
"
,
pos
&
~
0x7fff
);
output
(
"
\t
ldr x16, [x16, #%u]
\n
"
,
pos
&
0x7fff
);
output
(
"
\t
br x16
\n
"
);
break
;
case
CPU_POWERPC
:
output
(
"
\t
mr %s, %s
\n
"
,
ppc_reg
(
0
),
ppc_reg
(
31
)
);
...
...
@@ -1078,18 +1075,21 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"2:
\t
.long %s-1b
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
break
;
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-
16
]!
\n
"
);
output
(
"
\t
stp x29, x30, [sp,#-
80
]!
\n
"
);
output
(
"
\t
mov x29, sp
\n
"
);
output
(
"
\t
adrp x9, %s
\n
"
,
arm64_page
(
asm_name
(
"__wine_spec_delay_load"
)
)
);
output
(
"
\t
add x9, x9, #%s
\n
"
,
arm64_pageoff
(
asm_name
(
"__wine_spec_delay_load"
)
)
);
output
(
"
\t
blr x9
\n
"
);
output
(
"
\t
mov x9, x0
\n
"
);
output
(
"
\t
ldp x29, x30, [sp],#16
\n
"
);
output
(
"
\t
stp x0, x1, [sp,#16]
\n
"
);
output
(
"
\t
stp x2, x3, [sp,#32]
\n
"
);
output
(
"
\t
stp x4, x5, [sp,#48]
\n
"
);
output
(
"
\t
stp x6, x7, [sp,#64]
\n
"
);
output
(
"
\t
mov x0, x16
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
output
(
"
\t
mov x16, x0
\n
"
);
output
(
"
\t
ldp x0, x1, [sp,#16]
\n
"
);
output
(
"
\t
ldp x2, x3, [sp,#32]
\n
"
);
output
(
"
\t
ldp x4, x5, [sp,#48]
\n
"
);
output
(
"
\t
ldp x6, x7, [sp],#80
\n
"
);
output
(
"
\t
br x9
\n
"
);
/* or "ret x9" */
output
(
"
\t
ldp x6, x7, [sp,#64]
\n
"
);
output
(
"
\t
ldp x29, x30, [sp],#80
\n
"
);
output
(
"
\t
br x16
\n
"
);
break
;
case
CPU_POWERPC
:
if
(
target_platform
==
PLATFORM_APPLE
)
extra_stack_storage
=
56
;
...
...
@@ -1176,20 +1176,13 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
break
;
}
case
CPU_ARM64
:
output
(
"
\t
stp x6, x7, [sp,#-80]!
\n
"
);
output
(
"
\t
stp x4, x5, [sp,#48]
\n
"
);
output
(
"
\t
stp x2, x3, [sp,#32]
\n
"
);
output
(
"
\t
stp x0, x1, [sp,#16]
\n
"
);
output
(
"
\t
mov x0, #%d
\n
"
,
idx
);
output
(
"
\t
mov x1, #16384
\n
"
);
output
(
"
\t
mul x1, x0, x1
\n
"
);
output
(
"
\t
mov x0, x1
\n
"
);
output
(
"
\t
mov x1, #4
\n
"
);
output
(
"
\t
mul x1, x0, x1
\n
"
);
output
(
"
\t
mov x0, x1
\n
"
);
output
(
"
\t
add x0, x0, #%d
\n
"
,
j
);
output
(
"
\t
adr x9, %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
output
(
"
\t
br x9
\n
"
);
if
(
idx
)
{
output
(
"
\t
mov x16, #0x%x
\n
"
,
idx
<<
16
);
if
(
j
)
output
(
"
\t
movk x16, #0x%x
\n
"
,
j
);
}
else
output
(
"
\t
mov x16, #0x%x
\n
"
,
j
);
output
(
"
\t
b %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_POWERPC
:
switch
(
target_platform
)
...
...
@@ -1378,9 +1371,7 @@ void output_stubs( DLLSPEC *spec )
}
else
output
(
"
\t
mov x1, %u
\n
"
,
odp
->
ordinal
);
output
(
"
\t
adrp x2, %s
\n
"
,
arm64_page
(
asm_name
(
"__wine_spec_unimplemented_stub"
)
)
);
output
(
"
\t
add x2, x2, #%s
\n
"
,
arm64_pageoff
(
asm_name
(
"__wine_spec_unimplemented_stub"
)
)
);
output
(
"
\t
blr x2
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
break
;
default:
assert
(
0
);
...
...
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