Add PrcbLock and runtime counters to KPROCESSOR_CONTROL_BLOCK
All checks were successful
Builds / ExectOS (i686, release) (push) Successful in 35s
Builds / ExectOS (amd64, release) (push) Successful in 37s
Builds / ExectOS (amd64, debug) (push) Successful in 45s
Builds / ExectOS (i686, debug) (push) Successful in 43s

This commit is contained in:
2026-05-27 23:15:19 +02:00
parent 46594f1fc3
commit 19a9dfe7c6
3 changed files with 19 additions and 0 deletions

View File

@@ -560,6 +560,7 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK
ULONG_PTR SetMember; ULONG_PTR SetMember;
CPU_IDENTIFICATION CpuId; CPU_IDENTIFICATION CpuId;
KPROCESSOR_STATE ProcessorState; KPROCESSOR_STATE ProcessorState;
KSPIN_LOCK PrcbLock;
KSPIN_LOCK_QUEUE LockQueue[MaximumLock]; KSPIN_LOCK_QUEUE LockQueue[MaximumLock];
KDPC_DATA DpcData[2]; KDPC_DATA DpcData[2];
PVOID DpcStack; PVOID DpcStack;
@@ -567,6 +568,11 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK
VOLATILE ULONG_PTR TimerRequest; VOLATILE ULONG_PTR TimerRequest;
ULONG_PTR MultiThreadProcessorSet; ULONG_PTR MultiThreadProcessorSet;
SINGLE_LIST_ENTRY DeferredReadyListHead; SINGLE_LIST_ENTRY DeferredReadyListHead;
ULONG InterruptCount;
ULONG KernelTime;
ULONG UserTime;
ULONG DpcTime;
ULONG InterruptTime;
PROCESSOR_POWER_STATE PowerState; PROCESSOR_POWER_STATE PowerState;
ULONG ProfilingCountdown; ULONG ProfilingCountdown;
} KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK; } KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK;

View File

@@ -519,6 +519,7 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK
ULONG_PTR SetMember; ULONG_PTR SetMember;
CPU_IDENTIFICATION CpuId; CPU_IDENTIFICATION CpuId;
KPROCESSOR_STATE ProcessorState; KPROCESSOR_STATE ProcessorState;
KSPIN_LOCK PrcbLock;
KSPIN_LOCK_QUEUE LockQueue[MaximumLock]; KSPIN_LOCK_QUEUE LockQueue[MaximumLock];
ULONG_PTR MultiThreadProcessorSet; ULONG_PTR MultiThreadProcessorSet;
KDPC_DATA DpcData[2]; KDPC_DATA DpcData[2];
@@ -526,6 +527,11 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK
VOLATILE BOOLEAN DpcRoutineActive; VOLATILE BOOLEAN DpcRoutineActive;
VOLATILE ULONG_PTR TimerRequest; VOLATILE ULONG_PTR TimerRequest;
SINGLE_LIST_ENTRY DeferredReadyListHead; SINGLE_LIST_ENTRY DeferredReadyListHead;
ULONG InterruptCount;
ULONG KernelTime;
ULONG UserTime;
ULONG DpcTime;
ULONG InterruptTime;
PROCESSOR_POWER_STATE PowerState; PROCESSOR_POWER_STATE PowerState;
ULONG ProfilingCountdown; ULONG ProfilingCountdown;
} KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK; } KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK;

View File

@@ -152,6 +152,7 @@ KE::SystemTime::UpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
IN KRUNLEVEL RunLevel) IN KRUNLEVEL RunLevel)
{ {
LARGE_INTEGER InterruptTime, SystemTime; LARGE_INTEGER InterruptTime, SystemTime;
PKPROCESSOR_CONTROL_BLOCK ControlBlock;
LONG CurrentTickOffset; LONG CurrentTickOffset;
/* Advance the global interrupt time on every hardware tick */ /* Advance the global interrupt time on every hardware tick */
@@ -179,4 +180,10 @@ KE::SystemTime::UpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
/* Update processor and thread runtime accounting */ /* Update processor and thread runtime accounting */
KE::Dispatcher::UpdateRunTime(TrapFrame, RunLevel); KE::Dispatcher::UpdateRunTime(TrapFrame, RunLevel);
} }
else
{
/* Increment the interrupt count */
ControlBlock = KE::Processor::GetCurrentProcessorControlBlock();
ControlBlock->InterruptCount++;
}
} }