summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2012-07-02 10:38:24 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2012-07-02 10:38:24 +0000
commit6d896ff1cb89aa29830a6da0678a10d777f13021 (patch)
tree88b8b70c51343792f0ab5e7f471354e901068a3b /EdkCompatibilityPkg/Compatibility
parentf9b843ec49b141ec83bcd79b0803923299059888 (diff)
EdkCompatibilityPkg MpServicesOnFrameworkMpServicesThunk: Update .S files to be consistent with corresponding .asm files.
Signed-off-by: Sun Rui <rui.sun@intel.com> Reviewed-by: Tian Feng <feng.tian@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13481 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r--EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S16
-rw-r--r--EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S14
2 files changed, 25 insertions, 5 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S
index 6fd2c1d8f..84fd47329 100644
--- a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S
+++ b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
# IA32 assembly file for AP startup vector.
#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
# 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
@@ -100,11 +100,21 @@ ProtectedModeStart: # protected mode entry point
#
movl $0x1b, %ecx
rdmsr
+
+ btl $10, %eax # Check for x2apic mode
+ jnc LegacyApicMode
+ movl $0x802, %ecx # Read APIC_ID
+ rdmsr
+ movl %eax, %ebx # ebx == apicid
+ jmp GetCpuNumber
+
+LegacyApicMode:
andl $0xfffff000, %eax
addl $0x20, %eax
movl (%eax), %ebx
- shrl $24, %ebx
-
+ shrl $24, %ebx # ebx == apicid
+
+GetCpuNumber:
xorl %ecx, %ecx
movl %esi,%edi
addl $ProcessorNumber, %edi
diff --git a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S
index 6ea0f3e69..9585d3224 100644
--- a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S
+++ b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
# X64 assembly file for AP startup vector.
#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
# 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
@@ -134,11 +134,21 @@ LongModeStart:
#
movl $0x1b, %ecx
rdmsr
+
+ btl $10, %eax # Check for x2apic mode
+ jnc LegacyApicMode
+ movl $0x802, %ecx # Read APIC_ID
+ rdmsr
+ movl %eax, %ebx # ebx == apicid
+ jmp GetCpuNumber
+
+LegacyApicMode:
andl $0xfffff000, %eax
addl $0x20, %eax
movl (%eax), %ebx
- shrl $24, %ebx
+ shrl $24, %ebx # ebx == apicid
+GetCpuNumber:
xorq %rcx, %rcx
movl %esi,%edi
addl $ProcessorNumberLocation, %edi