rdmsr file and updates status

This commit is contained in:
Max Raulea 2026-07-22 10:02:29 +02:00
parent a4da625e05
commit 5fdd2e7738
2 changed files with 22 additions and 0 deletions

View file

@ -199,8 +199,12 @@ CommandRdmsr(vector<CommandToken> CommandTokens, string Command)
//
// Find logical cores count
//
#ifdef _WIN32
SIZE_T NumCores = GetWindowsNumaNumberOfCores();
NumCPU = NumCores > 0 ? NumCores : GetWindowsCompatibleNumberOfCores();
#else
NumCPU = PlatformGetActiveProcessorCount();
#endif
//
// allocate buffer for transferring messages

View file

@ -269,6 +269,24 @@ reasons (`RTL_PROCESS_MODULES` / `RTL_PROCESS_MODULE_INFORMATION` undeclared, an
`WCHAR *` vs `wchar_t *` — the wide-char item below); none of those are on lines
this sweep touched.
### rdmsr.cpp core-count — DONE (2026-07-22)
Follow-up to the bucket-1 sweep of `rdmsr.cpp` above (this is a separate bucket-2
change, not part of the mechanical batch). The command needs the online logical-CPU
count to size its per-core transfer buffer; on Windows that came from two static
helpers (`GetWindowsCompatibleNumberOfCores` via `GetSystemInfo`, and
`GetWindowsNumaNumberOfCores` via `GetLogicalProcessorInformationEx` — the latter
`GetProcAddress`-loaded from `kernel32.dll`, so entirely Win32).
- Both static helpers + their `glpie_t` typedef guarded `#ifdef _WIN32` (rdmsr.cpp
lines 36111). Windows bodies untouched.
- Call site (`CommandRdmsr`, ~line 199): Windows path keeps the NUMA-then-fallback
logic; Linux `#else` calls the new `PlatformGetActiveProcessorCount()`.
- **Pure addition:** `PlatformGetActiveProcessorCount(VOID)` in
`platform-lib-calls.{h,c}` — Windows `GetSystemInfo``dwNumberOfProcessors`;
Linux `sysconf(_SC_NPROCESSORS_ONLN)` (returns 0 if unknown). ⚠️ Linux branch
marked "Not yet tested!!" in the source — verify before relying on it.
---
## TODO ledger — revisit before Linux is functional