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:
Jeff Fan 2016-07-12 08:49:33 +08:00
parent 6d98a37159
commit 01beffa7e9
8 changed files with 17 additions and 25 deletions

View File

@ -428,8 +428,7 @@ WakeUpAP (
ExchangeInfo->StackStart = PeiCpuMpData->Buffer;
ExchangeInfo->StackSize = PeiCpuMpData->CpuApStackSize;
ExchangeInfo->BufferStart = PeiCpuMpData->WakeupBuffer;
ExchangeInfo->PmodeOffset = PeiCpuMpData->AddressMap.PModeEntryOffset;
ExchangeInfo->LmodeOffset = PeiCpuMpData->AddressMap.LModeEntryOffset;
ExchangeInfo->ModeOffset = PeiCpuMpData->AddressMap.ModeEntryOffset;
ExchangeInfo->Cr3 = AsmReadCr3 ();
ExchangeInfo->CodeSegment = AsmReadCs ();
ExchangeInfo->DataSegment = AsmReadDs ();

View File

@ -66,8 +66,7 @@ typedef enum {
//
typedef struct {
UINT8 *RendezvousFunnelAddress;
UINTN PModeEntryOffset;
UINTN LModeEntryOffset;
UINTN ModeEntryOffset;
UINTN RendezvousFunnelSize;
} MP_ASSEMBLY_ADDRESS_MAP;
@ -98,11 +97,10 @@ typedef struct {
IA32_DESCRIPTOR GdtrProfile;
IA32_DESCRIPTOR IdtrProfile;
UINTN BufferStart;
UINTN PmodeOffset;
UINTN ModeOffset;
UINTN NumApsExecuting;
UINTN CodeSegment;
UINTN DataSegment;
UINTN LmodeOffset;
UINTN Cr3;
PEI_CPU_MP_DATA *PeiCpuMpData;
} MP_CPU_EXCHANGE_INFO;

View File

@ -32,7 +32,7 @@ ApProcedureLocation equ LockLocation + 0Ch
GdtrLocation equ LockLocation + 10h
IdtrLocation equ LockLocation + 16h
BufferStartLocation equ LockLocation + 1Ch
PmodeOffsetLocation equ LockLocation + 20h
ModeOffsetLocation equ LockLocation + 20h
NumApsExecutingLoction equ LockLocation + 24h
CodeSegmentLocation equ LockLocation + 28h
DataSegmentLocation equ LockLocation + 2Ch

View File

@ -52,7 +52,7 @@ RendezvousFunnelProcStart::
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
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 0BEh ; opcode of mov si, mem16
dw CodeSegmentLocation ; mov si, CodeSegmentLocation
@ -161,9 +161,8 @@ AsmGetAddressMap PROC near C PUBLIC
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
mov dword ptr [ebx + 4h], Flat32Start - RendezvousFunnelProcStart
mov dword ptr [ebx + 8h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
popad
ret

View File

@ -48,7 +48,7 @@ BITS 16
mov si, BufferStartLocation
mov ebx, [si]
mov si, PmodeOffsetLocation
mov si, ModeOffsetLocation
mov eax, [si]
mov si, CodeSegmentLocation
mov edx, [si]
@ -149,8 +149,7 @@ ASM_PFX(AsmGetAddressMap):
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
mov dword [ebx + 8h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
popad
ret

View File

@ -32,11 +32,10 @@ ApProcedureLocation equ LockLocation + 18h
GdtrLocation equ LockLocation + 20h
IdtrLocation equ LockLocation + 2Ah
BufferStartLocation equ LockLocation + 34h
PmodeOffsetLocation equ LockLocation + 3Ch
ModeOffsetLocation equ LockLocation + 3Ch
NumApsExecutingLoction equ LockLocation + 44h
CodeSegmentLocation equ LockLocation + 4Ch
DataSegmentLocation equ LockLocation + 54h
LmodeOffsetLocation equ LockLocation + 5Ch
Cr3Location equ LockLocation + 64h
Cr3Location equ LockLocation + 5Ch
;-------------------------------------------------------------------------------

View File

@ -48,7 +48,7 @@ RendezvousFunnelProcStart::
db 66h, 8Bh, 1Ch ; mov ebx, dword ptr [si]
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 0BFh ; opcode of mov di, mem16
dw CodeSegmentLocation ; mov di, CodeSegmentLocation
@ -176,9 +176,8 @@ RendezvousFunnelProcEnd::
AsmGetAddressMap PROC
mov rax, offset RendezvousFunnelProcStart
mov qword ptr [rcx], rax
mov qword ptr [rcx + 8h], 0
mov qword ptr [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
mov qword ptr [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
mov qword ptr [rcx + 8h], LongModeStart - RendezvousFunnelProcStart
mov qword ptr [rcx + 10h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
ret
AsmGetAddressMap ENDP

View File

@ -52,7 +52,7 @@ BITS 16
mov si, BufferStartLocation
mov ebx, [si]
mov di, LmodeOffsetLocation
mov di, ModeOffsetLocation
mov eax, [di]
mov di, CodeSegmentLocation
mov edx, [di]
@ -170,9 +170,8 @@ global ASM_PFX(AsmGetAddressMap)
ASM_PFX(AsmGetAddressMap):
mov rax, ASM_PFX(RendezvousFunnelProc)
mov qword [rcx], rax
mov qword [rcx + 8h], 0
mov qword [rcx + 10h], LongModeStart - RendezvousFunnelProcStart
mov qword [rcx + 18h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
mov qword [rcx + 8h], LongModeStart - RendezvousFunnelProcStart
mov qword [rcx + 10h], RendezvousFunnelProcEnd - RendezvousFunnelProcStart
ret
;-------------------------------------------------------------------------------------