328{
332 ULONG64 CurrentCycleTime, ElapsedCycles, NewCycleTime;
333
334
336
337
338 OldProcess = OldThread->ApcState.Process;
339 NewProcess = NewThread->
ApcState.Process;
340 if (OldProcess != NewProcess)
341 {
342
344 {
345 if (NewProcess->LdtDescriptor.LimitLow)
346 {
348 ((
PULONG)&NewProcess->LdtDescriptor)[0],
349 ((
PULONG)&NewProcess->LdtDescriptor)[1]);
350 Ke386SetLocalDescriptorTable(
KGDT_LDT);
351 }
352 else
353 {
354 Ke386SetLocalDescriptorTable(0);
355 }
356 }
357
358
360 }
361
362
365 NewCycleTime = ((
PETHREAD)OldThread)->CycleTime + ElapsedCycles;
369
370
371 Ke386SetGs(0);
372
373
375
376
379 {
381 }
384
385
387
388
390
391
393 {
394
399 0);
400 }
401
402
403 if (NewThread->
ApcState.KernelApcPending)
404 {
405
407 {
408
409 if (SwitchFrame->ApcBypassDisable)
411 else
413 }
414 }
415
416
418}
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
VOID FASTCALL HalRequestSoftwareInterrupt(IN KIRQL Irql)
PPC_QUAL unsigned long long __rdtsc(void)
__INTRIN_INLINE void __writecr3(unsigned int Data)
FORCEINLINE VOID KiWriteThreadCycleTime(_Inout_ PKTHREAD Thread, _In_ ULONG64 NewCycleTime)
VOID KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2)
struct _KTRAP_FRAME KTRAP_FRAME
struct _ETHREAD * PETHREAD
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
#define KeGetTrapFrame(Thread)
FORCEINLINE VOID KiSetTebBase(PKPCR Pcr, PNT_TIB TebAddress)
ULONG_PTR DirectoryTableBase
#define FIELD_OFFSET(t, f)