1 ;------------------------------------------------------------------------------ ;
2 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
3 ; SPDX-License-Identifier: BSD-2-Clause-Patent
11 ; This is the assembly code for Multi-processor S3 support
13 ;-------------------------------------------------------------------------------
17 extern ASM_PFX(InitializeFloatingPointUnits)
19 %define VacantFlag 0x0
20 %define NotVacantFlag 0xff
22 %define LockLocation RendezvousFunnelProcEnd - RendezvousFunnelProcStart
23 %define StackStart LockLocation + 0x4
24 %define StackSize LockLocation + 0x8
25 %define RendezvousProc LockLocation + 0xC
26 %define GdtrProfile LockLocation + 0x10
27 %define IdtrProfile LockLocation + 0x16
28 %define BufferStart LockLocation + 0x1C
30 ;-------------------------------------------------------------------------------------
31 ;RendezvousFunnelProc procedure follows. All APs execute their procedure. This
32 ;procedure serializes all the AP processors through an Init sequence. It must be
33 ;noted that APs arrive here very raw...ie: real mode, no stack.
34 ;ALSO THIS PROCEDURE IS EXECUTED BY APs ONLY ON 16 BIT MODE. HENCE THIS PROC
36 ;-------------------------------------------------------------------------------------
37 ;RendezvousFunnelProc (&WakeUpBuffer,MemAddress);
40 global ASM_PFX(RendezvousFunnelProc)
41 ASM_PFX(RendezvousFunnelProc):
42 RendezvousFunnelProcStart:
44 ; At this point CS = 0x(vv00) and ip= 0x0.
57 mov edx,dword [si] ; EDX is keeping the start address of wakeup buffer
68 mov eax, cr0 ; Get control register 0
69 or eax, 0x000000001 ; Set PE bit (bit #0)
74 a32 jmp dword 0x20:0x0
77 PMODE_ENTRY: ; protected mode entry point
84 o16 mov ss, ax ; Flat mode setup.
111 add edi, LockLocation
115 ; Call assembly function to initialize FPU.
117 mov ebx, ASM_PFX(InitializeFloatingPointUnits)
123 add edi, RendezvousProc
128 call eax ; Call C function
135 RendezvousFunnelProcEnd:
136 ;-------------------------------------------------------------------------------------
137 ; AsmGetAddressMap (&AddressMap);
138 ;-------------------------------------------------------------------------------------
139 global ASM_PFX(AsmGetAddressMap)
140 ASM_PFX(AsmGetAddressMap):
145 mov ebx, dword [ebp+0x24]
146 mov dword [ebx], RendezvousFunnelProcStart
147 mov dword [ebx+0x4], PMODE_ENTRY - RendezvousFunnelProcStart
148 mov dword [ebx+0x8], FLAT32_JUMP - RendezvousFunnelProcStart
149 mov dword [ebx+0xc], RendezvousFunnelProcEnd - RendezvousFunnelProcStart