mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[NTOS:KE] Make KeQueryActiveProcessors portable and non-paged
In Windows Vista and later, this routine can be called at any IRQL.
This commit is contained in:
@@ -667,16 +667,6 @@ KeFlushEntireTb(IN BOOLEAN Invalid,
|
||||
|
||||
}
|
||||
|
||||
KAFFINITY
|
||||
NTAPI
|
||||
KeQueryActiveProcessors(VOID)
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
/* Simply return the number of active processors */
|
||||
return KeActiveProcessors;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
KxSaveFloatingPointState(OUT PKFLOATING_SAVE FloatingState)
|
||||
|
||||
@@ -153,21 +153,6 @@ KeSetDmaIoCoherency(IN ULONG Coherency)
|
||||
KiDmaIoCoherency = Coherency;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
KAFFINITY
|
||||
NTAPI
|
||||
KeQueryActiveProcessors(VOID)
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
//
|
||||
// Simply return the number of active processors
|
||||
//
|
||||
return KeActiveProcessors;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
||||
@@ -1649,19 +1649,6 @@ KeSetDmaIoCoherency(IN ULONG Coherency)
|
||||
KiDmaIoCoherency = Coherency;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
KAFFINITY
|
||||
NTAPI
|
||||
KeQueryActiveProcessors(VOID)
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
/* Simply return the number of active processors */
|
||||
return KeActiveProcessors;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ USHORT KeProcessorArchitecture;
|
||||
USHORT KeProcessorLevel;
|
||||
USHORT KeProcessorRevision;
|
||||
ULONG KeFeatureBits;
|
||||
KAFFINITY KeActiveProcessors = 1;
|
||||
|
||||
/* System call count */
|
||||
ULONG KiServiceLimit = NUMBER_OF_SYSCALLS;
|
||||
@@ -31,9 +30,6 @@ PLOADER_PARAMETER_BLOCK KeLoaderBlock;
|
||||
/* PRCB Array */
|
||||
PKPRCB KiProcessorBlock[MAXIMUM_PROCESSORS];
|
||||
|
||||
/* Number of processors */
|
||||
CCHAR KeNumberProcessors = 0;
|
||||
|
||||
/* NUMA Node Support */
|
||||
KNODE KiNode0;
|
||||
PKNODE KeNodeBlock[1] = { &KiNode0 };
|
||||
|
||||
26
ntoskrnl/ke/processor.c
Normal file
26
ntoskrnl/ke/processor.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* PROJECT: ReactOS Kernel
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: Portable processor related routines
|
||||
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
CCHAR KeNumberProcessors = 0;
|
||||
KAFFINITY KeActiveProcessors = 0;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
KAFFINITY
|
||||
NTAPI
|
||||
KeQueryActiveProcessors(VOID)
|
||||
{
|
||||
return KeActiveProcessors;
|
||||
}
|
||||
@@ -186,6 +186,7 @@ list(APPEND SOURCE
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/ipi.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/krnlinit.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/mutex.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/processor.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/procobj.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/profobj.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/queue.c
|
||||
|
||||
Reference in New Issue
Block a user