mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
UefiCpuPkg/CpuMpPei: Remove PmodeOffset and LmodeOffset
Remove Pmode(Entry)Offset/Lmode(Entry)Offset and use unified Mode(Entry)Offset to clean up the definition of MP_ASSEMBLY_ADDRESS_MAP and MP_CPU_EXCHANGE_INFO. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Giri Mudusuru <giri.p.mudusuru@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
This commit is contained in:
parent
6d98a37159
commit
01beffa7e9
@ -428,8 +428,7 @@ WakeUpAP (
|
|||||||
ExchangeInfo->StackStart = PeiCpuMpData->Buffer;
|
ExchangeInfo->StackStart = PeiCpuMpData->Buffer;
|
||||||
ExchangeInfo->StackSize = PeiCpuMpData->CpuApStackSize;
|
ExchangeInfo->StackSize = PeiCpuMpData->CpuApStackSize;
|
||||||
ExchangeInfo->BufferStart = PeiCpuMpData->WakeupBuffer;
|
ExchangeInfo->BufferStart = PeiCpuMpData->WakeupBuffer;
|
||||||
ExchangeInfo->PmodeOffset = PeiCpuMpData->AddressMap.PModeEntryOffset;
|
ExchangeInfo->ModeOffset = PeiCpuMpData->AddressMap.ModeEntryOffset;
|
||||||
ExchangeInfo->LmodeOffset = PeiCpuMpData->AddressMap.LModeEntryOffset;
|
|
||||||
ExchangeInfo->Cr3 = AsmReadCr3 ();
|
ExchangeInfo->Cr3 = AsmReadCr3 ();
|
||||||
ExchangeInfo->CodeSegment = AsmReadCs ();
|
ExchangeInfo->CodeSegment = AsmReadCs ();
|
||||||
ExchangeInfo->DataSegment = AsmReadDs ();
|
ExchangeInfo->DataSegment = AsmReadDs ();
|
||||||
|
@ -66,8 +66,7 @@ typedef enum {
|
|||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 *RendezvousFunnelAddress;
|
UINT8 *RendezvousFunnelAddress;
|
||||||
UINTN PModeEntryOffset;
|
UINTN ModeEntryOffset;
|
||||||
UINTN LModeEntryOffset;
|
|
||||||
UINTN RendezvousFunnelSize;
|
UINTN RendezvousFunnelSize;
|
||||||
} MP_ASSEMBLY_ADDRESS_MAP;
|
} MP_ASSEMBLY_ADDRESS_MAP;
|
||||||
|
|
||||||
@ -98,11 +97,10 @@ typedef struct {
|
|||||||
IA32_DESCRIPTOR GdtrProfile;
|
IA32_DESCRIPTOR GdtrProfile;
|
||||||
IA32_DESCRIPTOR IdtrProfile;
|
IA32_DESCRIPTOR IdtrProfile;
|
||||||
UINTN BufferStart;
|
UINTN BufferStart;
|
||||||
UINTN PmodeOffset;
|
UINTN ModeOffset;
|
||||||
UINTN NumApsExecuting;
|
UINTN NumApsExecuting;
|
||||||
UINTN CodeSegment;
|
UINTN CodeSegment;
|
||||||
UINTN DataSegment;
|
UINTN DataSegment;
|
||||||
UINTN LmodeOffset;
|
|
||||||
UINTN Cr3;
|
UINTN Cr3;
|
||||||
PEI_CPU_MP_DATA *PeiCpuMpData;
|
PEI_CPU_MP_DATA *PeiCpuMpData;
|
||||||
} MP_CPU_EXCHANGE_INFO;
|
} MP_CPU_EXCHANGE_INFO;
|
||||||
|
@ -32,7 +32,7 @@ ApProcedureLocation equ LockLocation + 0Ch
|
|||||||
GdtrLocation equ LockLocation + 10h
|
GdtrLocation equ LockLocation + 10h
|
||||||
IdtrLocation equ LockLocation + 16h
|
IdtrLocation equ LockLocation + 16h
|
||||||
BufferStartLocation equ LockLocation + 1Ch
|
BufferStartLocation equ LockLocation + 1Ch
|
||||||
PmodeOffsetLocation equ LockLocation + 20h
|
ModeOffsetLocation equ LockLocation + 20h
|
||||||
NumApsExecutingLoction equ LockLocation + 24h
|
NumApsExecutingLoction equ LockLocation + 24h
|
||||||
CodeSegmentLocation equ LockLocation + 28h
|
CodeSegmentLocation equ LockLocation + 28h
|
||||||
DataSegmentLocation equ LockLocation + 2Ch
|
DataSegmentLocation equ LockLocation + 2Ch
|
||||||
|
@ -52,7 +52,7 @@ RendezvousFunnelProcStart::
|
|||||||
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
|
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
|
||||||
|
|
||||||
db 0BEh ; opcode of mov si, mem16
|
db 0BEh ; opcode of mov si, mem16
|
||||||
dw PmodeOffsetLocation ; mov si, PmodeOffsetLocation
|
dw ModeOffsetLocation ; mov si, ModeOffsetLocation
|
||||||
db 66h, 8Bh, 04h ; mov eax, [si]
|
db 66h, 8Bh, 04h ; mov eax, [si]
|
||||||
db 0BEh ; opcode of mov si, mem16
|
db 0BEh ; opcode of mov si, mem16
|
||||||
dw CodeSegmentLocation ; mov si, CodeSegmentLocation
|
dw CodeSegmentLocation ; mov si, CodeSegmentLocation
|
||||||
@ -161,9 +161,8 @@ AsmGetAddressMap PROC near C PUBLIC
|
|||||||
|
|
||||||
mov ebx, dword ptr [ebp+24h]
|
mov ebx, dword ptr [ebp+24h]
|
||||||
mov dword ptr [ebx], RendezvousFunnelProcStart
|
mov dword ptr [ebx], RendezvousFunnelProcStart
|
||||||
mov dword ptr [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
mov dword ptr [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
||||||
mov dword ptr [ebx + 8h], 0
|
mov dword ptr [ebx + 8h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
mov dword ptr [ebx + 0ch], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
@ -48,7 +48,7 @@ BITS 16
|
|||||||
mov si, BufferStartLocation
|
mov si, BufferStartLocation
|
||||||
mov ebx, [si]
|
mov ebx, [si]
|
||||||
|
|
||||||
mov si, PmodeOffsetLocation
|
mov si, ModeOffsetLocation
|
||||||
mov eax, [si]
|
mov eax, [si]
|
||||||
mov si, CodeSegmentLocation
|
mov si, CodeSegmentLocation
|
||||||
mov edx, [si]
|
mov edx, [si]
|
||||||
@ -149,8 +149,7 @@ ASM_PFX(AsmGetAddressMap):
|
|||||||
mov ebx, [ebp + 24h]
|
mov ebx, [ebp + 24h]
|
||||||
mov dword [ebx], RendezvousFunnelProcStart
|
mov dword [ebx], RendezvousFunnelProcStart
|
||||||
mov dword [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
mov dword [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
|
||||||
mov dword [ebx + 8h], 0
|
mov dword [ebx + 8h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
mov dword [ebx + 0ch], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
@ -32,11 +32,10 @@ ApProcedureLocation equ LockLocation + 18h
|
|||||||
GdtrLocation equ LockLocation + 20h
|
GdtrLocation equ LockLocation + 20h
|
||||||
IdtrLocation equ LockLocation + 2Ah
|
IdtrLocation equ LockLocation + 2Ah
|
||||||
BufferStartLocation equ LockLocation + 34h
|
BufferStartLocation equ LockLocation + 34h
|
||||||
PmodeOffsetLocation equ LockLocation + 3Ch
|
ModeOffsetLocation equ LockLocation + 3Ch
|
||||||
NumApsExecutingLoction equ LockLocation + 44h
|
NumApsExecutingLoction equ LockLocation + 44h
|
||||||
CodeSegmentLocation equ LockLocation + 4Ch
|
CodeSegmentLocation equ LockLocation + 4Ch
|
||||||
DataSegmentLocation equ LockLocation + 54h
|
DataSegmentLocation equ LockLocation + 54h
|
||||||
LmodeOffsetLocation equ LockLocation + 5Ch
|
Cr3Location equ LockLocation + 5Ch
|
||||||
Cr3Location equ LockLocation + 64h
|
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
|
@ -48,7 +48,7 @@ RendezvousFunnelProcStart::
|
|||||||
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
|
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
|
||||||
|
|
||||||
db 0BFh ; opcode of mov di, mem16
|
db 0BFh ; opcode of mov di, mem16
|
||||||
dw LmodeOffsetLocation ; mov di, LmodeOffsetLocation
|
dw ModeOffsetLocation ; mov di, ModeOffsetLocation
|
||||||
db 66h, 8Bh, 05h ; mov eax, [di]
|
db 66h, 8Bh, 05h ; mov eax, [di]
|
||||||
db 0BFh ; opcode of mov di, mem16
|
db 0BFh ; opcode of mov di, mem16
|
||||||
dw CodeSegmentLocation ; mov di, CodeSegmentLocation
|
dw CodeSegmentLocation ; mov di, CodeSegmentLocation
|
||||||
@ -176,9 +176,8 @@ RendezvousFunnelProcEnd::
|
|||||||
AsmGetAddressMap PROC
|
AsmGetAddressMap PROC
|
||||||
mov rax, offset RendezvousFunnelProcStart
|
mov rax, offset RendezvousFunnelProcStart
|
||||||
mov qword ptr [rcx], rax
|
mov qword ptr [rcx], rax
|
||||||
mov qword ptr [rcx + 8h], 0
|
mov qword ptr [rcx + 8h], LongModeStart - RendezvousFunnelProcStart
|
||||||
mov qword ptr [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
|
mov qword ptr [rcx + 10h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
mov qword ptr [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
|
||||||
ret
|
ret
|
||||||
AsmGetAddressMap ENDP
|
AsmGetAddressMap ENDP
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ BITS 16
|
|||||||
mov si, BufferStartLocation
|
mov si, BufferStartLocation
|
||||||
mov ebx, [si]
|
mov ebx, [si]
|
||||||
|
|
||||||
mov di, LmodeOffsetLocation
|
mov di, ModeOffsetLocation
|
||||||
mov eax, [di]
|
mov eax, [di]
|
||||||
mov di, CodeSegmentLocation
|
mov di, CodeSegmentLocation
|
||||||
mov edx, [di]
|
mov edx, [di]
|
||||||
@ -170,9 +170,8 @@ global ASM_PFX(AsmGetAddressMap)
|
|||||||
ASM_PFX(AsmGetAddressMap):
|
ASM_PFX(AsmGetAddressMap):
|
||||||
mov rax, ASM_PFX(RendezvousFunnelProc)
|
mov rax, ASM_PFX(RendezvousFunnelProc)
|
||||||
mov qword [rcx], rax
|
mov qword [rcx], rax
|
||||||
mov qword [rcx + 8h], 0
|
mov qword [rcx + 8h], LongModeStart - RendezvousFunnelProcStart
|
||||||
mov qword [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
|
mov qword [rcx + 10h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
||||||
mov qword [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user