First public contribution.
1 // Copyright (c) 2008-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 // e32\nkernsmp\x86\nccpu.cia
21 __NAKED__ void cmos_write(TUint32 val, TUint32 addr)
23 asm("mov eax, [esp+8]");
25 asm("mov eax, [esp+4]");
30 __NAKED__ void SetupApInitInfo(volatile SApInitInfo&)
32 asm("mov ecx, [esp+4]");
33 asm("sgdt [ecx+%0]": :"i"_FOFF(SApInitInfo, iGdtr));
34 asm("sidt [ecx+%0]": :"i"_FOFF(SApInitInfo, iIdtr));
36 asm("mov [ecx+%0], eax": :"i"_FOFF(SApInitInfo, iCr0));
38 asm("mov [ecx+%0], eax": :"i"_FOFF(SApInitInfo, iCr3));
40 asm("mov [ecx+%0], eax": :"i"_FOFF(SApInitInfo, iCr4));
44 __NAKED__ void _ApMain()
46 asm("mov eax, %0" : : "i" (RING0_DS));
52 asm("lgdt [edi+%0]" : : "i" _FOFF(SApInitInfo, iGdtr));
53 asm("lidt [edi+%0]" : : "i" _FOFF(SApInitInfo, iIdtr));
54 asm("mov esp, [edi+%0]" : : "i" _FOFF(SApInitInfo, iRgs.iEsp));
55 asm("mov eax, [edi+%0]" : : "i" _FOFF(SApInitInfo, iBootFlag));
56 asm("lock dec dword ptr [edi+%0]" : : "i" _FOFF(SApInitInfo, iBootFlag));
59 asm("cmp eax, [edi+%0]" : : "i" _FOFF(SApInitInfo, iBootFlag));
61 asm("jne wait_for_bp ");
64 asm("and al, 0xf7 "); // enable access to FPU
66 asm("fninit "); // initialise coprocessor
69 asm("mov cr0, eax "); // disable access to coprocessor
71 asm("mov ecx, [edi+%0]" : : "i" _FOFF(SApInitInfo, iExtra));
72 asm("mov eax, [ecx+%0]" : : "i" _FOFF(SAPBootInfo, iMain));