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
3f393a65
Commit
3f393a65
authored
Jan 16, 2013
by
André Hentschel
Committed by
Alexandre Julliard
Jan 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add ARM64 support.
parent
cf66a1f0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
3 deletions
+61
-3
build.h
tools/winebuild/build.h
+2
-2
import.c
tools/winebuild/import.c
+44
-0
main.c
tools/winebuild/main.c
+2
-0
spec32.c
tools/winebuild/spec32.c
+5
-0
utils.c
tools/winebuild/utils.c
+8
-1
No files found.
tools/winebuild/build.h
View file @
3f393a65
...
...
@@ -140,7 +140,7 @@ typedef struct
enum
target_cpu
{
CPU_x86
,
CPU_x86_64
,
CPU_SPARC
,
CPU_POWERPC
,
CPU_ARM
,
CPU_
LAST
=
CPU_ARM
CPU_x86
,
CPU_x86_64
,
CPU_SPARC
,
CPU_POWERPC
,
CPU_ARM
,
CPU_
ARM64
,
CPU_LAST
=
CPU_ARM64
};
enum
target_platform
...
...
@@ -178,7 +178,7 @@ struct strarray
#define FLAG_CPU(cpu) (0x01000 << (cpu))
#define FLAG_CPU_MASK (FLAG_CPU(CPU_LAST + 1) - FLAG_CPU(0))
#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64))
#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64)
| FLAG_CPU(CPU_ARM64)
)
#define FLAG_CPU_WIN32 (FLAG_CPU_MASK & ~FLAG_CPU_WIN64)
#define MAX_ORDINALS 65535
...
...
tools/winebuild/import.c
View file @
3f393a65
...
...
@@ -675,6 +675,17 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"
\t
ldr PC,[IP,#%d]
\n
"
,
pos
);
output
(
"
\t
.long %s
\n
"
,
table
);
break
;
case
CPU_ARM64
:
output
(
"
\t
adr x9, 1f
\n
"
);
output
(
"
\t
ldur x9, [x9, #0]
\n
"
);
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
(
"1:
\t
.quad %s
\n
"
,
table
);
break
;
case
CPU_POWERPC
:
output
(
"
\t
mr %s, %s
\n
"
,
ppc_reg
(
0
),
ppc_reg
(
31
)
);
if
(
target_platform
==
PLATFORM_APPLE
)
...
...
@@ -994,6 +1005,21 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
ldmfd SP!, {r0-r3}
\n
"
);
output
(
"
\t
mov PC,IP
\n
"
);
break
;
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-16]!
\n
"
);
output
(
"
\t
mov x29, sp
\n
"
);
output
(
"
\t
adr x9, 1f
\n
"
);
output
(
"
\t
ldur x9, [x9, #0]
\n
"
);
output
(
"
\t
blr x9
\n
"
);
output
(
"
\t
mov x9, x0
\n
"
);
output
(
"
\t
ldp x29, x30, [sp],#16
\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
(
"1:
\t
.quad %s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
break
;
case
CPU_POWERPC
:
if
(
target_platform
==
PLATFORM_APPLE
)
extra_stack_storage
=
56
;
...
...
@@ -1086,6 +1112,24 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
ldr PC,[PC,#-4]
\n
"
);
output
(
"
\t
.long %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
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, 1f
\n
"
);
output
(
"
\t
ldur x9, [x9, #0]
\n
"
);
output
(
"
\t
br x9
\n
"
);
output
(
"1:
\t
.quad %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_POWERPC
:
switch
(
target_platform
)
{
...
...
tools/winebuild/main.c
View file @
3f393a65
...
...
@@ -59,6 +59,8 @@ enum target_cpu target_cpu = CPU_SPARC;
enum
target_cpu
target_cpu
=
CPU_POWERPC
;
#elif defined(__arm__)
enum
target_cpu
target_cpu
=
CPU_ARM
;
#elif defined(__aarch64__)
enum
target_cpu
target_cpu
=
CPU_ARM64
;
#else
#error Unsupported CPU
#endif
...
...
tools/winebuild/spec32.c
View file @
3f393a65
...
...
@@ -39,6 +39,7 @@
#define IMAGE_FILE_MACHINE_ARMNT 0x01C4
/* Wine extension */
#define IMAGE_FILE_MACHINE_SPARC 0x2000
#define IMAGE_FILE_MACHINE_ARM64 0x01C5
#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224
#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240
...
...
@@ -447,6 +448,7 @@ static void output_asm_constructor( const char *constructor )
output
(
"
\n\t
.section
\"
.text
\"
,
\"
ax
\"\n
"
);
output
(
"
\t
blx %s
\n
"
,
asm_name
(
constructor
)
);
break
;
case
CPU_ARM64
:
case
CPU_POWERPC
:
output
(
"
\n\t
.section
\"
.init
\"
,
\"
ax
\"\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
constructor
)
);
...
...
@@ -494,6 +496,7 @@ void output_module( DLLSPEC *spec )
output
(
"
\n\t
.section
\"
.text
\"
,
\"
ax
\"\n
"
);
output
(
"
\t
b 1f
\n
"
);
break
;
case
CPU_ARM64
:
case
CPU_POWERPC
:
output
(
"
\n\t
.section
\"
.init
\"
,
\"
ax
\"\n
"
);
output
(
"
\t
b 1f
\n
"
);
...
...
@@ -518,6 +521,7 @@ void output_module( DLLSPEC *spec )
case
CPU_x86
:
machine
=
IMAGE_FILE_MACHINE_I386
;
break
;
case
CPU_x86_64
:
machine
=
IMAGE_FILE_MACHINE_AMD64
;
break
;
case
CPU_ARM
:
machine
=
IMAGE_FILE_MACHINE_ARMNT
;
break
;
case
CPU_ARM64
:
machine
=
IMAGE_FILE_MACHINE_ARM64
;
break
;
case
CPU_POWERPC
:
machine
=
IMAGE_FILE_MACHINE_POWERPC
;
break
;
case
CPU_SPARC
:
machine
=
IMAGE_FILE_MACHINE_SPARC
;
break
;
}
...
...
@@ -707,6 +711,7 @@ void output_fake_module( DLLSPEC *spec )
case
CPU_POWERPC
:
put_word
(
IMAGE_FILE_MACHINE_POWERPC
);
break
;
case
CPU_SPARC
:
put_word
(
IMAGE_FILE_MACHINE_SPARC
);
break
;
case
CPU_ARM
:
put_word
(
IMAGE_FILE_MACHINE_ARMNT
);
break
;
case
CPU_ARM64
:
put_word
(
IMAGE_FILE_MACHINE_ARM64
);
break
;
}
put_word
(
nb_sections
);
/* NumberOfSections */
put_dword
(
0
);
/* TimeDateStamp */
...
...
tools/winebuild/utils.c
View file @
3f393a65
...
...
@@ -58,7 +58,9 @@ static const struct
{
"x86_64"
,
CPU_x86_64
},
{
"sparc"
,
CPU_SPARC
},
{
"powerpc"
,
CPU_POWERPC
},
{
"arm"
,
CPU_ARM
}
{
"arm"
,
CPU_ARM
},
{
"arm64"
,
CPU_ARM64
},
{
"aarch64"
,
CPU_ARM64
},
};
/* atexit handler to clean tmp files */
...
...
@@ -867,6 +869,7 @@ unsigned int get_alignment(unsigned int align)
/* fall through */
case
CPU_POWERPC
:
case
CPU_ARM
:
case
CPU_ARM64
:
n
=
0
;
while
((
1u
<<
n
)
!=
align
)
n
++
;
return
n
;
...
...
@@ -885,6 +888,7 @@ unsigned int get_page_size(void)
case
CPU_x86_64
:
return
4096
;
case
CPU_POWERPC
:
return
4096
;
case
CPU_ARM
:
return
4096
;
case
CPU_ARM64
:
return
4096
;
case
CPU_SPARC
:
return
8192
;
}
/* unreached */
...
...
@@ -903,6 +907,7 @@ unsigned int get_ptr_size(void)
case
CPU_ARM
:
return
4
;
case
CPU_x86_64
:
case
CPU_ARM64
:
return
8
;
}
/* unreached */
...
...
@@ -975,6 +980,7 @@ const char *func_declaration( const char *func )
switch
(
target_cpu
)
{
case
CPU_ARM
:
case
CPU_ARM64
:
buffer
=
strmake
(
".type %s,%%function"
,
func
);
break
;
default:
...
...
@@ -1025,6 +1031,7 @@ void output_gnu_stack_note(void)
switch
(
target_cpu
)
{
case
CPU_ARM
:
case
CPU_ARM64
:
output
(
"
\t
.section .note.GNU-stack,
\"\"
,%%progbits
\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