Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9e8fbdab
Commit
9e8fbdab
authored
Mar 15, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Add processor features for supported WoW64 architectures on ARM64.
parent
911cdcda
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletion
+61
-1
rtl.c
dlls/ntdll/rtl.c
+23
-1
wow64.c
dlls/ntdll/tests/wow64.c
+5
-0
wineboot.c
programs/wineboot/wineboot.c
+33
-0
No files found.
dlls/ntdll/rtl.c
View file @
9e8fbdab
...
@@ -2128,7 +2128,29 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor)
...
@@ -2128,7 +2128,29 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor)
*/
*/
BOOLEAN
WINAPI
RtlIsProcessorFeaturePresent
(
UINT
feature
)
BOOLEAN
WINAPI
RtlIsProcessorFeaturePresent
(
UINT
feature
)
{
{
#ifdef _WIN64
#ifdef __aarch64__
static
const
ULONGLONG
arm64_features
=
(
1ull
<<
PF_COMPARE_EXCHANGE_DOUBLE
)
|
(
1ull
<<
PF_NX_ENABLED
)
|
(
1ull
<<
PF_ARM_VFP_32_REGISTERS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_SECOND_LEVEL_ADDRESS_TRANSLATION
)
|
(
1ull
<<
PF_FASTFAIL_AVAILABLE
)
|
(
1ull
<<
PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE
)
|
(
1ull
<<
PF_ARM_64BIT_LOADSTORE_ATOMIC
)
|
(
1ull
<<
PF_ARM_EXTERNAL_CACHE_AVAILABLE
)
|
(
1ull
<<
PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE
)
|
(
1ull
<<
PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE
);
return
(
feature
<
PROCESSOR_FEATURE_MAX
&&
(
arm64_features
&
(
1ull
<<
feature
))
&&
user_shared_data
->
ProcessorFeatures
[
feature
]);
#elif defined _WIN64
return
feature
<
PROCESSOR_FEATURE_MAX
&&
user_shared_data
->
ProcessorFeatures
[
feature
];
return
feature
<
PROCESSOR_FEATURE_MAX
&&
user_shared_data
->
ProcessorFeatures
[
feature
];
#else
#else
return
NtWow64IsProcessorFeaturePresent
(
feature
);
return
NtWow64IsProcessorFeaturePresent
(
feature
);
...
...
dlls/ntdll/tests/wow64.c
View file @
9e8fbdab
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "ntdll_test.h"
#include "ntdll_test.h"
#include "winioctl.h"
#include "winioctl.h"
#include "ddk/wdm.h"
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
...
@@ -1003,6 +1004,10 @@ static void test_nt_wow64(void)
...
@@ -1003,6 +1004,10 @@ static void test_nt_wow64(void)
if
(
native_machine
==
IMAGE_FILE_MACHINE_ARM64
)
if
(
native_machine
==
IMAGE_FILE_MACHINE_ARM64
)
{
{
KSHARED_USER_DATA
*
user_shared_data
=
ULongToPtr
(
0x7ffe0000
);
ok
(
user_shared_data
->
ProcessorFeatures
[
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
],
"no ARM_V8
\n
"
);
ok
(
user_shared_data
->
ProcessorFeatures
[
PF_MMX_INSTRUCTIONS_AVAILABLE
],
"no MMX
\n
"
);
ok
(
!
pNtWow64IsProcessorFeaturePresent
(
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
),
"ARM_V8 present
\n
"
);
ok
(
!
pNtWow64IsProcessorFeaturePresent
(
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
),
"ARM_V8 present
\n
"
);
ok
(
pNtWow64IsProcessorFeaturePresent
(
PF_MMX_INSTRUCTIONS_AVAILABLE
),
"MMX not present
\n
"
);
ok
(
pNtWow64IsProcessorFeaturePresent
(
PF_MMX_INSTRUCTIONS_AVAILABLE
),
"MMX not present
\n
"
);
}
}
...
...
programs/wineboot/wineboot.c
View file @
9e8fbdab
...
@@ -260,6 +260,8 @@ static void create_user_shared_data(void)
...
@@ -260,6 +260,8 @@ static void create_user_shared_data(void)
UNICODE_STRING
name
=
RTL_CONSTANT_STRING
(
L"
\\
KernelObjects
\\
__wine_user_shared_data"
);
UNICODE_STRING
name
=
RTL_CONSTANT_STRING
(
L"
\\
KernelObjects
\\
__wine_user_shared_data"
);
NTSTATUS
status
;
NTSTATUS
status
;
HANDLE
handle
;
HANDLE
handle
;
ULONG
i
,
machines
[
8
];
HANDLE
process
=
0
;
InitializeObjectAttributes
(
&
attr
,
&
name
,
OBJ_OPENIF
,
NULL
,
NULL
);
InitializeObjectAttributes
(
&
attr
,
&
name
,
OBJ_OPENIF
,
NULL
,
NULL
);
if
((
status
=
NtOpenSection
(
&
handle
,
SECTION_ALL_ACCESS
,
&
attr
)))
if
((
status
=
NtOpenSection
(
&
handle
,
SECTION_ALL_ACCESS
,
&
attr
)))
...
@@ -320,15 +322,46 @@ static void create_user_shared_data(void)
...
@@ -320,15 +322,46 @@ static void create_user_shared_data(void)
features
[
PF_AVX_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_AVX
);
features
[
PF_AVX_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_AVX
);
features
[
PF_AVX2_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_AVX2
);
features
[
PF_AVX2_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_AVX2
);
break
;
break
;
case
PROCESSOR_ARCHITECTURE_ARM
:
case
PROCESSOR_ARCHITECTURE_ARM
:
features
[
PF_ARM_VFP_32_REGISTERS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_VFP_32
);
features
[
PF_ARM_VFP_32_REGISTERS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_VFP_32
);
features
[
PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_NEON
);
features
[
PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_NEON
);
features
[
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
]
=
(
sci
.
ProcessorLevel
>=
8
);
features
[
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
]
=
(
sci
.
ProcessorLevel
>=
8
);
break
;
break
;
case
PROCESSOR_ARCHITECTURE_ARM64
:
case
PROCESSOR_ARCHITECTURE_ARM64
:
features
[
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_ARM_V8_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_V8_CRC32
);
features
[
PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_V8_CRC32
);
features
[
PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_V8_CRYPTO
);
features
[
PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
]
=
!!
(
sci
.
ProcessorFeatureBits
&
CPU_FEATURE_ARM_V8_CRYPTO
);
features
[
PF_COMPARE_EXCHANGE_DOUBLE
]
=
TRUE
;
features
[
PF_NX_ENABLED
]
=
TRUE
;
features
[
PF_FASTFAIL_AVAILABLE
]
=
TRUE
;
/* add features for other architectures supported by wow64 */
if
(
!
NtQuerySystemInformationEx
(
SystemSupportedProcessorArchitectures
,
&
process
,
sizeof
(
process
),
machines
,
sizeof
(
machines
),
NULL
))
{
for
(
i
=
0
;
machines
[
i
];
i
++
)
{
switch
(
LOWORD
(
machines
[
i
]))
{
case
IMAGE_FILE_MACHINE_ARMNT
:
features
[
PF_ARM_VFP_32_REGISTERS_AVAILABLE
]
=
TRUE
;
features
[
PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
break
;
case
IMAGE_FILE_MACHINE_I386
:
features
[
PF_MMX_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_XMMI_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_RDTSC_INSTRUCTION_AVAILABLE
]
=
TRUE
;
features
[
PF_XMMI64_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_SSE3_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_RDTSCP_INSTRUCTION_AVAILABLE
]
=
TRUE
;
features
[
PF_SSSE3_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_SSE4_1_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
features
[
PF_SSE4_2_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
break
;
}
}
}
break
;
break
;
}
}
data
->
ActiveProcessorCount
=
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
data
->
ActiveProcessorCount
=
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
...
...
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