Update contrib.
1 // Copyright (c) 2007-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.cia
19 #include <nktest/nkutils.h>
24 void __fastcall thread_request_signal(NThread* aThread);
30 __NAKED__ void __cpu_idle()
36 __NAKED__ void __cpu_yield()
42 __NAKED__ TLinAddr __stack_pointer()
48 __NAKED__ TUint32 __cpu_status_reg()
55 __NAKED__ TUint32 __cpu_id()
62 __NAKED__ TUint32 __trace_cpu_num()
71 TUint64 __NAKED__ fast_counter()
77 TUint32 __NAKED__ norm_fast_counter()
79 asm("mov ecx, [%a0]": :"i"(&nfcfs));
81 asm("shrd eax, edx, cl");
85 __NAKED__ void nfcfspin(TUint32 aTicks)
87 asm("mov ecx, [%a0]": :"i"(&nfcfs));
89 asm("mov ebx, [esp+8]");
91 asm("shrd eax, edx, cl");
95 asm("shrd eax, edx, cl");
102 __NAKED__ void fcfspin(TUint64 aTicks)
104 asm("mov ecx, [esp+4]");
106 asm("mov ebx, [esp+12]");
119 __NAKED__ TUint32 set_bit0_if_nonnull(TUint32&)
121 asm("mov ecx, [esp+4]");
122 asm("mov eax, [ecx]");
125 asm("jz short done1");
128 asm("lock cmpxchg [ecx], edx");
129 asm("jne short xx1");
134 __NAKED__ void flip_bit0(TUint32&)
136 asm("mov ecx, [esp+4]");
137 asm("lock xor dword ptr [ecx], 1");
141 __NAKED__ TUint32 swap_out_if_bit0_clear(TUint32&)
143 asm("mov ecx, [esp+4]");
144 asm("mov eax, [ecx]");
147 asm("jnz short done2");
149 asm("lock cmpxchg [ecx], edx");
150 asm("jne short xx2");
155 __NAKED__ TUint32 __eflags()
163 __NAKED__ void RequestComplete(NThread* /*aThread*/, NRequestStatus*& /*aStatus*/, TInt /*aValue*/)
165 asm("mov ecx, [esp+8]");
167 asm("lock xchg eax, [ecx]");
168 asm("mov edx, [esp+12]");
171 asm("mov ecx, [esp+4]");
172 asm("mov [eax], edx");
173 asm("call %a0": :"i"(&thread_request_signal));