mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +00:00
[NTOSKRNL] Print boot cycles on x64 just like on x86
This commit is contained in:
parent
225e0c89d9
commit
9658c6a220
2 changed files with 28 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
||||||
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H
|
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H
|
||||||
#define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H
|
#define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define X86_EFLAGS_TF 0x00000100 /* Trap flag */
|
#define X86_EFLAGS_TF 0x00000100 /* Trap flag */
|
||||||
#define X86_EFLAGS_IF 0x00000200 /* Interrupt Enable flag */
|
#define X86_EFLAGS_IF 0x00000200 /* Interrupt Enable flag */
|
||||||
#define X86_EFLAGS_IOPL 0x00003000 /* I/O Privilege Level bits */
|
#define X86_EFLAGS_IOPL 0x00003000 /* I/O Privilege Level bits */
|
||||||
|
@ -363,7 +367,21 @@ KiUserTrap(IN PKTRAP_FRAME TrapFrame)
|
||||||
return !!(TrapFrame->SegCs & MODE_MASK);
|
return !!(TrapFrame->SegCs & MODE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define Ki386PerfEnd()
|
//
|
||||||
|
// PERF Code
|
||||||
|
//
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
Ki386PerfEnd(VOID)
|
||||||
|
{
|
||||||
|
extern ULONGLONG BootCyclesEnd, BootCycles;
|
||||||
|
BootCyclesEnd = __rdtsc();
|
||||||
|
DbgPrint("Boot took %I64u cycles!\n", BootCyclesEnd - BootCycles);
|
||||||
|
DbgPrint("Interrupts: %u System Calls: %u Context Switches: %u\n",
|
||||||
|
KeGetCurrentPrcb()->InterruptCount,
|
||||||
|
KeGetCurrentPrcb()->KeSystemCalls,
|
||||||
|
KeGetContextSwitches(KeGetCurrentPrcb()));
|
||||||
|
}
|
||||||
|
|
||||||
struct _KPCR;
|
struct _KPCR;
|
||||||
|
|
||||||
|
@ -455,6 +473,10 @@ KiSetTrapContext(
|
||||||
_In_ PCONTEXT Context,
|
_In_ PCONTEXT Context,
|
||||||
_In_ KPROCESSOR_MODE RequestorMode);
|
_In_ KPROCESSOR_MODE RequestorMode);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H */
|
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -34,6 +34,8 @@ UCHAR DECLSPEC_ALIGN(16) KiDoubleFaultStackData[KERNEL_STACK_SIZE] = {0};
|
||||||
ULONG_PTR P0BootStack = (ULONG_PTR)&P0BootStackData[KERNEL_STACK_SIZE];
|
ULONG_PTR P0BootStack = (ULONG_PTR)&P0BootStackData[KERNEL_STACK_SIZE];
|
||||||
ULONG_PTR KiDoubleFaultStack = (ULONG_PTR)&KiDoubleFaultStackData[KERNEL_STACK_SIZE];
|
ULONG_PTR KiDoubleFaultStack = (ULONG_PTR)&KiDoubleFaultStackData[KERNEL_STACK_SIZE];
|
||||||
|
|
||||||
|
ULONGLONG BootCycles, BootCyclesEnd;
|
||||||
|
|
||||||
void KiInitializeSegments();
|
void KiInitializeSegments();
|
||||||
void KiSystemCallEntry64();
|
void KiSystemCallEntry64();
|
||||||
void KiSystemCallEntry32();
|
void KiSystemCallEntry32();
|
||||||
|
@ -382,6 +384,9 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
ULONG64 InitialStack;
|
ULONG64 InitialStack;
|
||||||
PKIPCR Pcr;
|
PKIPCR Pcr;
|
||||||
|
|
||||||
|
/* Boot cycles timestamp */
|
||||||
|
BootCycles = __rdtsc();
|
||||||
|
|
||||||
/* HACK */
|
/* HACK */
|
||||||
FrLdrDbgPrint = LoaderBlock->u.I386.CommonDataArea;
|
FrLdrDbgPrint = LoaderBlock->u.I386.CommonDataArea;
|
||||||
//FrLdrDbgPrint("Hello from KiSystemStartup!!!\n");
|
//FrLdrDbgPrint("Hello from KiSystemStartup!!!\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue