mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
UefiCpuPkg/CpuMpPei: Get AP reset code size and far jump information
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17994 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
46ba0f63e9
commit
8018cb158c
@ -23,6 +23,16 @@
|
|||||||
#include <Library/PeimEntryPoint.h>
|
#include <Library/PeimEntryPoint.h>
|
||||||
#include <Library/UefiCpuLib.h>
|
#include <Library/UefiCpuLib.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// AP reset code information
|
||||||
|
//
|
||||||
|
typedef struct {
|
||||||
|
UINT8 *RendezvousFunnelAddress;
|
||||||
|
UINTN PModeEntryOffset;
|
||||||
|
UINTN LModeEntryOffset;
|
||||||
|
UINTN RendezvousFunnelSize;
|
||||||
|
} MP_ASSEMBLY_ADDRESS_MAP;
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
@ -62,6 +72,19 @@ typedef struct {
|
|||||||
} MP_CPU_EXCHANGE_INFO;
|
} MP_CPU_EXCHANGE_INFO;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
/**
|
||||||
|
Assembly code to get starting address and size of the rendezvous entry for APs.
|
||||||
|
Information for fixing a jump instruction in the code is also returned.
|
||||||
|
|
||||||
|
@param AddressMap Output buffer for address map information.
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
AsmGetAddressMap (
|
||||||
|
OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assembly code to load GDT table and update segment accordingly.
|
Assembly code to load GDT table and update segment accordingly.
|
||||||
|
|
||||||
|
@ -144,6 +144,22 @@ CProcedureInvoke:
|
|||||||
RendezvousFunnelProc ENDP
|
RendezvousFunnelProc ENDP
|
||||||
RendezvousFunnelProcEnd::
|
RendezvousFunnelProcEnd::
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
; AsmGetAddressMap (&AddressMap);
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
AsmGetAddressMap PROC near C PUBLIC
|
||||||
|
pushad
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
mov ebx, dword ptr [ebp+24h]
|
||||||
|
mov dword ptr [ebx], RendezvousFunnelProcStart
|
||||||
|
mov dword ptr [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
||||||
|
mov dword ptr [ebx + 8h], 0
|
||||||
|
mov dword ptr [ebx + 0ch], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
|
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
AsmGetAddressMap ENDP
|
||||||
|
|
||||||
AsmInitializeGdt PROC near C PUBLIC
|
AsmInitializeGdt PROC near C PUBLIC
|
||||||
push ebp
|
push ebp
|
||||||
|
@ -132,6 +132,22 @@ CProcedureInvoke:
|
|||||||
jmp $ ; never reach here
|
jmp $ ; never reach here
|
||||||
RendezvousFunnelProcEnd:
|
RendezvousFunnelProcEnd:
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
; AsmGetAddressMap (&AddressMap);
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(AsmGetAddressMap)
|
||||||
|
ASM_PFX(AsmGetAddressMap):
|
||||||
|
pushad
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
mov ebx, [ebp + 24h]
|
||||||
|
mov dword [ebx], RendezvousFunnelProcStart
|
||||||
|
mov dword [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
||||||
|
mov dword [ebx + 8h], 0
|
||||||
|
mov dword [ebx + 0ch], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
|
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
|
||||||
global ASM_PFX(AsmInitializeGdt)
|
global ASM_PFX(AsmInitializeGdt)
|
||||||
ASM_PFX(AsmInitializeGdt):
|
ASM_PFX(AsmInitializeGdt):
|
||||||
|
@ -181,6 +181,17 @@ CProcedureInvoke:
|
|||||||
RendezvousFunnelProc ENDP
|
RendezvousFunnelProc ENDP
|
||||||
RendezvousFunnelProcEnd::
|
RendezvousFunnelProcEnd::
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
; AsmGetAddressMap (&AddressMap);
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
AsmGetAddressMap PROC
|
||||||
|
mov rax, offset RendezvousFunnelProcStart
|
||||||
|
mov qword ptr [rcx], rax
|
||||||
|
mov qword ptr [rcx + 8h], Flat32Start - RendezvousFunnelProcStart
|
||||||
|
mov qword ptr [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
|
||||||
|
mov qword ptr [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
|
ret
|
||||||
|
AsmGetAddressMap ENDP
|
||||||
|
|
||||||
AsmInitializeGdt PROC
|
AsmInitializeGdt PROC
|
||||||
push rbp
|
push rbp
|
||||||
|
@ -175,6 +175,17 @@ CProcedureInvoke:
|
|||||||
|
|
||||||
RendezvousFunnelProcEnd:
|
RendezvousFunnelProcEnd:
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
; AsmGetAddressMap (&AddressMap);
|
||||||
|
;-------------------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(AsmGetAddressMap)
|
||||||
|
ASM_PFX(AsmGetAddressMap):
|
||||||
|
mov rax, ASM_PFX(RendezvousFunnelProc)
|
||||||
|
mov qword [rcx], rax
|
||||||
|
mov qword [rcx + 8h], Flat32Start - RendezvousFunnelProcStart
|
||||||
|
mov qword [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
|
||||||
|
mov qword [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
|
ret
|
||||||
|
|
||||||
global ASM_PFX(AsmInitializeGdt)
|
global ASM_PFX(AsmInitializeGdt)
|
||||||
ASM_PFX(AsmInitializeGdt):
|
ASM_PFX(AsmInitializeGdt):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user