mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 03:12:59 +00:00
[NTOSKRNL]
Completely implement Complete NtQuerySystemInformation - SystemNumaProcessorMap CORE-9680 svn path=/trunk/; revision=68171
This commit is contained in:
parent
564ff01f3d
commit
0b3c4c8734
1 changed files with 29 additions and 13 deletions
|
@ -2168,31 +2168,47 @@ SSI_DEF(SystemLoadGdiDriverInSystemSpaceInformation)
|
||||||
/* Class 55 - NUMA processor information */
|
/* Class 55 - NUMA processor information */
|
||||||
QSI_DEF(SystemNumaProcessorMap)
|
QSI_DEF(SystemNumaProcessorMap)
|
||||||
{
|
{
|
||||||
|
ULONG MaxEntries, Node;
|
||||||
PSYSTEM_NUMA_INFORMATION NumaInformation = (PSYSTEM_NUMA_INFORMATION)Buffer;
|
PSYSTEM_NUMA_INFORMATION NumaInformation = (PSYSTEM_NUMA_INFORMATION)Buffer;
|
||||||
|
|
||||||
|
/* Validate input size */
|
||||||
if (Size < sizeof(ULONG))
|
if (Size < sizeof(ULONG))
|
||||||
{
|
{
|
||||||
return STATUS_INFO_LENGTH_MISMATCH;
|
return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1 // Partial & incomplete implementation just to let GetNumaHighestNodeNumber() work
|
/* Return highest node */
|
||||||
/* In case of a partial query, just return number of nodes and stop here */
|
NumaInformation->HighestNodeNumber = KeNumberNodes - 1;
|
||||||
if (Size < sizeof(SYSTEM_NUMA_INFORMATION))
|
|
||||||
|
/* Compute how much entries we will be able to put in output structure */
|
||||||
|
MaxEntries = (Size - FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask)) / sizeof(ULONGLONG);
|
||||||
|
/* Make sure we don't overflow KeNodeBlock */
|
||||||
|
if (MaxEntries > KeNumberNodes)
|
||||||
{
|
{
|
||||||
NumaInformation->HighestNodeNumber = KeNumberNodes - 1;
|
MaxEntries = KeNumberNodes;
|
||||||
*ReqSize = sizeof(ULONG);
|
}
|
||||||
return STATUS_SUCCESS;
|
|
||||||
|
/* If we have entries to write, and room for it */
|
||||||
|
if (Size >= FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask) &&
|
||||||
|
MaxEntries != 0)
|
||||||
|
{
|
||||||
|
/* Already set size we return */
|
||||||
|
*ReqSize = FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask) +
|
||||||
|
MaxEntries * sizeof(ULONGLONG);
|
||||||
|
|
||||||
|
/* For each node, return processor mask */
|
||||||
|
for (Node = 0; Node < MaxEntries; ++Node)
|
||||||
|
{
|
||||||
|
NumaInformation->ActiveProcessorsAffinityMask[Node] = KeNodeBlock[Node]->ProcessorMask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("NtQuerySystemInformation - SystemNumaProcessorMap not implemented\n");
|
/* We only returned highest node number */
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
*ReqSize = sizeof(ULONG);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/* FIXME */
|
return STATUS_SUCCESS;
|
||||||
DPRINT1("NtQuerySystemInformation - SystemNumaProcessorMap not implemented\n");
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue