First public contribution.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\nkernsa\x86\x86utils.cpp
19 #include <nktest/nkutils.h>
23 void __fastcall thread_request_signal(NThread* aThread);
30 TUint32 round_to_page(TUint32 x)
32 return (x + KPageSize - 1) &~ (KPageSize - 1);
36 TLinAddr __initial_stack_base()
38 return __stack_pointer() & ~0xfff;
41 TInt __initial_stack_size()
46 TUint64 fast_counter_freq()
51 TUint32 norm_fast_counter_freq()
56 void init_fast_counter()
59 TUint64 initial = fast_counter();
61 TUint64 final = fast_counter();
62 fcf = final - initial;
67 nfcf = (TUint32)(fcf >> nfcfs);
69 DEBUGPRINT("fcf=%lx",fcf);
70 DEBUGPRINT("nfcf=%d",nfcf);
73 TInt __microseconds_to_fast_counter(TInt us)
75 TUint64 x = TUint64(TUint32(us));
78 x /= TUint64(1000000);
83 TInt __microseconds_to_norm_fast_counter(TInt us)
85 TUint64 x = TUint64(TUint32(us));
88 x /= TUint64(1000000);
93 extern TUint32 __eflags();
96 KPrintf("EFLAGS=%08x", __eflags());
99 void __fastcall thread_request_signal(NThread* aThread)
101 NKern::ThreadRequestSignal(aThread);