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
71d9f327
Commit
71d9f327
authored
May 26, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allocate the ARM64EC code map when the first ARM64X binary is loaded.
parent
30040cc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
22 deletions
+19
-22
env.c
dlls/ntdll/unix/env.c
+0
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+0
-1
virtual.c
dlls/ntdll/unix/virtual.c
+19
-20
No files found.
dlls/ntdll/unix/env.c
View file @
71d9f327
...
...
@@ -1869,7 +1869,6 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
break
;
case
IMAGE_FILE_MACHINE_AMD64
:
if
(
main_image_info
.
Machine
==
current_machine
)
break
;
peb
->
EcCodeBitMap
=
virtual_alloc_arm64ec_map
();
ERR
(
"starting %s in experimental ARM64EC mode
\n
"
,
debugstr_us
(
&
params
->
ImagePathName
)
);
break
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
71d9f327
...
...
@@ -233,7 +233,6 @@ extern void virtual_free_teb( TEB *teb ) DECLSPEC_HIDDEN;
extern
NTSTATUS
virtual_clear_tls_index
(
ULONG
index
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
ULONG_PTR
limit
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
,
BOOL
guard_page
)
DECLSPEC_HIDDEN
;
extern
void
*
virtual_alloc_arm64ec_map
(
void
)
DECLSPEC_HIDDEN
;
extern
void
virtual_map_user_shared_data
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
void
*
addr
,
DWORD
err
,
void
*
stack
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
virtual_locked_server_call
(
void
*
req_ptr
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
71d9f327
...
...
@@ -2384,6 +2384,23 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable )
#ifdef __aarch64__
/***********************************************************************
* alloc_arm64ec_map
*/
static
void
alloc_arm64ec_map
(
void
)
{
SIZE_T
size
=
((
ULONG_PTR
)
user_space_limit
+
page_size
)
>>
(
page_shift
+
3
);
/* one bit per page */
unsigned
int
status
=
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
arm64ec_map
,
0
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
);
if
(
status
)
{
ERR
(
"failed to allocate ARM64EC map: %08x
\n
"
,
status
);
exit
(
1
);
}
peb
->
EcCodeBitMap
=
arm64ec_map
;
}
/***********************************************************************
* apply_arm64x_relocations
*/
static
void
apply_arm64x_relocations
(
char
*
base
,
const
IMAGE_BASE_RELOCATION
*
reloc
,
size_t
size
)
...
...
@@ -2449,8 +2466,9 @@ static void update_arm64x_mapping( char *base, IMAGE_NT_HEADERS *nt, IMAGE_SECTI
if
(
size
<=
offsetof
(
IMAGE_LOAD_CONFIG_DIRECTORY
,
CHPEMetadataPointer
))
return
;
if
(
!
cfg
->
CHPEMetadataPointer
)
return
;
if
(
!
arm64ec_map
)
alloc_arm64ec_map
();
metadata
=
(
void
*
)(
base
+
(
cfg
->
CHPEMetadataPointer
-
nt
->
OptionalHeader
.
ImageBase
));
if
(
metadata
->
CodeMap
&&
arm64ec_map
)
if
(
metadata
->
CodeMap
)
{
const
IMAGE_CHPE_RANGE_ENTRY
*
map
=
(
void
*
)(
base
+
metadata
->
CodeMap
);
...
...
@@ -3524,25 +3542,6 @@ done:
/***********************************************************************
* virtual_alloc_arm64ec_map
*/
void
*
virtual_alloc_arm64ec_map
(
void
)
{
#ifdef __aarch64__
SIZE_T
size
=
((
ULONG_PTR
)
user_space_limit
+
page_size
)
>>
(
page_shift
+
3
);
/* one bit per page */
unsigned
int
status
=
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
arm64ec_map
,
0
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
);
if
(
status
)
{
ERR
(
"failed to allocate ARM64EC map: %08x
\n
"
,
status
);
exit
(
1
);
}
#endif
return
arm64ec_map
;
}
/***********************************************************************
* virtual_map_user_shared_data
*/
void
virtual_map_user_shared_data
(
void
)
...
...
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