--- a/kernel/eka/nkernsmp/x86/nccpu.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/nccpu.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -191,9 +191,7 @@
__e32_io_completion_barrier();
a.iBPTimestamp = X86::Timestamp();
__e32_io_completion_barrier();
- a.iBootFlag2 = 3;
- __e32_io_completion_barrier();
- while (a.iBootFlag2==3)
+ while (a.iBootFlag2==2)
{}
__e32_io_completion_barrier();
NKern::EnableAllInterrupts();
@@ -201,16 +199,8 @@
return KErrNone;
}
-void InitTimestamp(TSubScheduler* aSS, SNThreadCreateInfo& aInfo)
+void InitAPTimestamp(SNThreadCreateInfo&)
{
- NThread* t = (NThread*)aSS->iCurrentThread;
- t->iActiveState = 1;
- if (aSS->iCpuNum == 0)
- {
- aSS->iLastTimestamp.i64 = 0;
- t->iLastActivationTime.i64 = 0;
- return;
- }
volatile SApInitInfo& a = *(volatile SApInitInfo*)KApBootPage;
NKern::DisableAllInterrupts();
a.iBootFlag2 = 1;
@@ -220,20 +210,16 @@
__e32_io_completion_barrier();
a.iAPTimestamp = X86::Timestamp();
__e32_io_completion_barrier();
- while (a.iBootFlag2!=3)
- {}
- __e32_io_completion_barrier();
TUint64 bpt = a.iBPTimestamp;
TUint64 apt = a.iAPTimestamp;
TUint64 delta = bpt - apt;
- aSS->iSSX.iTimestampOffset.i64 = delta;
- TUint64 now = NKern::Timestamp();
+ TSubScheduler& ss = SubScheduler();
+ ss.iLastTimestamp64 += delta;
+ *(TUint64*)&ss.i_TimestampOffset = delta;
__KTRACE_OPT(KBOOT,DEBUGPRINT("APT=0x%lx BPT=0x%lx Delta=0x%lx", apt, bpt, delta));
__e32_io_completion_barrier();
- a.iBootFlag2 = 4;
+ a.iBootFlag2 = 3;
NKern::EnableAllInterrupts();
- t->iLastActivationTime.i64 = now;
- aSS->iLastTimestamp.i64 = now;
}