From 4e6ff16d3aba12205317670d3bf1266a7e165c29 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Mon, 11 Jul 2016 13:08:06 +0800 Subject: UefiCpuPkg/CpuMpPei: Add CodeSegment and DataSegment fields Added CodeSegment and DataSegment fields in MP_CPU_EXCHANGE_INFO. They are set to the values of current BSP's CS and DS. Cc: Feng Tian Cc: Michael Kinney Cc: Giri Mudusuru Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Giri P Mudusuru (cherry picked from commit ed04bffe7517f42f94ec4eebcf9003cd6a9dd6fb) --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 2 ++ UefiCpuPkg/CpuMpPei/CpuMpPei.h | 2 ++ UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc | 4 +++- UefiCpuPkg/CpuMpPei/X64/MpEqu.inc | 8 +++++--- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'UefiCpuPkg') diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index bccff24cc1..9b602a1906 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -455,6 +455,8 @@ WakeUpAP ( ExchangeInfo->PmodeOffset = PeiCpuMpData->AddressMap.PModeEntryOffset; ExchangeInfo->LmodeOffset = PeiCpuMpData->AddressMap.LModeEntryOffset; ExchangeInfo->Cr3 = AsmReadCr3 (); + ExchangeInfo->CodeSegment = AsmReadCs (); + ExchangeInfo->DataSegment = AsmReadDs (); ExchangeInfo->CFunction = (UINTN) ApCFunction; ExchangeInfo->NumApsExecuting = 0; ExchangeInfo->PeiCpuMpData = PeiCpuMpData; diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index 5e56934a27..4c114decb6 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -119,6 +119,8 @@ typedef struct { UINTN BufferStart; UINTN PmodeOffset; UINTN NumApsExecuting; + UINTN CodeSegment; + UINTN DataSegment; UINTN LmodeOffset; UINTN Cr3; PEI_CPU_MP_DATA *PeiCpuMpData; diff --git a/UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc b/UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc index fc637cc70f..a88185ed08 100644 --- a/UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc +++ b/UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc @@ -1,5 +1,5 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2015, Intel Corporation. All rights reserved.
+; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at @@ -37,4 +37,6 @@ IdtrLocation equ LockLocation + 16h BufferStartLocation equ LockLocation + 1Ch PmodeOffsetLocation equ LockLocation + 20h NumApsExecutingLoction equ LockLocation + 24h +CodeSegmentLocation equ LockLocation + 28h +DataSegmentLocation equ LockLocation + 2Ch diff --git a/UefiCpuPkg/CpuMpPei/X64/MpEqu.inc b/UefiCpuPkg/CpuMpPei/X64/MpEqu.inc index ab851cf3e7..30c7f6110b 100644 --- a/UefiCpuPkg/CpuMpPei/X64/MpEqu.inc +++ b/UefiCpuPkg/CpuMpPei/X64/MpEqu.inc @@ -1,5 +1,5 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2015, Intel Corporation. All rights reserved.
+; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at @@ -39,7 +39,9 @@ IdtrLocation equ LockLocation + 2Ah BufferStartLocation equ LockLocation + 34h PmodeOffsetLocation equ LockLocation + 3Ch NumApsExecutingLoction equ LockLocation + 44h -LmodeOffsetLocation equ LockLocation + 4Ch -Cr3Location equ LockLocation + 54h +CodeSegmentLocation equ LockLocation + 4Ch +DataSegmentLocation equ LockLocation + 54h +LmodeOffsetLocation equ LockLocation + 5Ch +Cr3Location equ LockLocation + 64h ;------------------------------------------------------------------------------- -- cgit v1.2.3