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
b72c2dca
Commit
b72c2dca
authored
Mar 14, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix some CPU information tests on ARM64.
parent
03926218
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
47 deletions
+67
-47
info.c
dlls/ntdll/tests/info.c
+65
-47
system.c
dlls/ntdll/unix/system.c
+2
-0
No files found.
dlls/ntdll/tests/info.c
View file @
b72c2dca
...
...
@@ -303,68 +303,76 @@ static void test_query_basic(void)
static
void
test_query_cpu
(
void
)
{
DWORD
status
;
ULONG
ReturnLength
;
SYSTEM_CPU_INFORMATION
sci
,
sci2
;
NTSTATUS
status
;
ULONG
len
;
SYSTEM_CPU_INFORMATION
sci
,
sci2
,
sci3
;
memset
(
&
sci
,
0xcc
,
sizeof
(
sci
));
status
=
pNtQuerySystemInformation
(
SystemCpuInformation
,
&
sci
,
sizeof
(
sci
),
&
ReturnLength
);
status
=
pNtQuerySystemInformation
(
SystemCpuInformation
,
&
sci
,
sizeof
(
sci
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
sci
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
/* Check if we have some return values */
if
(
winetest_debug
>
1
)
trace
(
"Processor FeatureSet : %08lx
\n
"
,
sci
.
ProcessorFeatureBits
);
ok
(
sci
.
ProcessorFeatureBits
!=
0
,
"Expected some features for this processor, got %08lx
\n
"
,
sci
.
ProcessorFeatureBits
);
ok
(
sizeof
(
sci
)
==
len
,
"Inconsistent length %ld
\n
"
,
len
);
memset
(
&
sci2
,
0xcc
,
sizeof
(
sci2
));
status
=
pRtlGetNativeSystemInformation
(
SystemCpuInformation
,
&
sci2
,
sizeof
(
sci2
),
&
ReturnLength
);
status
=
pRtlGetNativeSystemInformation
(
SystemCpuInformation
,
&
sci2
,
sizeof
(
sci2
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx.
\n
"
,
status
);
ok
(
sizeof
(
sci2
)
==
ReturnLength
,
"Unexpected length %lu.
\n
"
,
ReturnLength
);
ok
(
sizeof
(
sci2
)
==
len
,
"Unexpected length %lu.
\n
"
,
len
);
if
(
is_wow64
)
{
ok
(
sci
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
,
"ProcessorArchitecture wrong %x
\n
"
,
sci
.
ProcessorArchitecture
);
todo_wine
ok
(
sci2
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
,
"ProcessorArchitecture wrong %x
\n
"
,
sci2
.
ProcessorArchitecture
);
ok
(
sci2
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
||
sci2
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_ARM64
,
"ProcessorArchitecture wrong %x
\n
"
,
sci2
.
ProcessorArchitecture
);
}
else
ok
(
sci
.
ProcessorArchitecture
==
sci2
.
ProcessorArchitecture
,
"ProcessorArchitecture differs %x / %x
\n
"
,
sci
.
ProcessorArchitecture
,
sci2
.
ProcessorArchitecture
);
ok
(
sci
.
ProcessorLevel
==
sci2
.
ProcessorLevel
,
"ProcessorLevel differs %x / %x
\n
"
,
sci
.
ProcessorLevel
,
sci2
.
ProcessorLevel
);
ok
(
sci
.
ProcessorRevision
==
sci2
.
ProcessorRevision
,
"ProcessorRevision differs %x / %x
\n
"
,
sci
.
ProcessorRevision
,
sci2
.
ProcessorRevision
);
ok
(
sci
.
MaximumProcessors
==
sci2
.
MaximumProcessors
,
"MaximumProcessors differs %x / %x
\n
"
,
sci
.
MaximumProcessors
,
sci2
.
MaximumProcessors
);
ok
(
sci
.
ProcessorFeatureBits
==
sci2
.
ProcessorFeatureBits
,
"ProcessorFeatureBits differs %lx / %lx
\n
"
,
sci
.
ProcessorFeatureBits
,
sci2
.
ProcessorFeatureBits
);
if
(
sci2
.
ProcessorArchitecture
!=
PROCESSOR_ARCHITECTURE_ARM64
)
{
/* Check if we have some return values */
if
(
winetest_debug
>
1
)
trace
(
"Processor FeatureSet : %08lx
\n
"
,
sci
.
ProcessorFeatureBits
);
ok
(
sci
.
ProcessorFeatureBits
!=
0
,
"Expected some features for this processor, got %08lx
\n
"
,
sci
.
ProcessorFeatureBits
);
memset
(
&
sci2
,
0xcc
,
sizeof
(
sci2
));
status
=
pNtQuerySystemInformation
(
SystemEmulationProcessorInformation
,
&
sci2
,
sizeof
(
sci2
),
&
ReturnLength
);
ok
(
sci
.
ProcessorLevel
==
sci2
.
ProcessorLevel
,
"ProcessorLevel differs %x / %x
\n
"
,
sci
.
ProcessorLevel
,
sci2
.
ProcessorLevel
);
ok
(
sci
.
ProcessorRevision
==
sci2
.
ProcessorRevision
,
"ProcessorRevision differs %x / %x
\n
"
,
sci
.
ProcessorRevision
,
sci2
.
ProcessorRevision
);
ok
(
sci
.
MaximumProcessors
==
sci2
.
MaximumProcessors
,
"MaximumProcessors differs %x / %x
\n
"
,
sci
.
MaximumProcessors
,
sci2
.
MaximumProcessors
);
ok
(
sci
.
ProcessorFeatureBits
==
sci2
.
ProcessorFeatureBits
,
"ProcessorFeatureBits differs %lx / %lx
\n
"
,
sci
.
ProcessorFeatureBits
,
sci2
.
ProcessorFeatureBits
);
}
memset
(
&
sci3
,
0xcc
,
sizeof
(
sci3
));
status
=
pNtQuerySystemInformation
(
SystemEmulationProcessorInformation
,
&
sci3
,
sizeof
(
sci3
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx.
\n
"
,
status
);
ok
(
sizeof
(
sci
2
)
==
ReturnLength
,
"Unexpected length %lu.
\n
"
,
ReturnLength
);
ok
(
sizeof
(
sci
3
)
==
len
,
"Unexpected length %lu.
\n
"
,
len
);
#ifdef _WIN64
ok
(
sci2
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
,
"ProcessorArchitecture wrong %x
\n
"
,
sci2
.
ProcessorArchitecture
);
if
(
sci2
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_ARM64
)
ok
(
sci3
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_ARM
,
"ProcessorArchitecture wrong %x
\n
"
,
sci3
.
ProcessorArchitecture
);
else
ok
(
sci3
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
,
"ProcessorArchitecture wrong %x
\n
"
,
sci3
.
ProcessorArchitecture
);
#else
ok
(
sci
.
ProcessorArchitecture
==
sci
2
.
ProcessorArchitecture
,
ok
(
sci
.
ProcessorArchitecture
==
sci
3
.
ProcessorArchitecture
,
"ProcessorArchitecture differs %x / %x
\n
"
,
sci
.
ProcessorArchitecture
,
sci
2
.
ProcessorArchitecture
);
sci
.
ProcessorArchitecture
,
sci
3
.
ProcessorArchitecture
);
#endif
ok
(
sci
.
ProcessorLevel
==
sci
2
.
ProcessorLevel
,
"ProcessorLevel differs %x / %x
\n
"
,
sci
.
ProcessorLevel
,
sci
2
.
ProcessorLevel
);
ok
(
sci
.
ProcessorRevision
==
sci
2
.
ProcessorRevision
,
"ProcessorRevision differs %x / %x
\n
"
,
sci
.
ProcessorRevision
,
sci
2
.
ProcessorRevision
);
ok
(
sci
.
MaximumProcessors
==
sci
2
.
MaximumProcessors
,
"MaximumProcessors differs %x / %x
\n
"
,
sci
.
MaximumProcessors
,
sci
2
.
MaximumProcessors
);
ok
(
sci
.
ProcessorFeatureBits
==
sci
2
.
ProcessorFeatureBits
,
"ProcessorFeatureBits differs %lx / %lx
\n
"
,
sci
.
ProcessorFeatureBits
,
sci
2
.
ProcessorFeatureBits
);
ok
(
sci
.
ProcessorLevel
==
sci
3
.
ProcessorLevel
,
"ProcessorLevel differs %x / %x
\n
"
,
sci
.
ProcessorLevel
,
sci
3
.
ProcessorLevel
);
ok
(
sci
.
ProcessorRevision
==
sci
3
.
ProcessorRevision
,
"ProcessorRevision differs %x / %x
\n
"
,
sci
.
ProcessorRevision
,
sci
3
.
ProcessorRevision
);
ok
(
sci
.
MaximumProcessors
==
sci
3
.
MaximumProcessors
,
"MaximumProcessors differs %x / %x
\n
"
,
sci
.
MaximumProcessors
,
sci
3
.
MaximumProcessors
);
ok
(
sci
.
ProcessorFeatureBits
==
sci
3
.
ProcessorFeatureBits
,
"ProcessorFeatureBits differs %lx / %lx
\n
"
,
sci
.
ProcessorFeatureBits
,
sci
3
.
ProcessorFeatureBits
);
}
static
void
test_query_performance
(
void
)
...
...
@@ -1133,9 +1141,9 @@ static void test_query_logicalproc(void)
GetSystemInfo
(
&
si
);
status
=
pNtQuerySystemInformation
(
SystemLogicalProcessorInformation
,
NULL
,
0
,
&
len
);
if
(
status
==
STATUS_INVALID_INFO_CLASS
)
/* wow64 win8+ */
if
(
status
==
STATUS_INVALID_INFO_CLASS
)
/* wow64 win8+
, arm64
*/
{
win_
skip
(
"SystemLogicalProcessorInformation is not supported
\n
"
);
skip
(
"SystemLogicalProcessorInformation is not supported
\n
"
);
return
;
}
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
...
...
@@ -3308,19 +3316,29 @@ static void test_thread_start_address(void)
static
void
test_query_data_alignment
(
void
)
{
ULONG
ReturnLength
;
SYSTEM_CPU_INFORMATION
sci
;
ULONG
len
;
NTSTATUS
status
;
DWORD
value
;
value
=
0xdeadbeef
;
status
=
pNtQuerySystemInformation
(
SystemRecommendedSharedDataAlignment
,
&
value
,
sizeof
(
value
),
&
ReturnLength
);
status
=
pNtQuerySystemInformation
(
SystemRecommendedSharedDataAlignment
,
&
value
,
sizeof
(
value
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
value
)
==
ReturnLength
,
"Inconsistent length %lu
\n
"
,
ReturnLength
);
#ifdef __arm__
ok
(
value
==
32
,
"Expected 32, got %lu
\n
"
,
value
);
#else
ok
(
value
==
64
,
"Expected 64, got %lu
\n
"
,
value
);
#endif
ok
(
sizeof
(
value
)
==
len
,
"Inconsistent length %lu
\n
"
,
len
);
pRtlGetNativeSystemInformation
(
SystemCpuInformation
,
&
sci
,
sizeof
(
sci
),
&
len
);
switch
(
sci
.
ProcessorArchitecture
)
{
case
PROCESSOR_ARCHITECTURE_ARM
:
ok
(
value
==
32
,
"Expected 32, got %lu
\n
"
,
value
);
break
;
case
PROCESSOR_ARCHITECTURE_ARM64
:
ok
(
value
==
128
,
"Expected 128, got %lu
\n
"
,
value
);
break
;
default:
ok
(
value
==
64
,
"Expected 64, got %lu
\n
"
,
value
);
break
;
}
}
static
void
test_thread_lookup
(
void
)
...
...
dlls/ntdll/unix/system.c
View file @
b72c2dca
...
...
@@ -2958,6 +2958,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
{
#ifdef __arm__
*
((
DWORD
*
)
info
)
=
32
;
#elif defined __aarch64__
*
((
DWORD
*
)
info
)
=
128
;
#else
*
((
DWORD
*
)
info
)
=
64
;
#endif
...
...
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