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
6c2b7332
Commit
6c2b7332
authored
Sep 05, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Added processor cores information to SystemLogicalProcessorInformation (Mac).
parent
4076e0eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
nt.c
dlls/ntdll/nt.c
+45
-0
No files found.
dlls/ntdll/nt.c
View file @
6c2b7332
...
...
@@ -1606,6 +1606,51 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
*
max_len
=
len
*
sizeof
(
**
data
);
return
STATUS_SUCCESS
;
}
#elif defined(__APPLE__)
static
NTSTATUS
create_logical_proc_info
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION
**
data
,
DWORD
*
max_len
)
{
DWORD
len
=
0
,
i
,
j
;
DWORD
cores_no
,
lcpu_no
,
lcpu_per_core
,
cores_per_package
;
size_t
size
;
ULONG_PTR
mask
;
lcpu_no
=
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
size
=
sizeof
(
cores_no
);
if
(
sysctlbyname
(
"machdep.cpu.core_count"
,
&
cores_no
,
&
size
,
NULL
,
0
))
cores_no
=
lcpu_no
;
lcpu_per_core
=
lcpu_no
/
cores_no
;
for
(
i
=
0
;
i
<
cores_no
;
i
++
)
{
mask
=
0
;
for
(
j
=
lcpu_per_core
*
i
;
j
<
lcpu_per_core
*
(
i
+
1
);
j
++
)
mask
|=
(
ULONG_PTR
)
1
<<
j
;
(
*
data
)[
len
].
Relationship
=
RelationProcessorCore
;
(
*
data
)[
len
].
ProcessorMask
=
mask
;
(
*
data
)[
len
].
u
.
ProcessorCore
.
Flags
=
0
;
/* TODO */
len
++
;
}
size
=
sizeof
(
cores_per_package
);
if
(
sysctlbyname
(
"machdep.cpu.cores_per_package"
,
&
cores_per_package
,
&
size
,
NULL
,
0
))
cores_per_package
=
lcpu_no
;
for
(
i
=
0
;
i
<
(
lcpu_no
+
cores_per_package
-
1
)
/
cores_per_package
;
i
++
)
{
mask
=
0
;
for
(
j
=
cores_per_package
*
i
;
j
<
cores_per_package
*
(
i
+
1
)
&&
j
<
lcpu_no
;
j
++
)
mask
|=
(
ULONG_PTR
)
1
<<
j
;
(
*
data
)[
len
].
Relationship
=
RelationProcessorPackage
;
(
*
data
)[
len
].
ProcessorMask
=
mask
;
len
++
;
}
*
max_len
=
len
*
sizeof
(
**
data
);
return
STATUS_SUCCESS
;
}
#else
static
NTSTATUS
create_logical_proc_info
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION
**
data
,
DWORD
*
max_len
)
{
...
...
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