diff --git a/sdk/xtdk/amd64/ketypes.h b/sdk/xtdk/amd64/ketypes.h index 209903d..62f6b13 100644 --- a/sdk/xtdk/amd64/ketypes.h +++ b/sdk/xtdk/amd64/ketypes.h @@ -560,6 +560,7 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK ULONG_PTR SetMember; CPU_IDENTIFICATION CpuId; KPROCESSOR_STATE ProcessorState; + KSPIN_LOCK PrcbLock; KSPIN_LOCK_QUEUE LockQueue[MaximumLock]; KDPC_DATA DpcData[2]; PVOID DpcStack; @@ -567,6 +568,11 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK VOLATILE ULONG_PTR TimerRequest; ULONG_PTR MultiThreadProcessorSet; SINGLE_LIST_ENTRY DeferredReadyListHead; + ULONG InterruptCount; + ULONG KernelTime; + ULONG UserTime; + ULONG DpcTime; + ULONG InterruptTime; PROCESSOR_POWER_STATE PowerState; ULONG ProfilingCountdown; } KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK; diff --git a/sdk/xtdk/i686/ketypes.h b/sdk/xtdk/i686/ketypes.h index 39b0ee4..dc8e1b4 100644 --- a/sdk/xtdk/i686/ketypes.h +++ b/sdk/xtdk/i686/ketypes.h @@ -519,6 +519,7 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK ULONG_PTR SetMember; CPU_IDENTIFICATION CpuId; KPROCESSOR_STATE ProcessorState; + KSPIN_LOCK PrcbLock; KSPIN_LOCK_QUEUE LockQueue[MaximumLock]; ULONG_PTR MultiThreadProcessorSet; KDPC_DATA DpcData[2]; @@ -526,6 +527,11 @@ typedef struct _KPROCESSOR_CONTROL_BLOCK VOLATILE BOOLEAN DpcRoutineActive; VOLATILE ULONG_PTR TimerRequest; SINGLE_LIST_ENTRY DeferredReadyListHead; + ULONG InterruptCount; + ULONG KernelTime; + ULONG UserTime; + ULONG DpcTime; + ULONG InterruptTime; PROCESSOR_POWER_STATE PowerState; ULONG ProfilingCountdown; } KPROCESSOR_CONTROL_BLOCK, *PKPROCESSOR_CONTROL_BLOCK; diff --git a/xtoskrnl/ke/systime.cc b/xtoskrnl/ke/systime.cc index 0c965e9..1d6ff92 100644 --- a/xtoskrnl/ke/systime.cc +++ b/xtoskrnl/ke/systime.cc @@ -152,6 +152,7 @@ KE::SystemTime::UpdateSystemTime(IN PKTRAP_FRAME TrapFrame, IN KRUNLEVEL RunLevel) { LARGE_INTEGER InterruptTime, SystemTime; + PKPROCESSOR_CONTROL_BLOCK ControlBlock; LONG CurrentTickOffset; /* 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 */ KE::Dispatcher::UpdateRunTime(TrapFrame, RunLevel); } + else + { + /* Increment the interrupt count */ + ControlBlock = KE::Processor::GetCurrentProcessorControlBlock(); + ControlBlock->InterruptCount++; + } }