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
7026effe
Commit
7026effe
authored
Jun 28, 2023
by
Torge Matthies
Committed by
Alexandre Julliard
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement efficiency class reporting for Intel hybrid CPUs.
Signed-off-by:
Torge Matthies
<
tmatthies@codeweavers.com
>
parent
e0d62e85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
system.c
dlls/ntdll/unix/system.c
+49
-1
No files found.
dlls/ntdll/unix/system.c
View file @
7026effe
...
...
@@ -230,6 +230,8 @@ struct smbios_chassis_args
SYSTEM_CPU_INFORMATION
cpu_info
=
{
0
};
static
SYSTEM_PROCESSOR_FEATURES_INFORMATION
cpu_features
;
static
char
cpu_name
[
49
];
static
ULONG
*
performance_cores
;
static
unsigned
int
performance_cores_capacity
=
0
;
static
SYSTEM_LOGICAL_PROCESSOR_INFORMATION
*
logical_proc_info
;
static
unsigned
int
logical_proc_info_len
,
logical_proc_info_alloc_len
;
static
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
logical_proc_info_ex
;
...
...
@@ -642,7 +644,10 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel,
dataex
->
Processor
.
Flags
=
count_bits
(
mask
)
>
1
?
LTP_PC_SMT
:
0
;
else
dataex
->
Processor
.
Flags
=
0
;
dataex
->
Processor
.
EfficiencyClass
=
0
;
if
(
rel
==
RelationProcessorCore
&&
id
/
32
<
performance_cores_capacity
)
dataex
->
Processor
.
EfficiencyClass
=
(
performance_cores
[
id
/
32
]
>>
(
id
%
32
))
&
1
;
else
dataex
->
Processor
.
EfficiencyClass
=
0
;
dataex
->
Processor
.
GroupCount
=
1
;
dataex
->
Processor
.
GroupMask
[
0
].
Mask
=
mask
;
dataex
->
Processor
.
GroupMask
[
0
].
Group
=
0
;
...
...
@@ -845,6 +850,43 @@ static BOOL sysfs_count_list_elements(const char *filename, unsigned int *result
return
TRUE
;
}
static
void
fill_performance_core_info
(
void
)
{
FILE
*
fpcore_list
;
unsigned
int
beg
,
end
,
i
;
char
op
=
','
;
ULONG
*
p
;
fpcore_list
=
fopen
(
"/sys/devices/cpu_core/cpus"
,
"r"
);
if
(
!
fpcore_list
)
return
;
performance_cores
=
calloc
(
16
,
sizeof
(
ULONG
));
if
(
!
performance_cores
)
goto
done
;
performance_cores_capacity
=
16
;
while
(
!
feof
(
fpcore_list
)
&&
op
==
','
)
{
if
(
!
fscanf
(
fpcore_list
,
"%u %c "
,
&
beg
,
&
op
))
break
;
if
(
op
==
'-'
)
fscanf
(
fpcore_list
,
"%u %c "
,
&
end
,
&
op
);
else
end
=
beg
;
for
(
i
=
beg
;
i
<=
end
;
i
++
)
{
if
(
i
/
32
>
performance_cores_capacity
)
{
p
=
realloc
(
performance_cores
,
performance_cores_capacity
*
2
*
sizeof
(
ULONG
));
if
(
!
p
)
goto
done
;
memset
(
p
+
performance_cores_capacity
,
0
,
performance_cores_capacity
*
sizeof
(
ULONG
));
performance_cores
=
p
;
performance_cores_capacity
*=
2
;
}
performance_cores
[
i
/
32
]
|=
1
<<
(
i
%
32
);
}
}
done
:
fclose
(
fpcore_list
);
}
/* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */
static
NTSTATUS
create_logical_proc_info
(
void
)
{
...
...
@@ -871,6 +913,8 @@ static NTSTATUS create_logical_proc_info(void)
max_cpus
,
MAXIMUM_PROCESSORS
);
}
fill_performance_core_info
();
fcpu_list
=
fopen
(
"/sys/devices/system/cpu/online"
,
"r"
);
if
(
!
fcpu_list
)
return
STATUS_NOT_IMPLEMENTED
;
...
...
@@ -1034,6 +1078,10 @@ static NTSTATUS create_logical_proc_info(void)
logical_proc_info_add_group
(
num_cpus
,
all_cpus_mask
);
performance_cores_capacity
=
0
;
free
(
performance_cores
);
performance_cores
=
NULL
;
return
STATUS_SUCCESS
;
}
...
...
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