1 ;------------------------------------------------------------------------------ ;
2 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
3 ; This program and the accompanying materials
4 ; are licensed and made available under the terms and conditions of the BSD License
5 ; which accompanies this distribution. The full text of the license may be found at
6 ; http://opensource.org/licenses/bsd-license.php.
8 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 ; This is the assembly code for Multi-processor S3 support
19 ;-------------------------------------------------------------------------------
23 extern ASM_PFX(InitializeFloatingPointUnits)
25 %define VacantFlag 0x0
26 %define NotVacantFlag 0xff
28 %define LockLocation RendezvousFunnelProcEnd - RendezvousFunnelProcStart
29 %define StackStart LockLocation + 0x4
30 %define StackSize LockLocation + 0x8
31 %define RendezvousProc LockLocation + 0xC
32 %define GdtrProfile LockLocation + 0x10
33 %define IdtrProfile LockLocation + 0x16
34 %define BufferStart LockLocation + 0x1C
36 ;-------------------------------------------------------------------------------------
37 ;RendezvousFunnelProc procedure follows. All APs execute their procedure. This
38 ;procedure serializes all the AP processors through an Init sequence. It must be
39 ;noted that APs arrive here very raw...ie: real mode, no stack.
40 ;ALSO THIS PROCEDURE IS EXECUTED BY APs ONLY ON 16 BIT MODE. HENCE THIS PROC
42 ;-------------------------------------------------------------------------------------
43 ;RendezvousFunnelProc (&WakeUpBuffer,MemAddress);
46 global ASM_PFX(RendezvousFunnelProc)
47 ASM_PFX(RendezvousFunnelProc):
48 RendezvousFunnelProcStart:
50 ; At this point CS = 0x(vv00) and ip= 0x0.
63 mov edx,dword [si] ; EDX is keeping the start address of wakeup buffer
74 mov eax, cr0 ; Get control register 0
75 or eax, 0x000000001 ; Set PE bit (bit #0)
80 a32 jmp dword 0x20:0x0
83 PMODE_ENTRY: ; protected mode entry point
90 o16 mov ss, ax ; Flat mode setup.
117 add edi, LockLocation
121 ; Call assembly function to initialize FPU.
123 mov ebx, ASM_PFX(InitializeFloatingPointUnits)
129 add edi, RendezvousProc
134 call eax ; Call C function
141 RendezvousFunnelProcEnd:
142 ;-------------------------------------------------------------------------------------
143 ; AsmGetAddressMap (&AddressMap);
144 ;-------------------------------------------------------------------------------------
145 global ASM_PFX(AsmGetAddressMap)
146 ASM_PFX(AsmGetAddressMap):
151 mov ebx, dword [ebp+0x24]
152 mov dword [ebx], RendezvousFunnelProcStart
153 mov dword [ebx+0x4], PMODE_ENTRY - RendezvousFunnelProcStart
154 mov dword [ebx+0x8], FLAT32_JUMP - RendezvousFunnelProcStart
155 mov dword [ebx+0xc], RendezvousFunnelProcEnd - RendezvousFunnelProcStart