From c6a71b91c5095e01eba08a6d02def259a0a46478 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Wed, 20 Jun 2018 22:29:43 -0700 Subject: [PATCH] ntdll: Store core information by core on macOS. The id parameter can be used for core / package lookup. On Linux we pass package or core values. On Mac, we use package for both. Use a core identifier on Mac as well. Signed-off-by: Roderick Colenbrander Signed-off-by: Alexandre Julliard --- dlls/ntdll/nt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 985f58c5638..e4fec632d35 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1811,6 +1811,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** for(p = 0; p < pkgs_no; ++p){ for(j = 0; j < cores_per_package && p * cores_per_package + j < cores_no; ++j){ ULONG_PTR mask = 0; + DWORD phys_core; for(k = 0; k < lcpu_per_core; ++k) mask |= (ULONG_PTR)1 << (j * lcpu_per_core + k); @@ -1822,7 +1823,8 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** return STATUS_NO_MEMORY; /* add new core */ - if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorCore, p, mask)) + phys_core = p * cores_per_package + j; + if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorCore, phys_core, mask)) return STATUS_NO_MEMORY; for(i = 1; i < 5; ++i){