]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/IA32/MpFuncs.S
EdkCompatibilityPkg MpServicesOnFrameworkMpServicesThunk: Update .S files to be consi...
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / MpServicesOnFrameworkMpServicesThunk / IA32 / MpFuncs.S
index 6fd2c1d8f2ef7011c43cb8dbf68512f2fcca240e..84fd4732922d09d1d5f78628733386556a8a7d47 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------\r
 # IA32 assembly file for AP startup vector.\r
 #\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -100,11 +100,21 @@ ProtectedModeStart:                   # protected mode entry point
         #\r
         movl        $0x1b, %ecx\r
         rdmsr\r
+\r
+        btl         $10, %eax         # Check for x2apic mode\r
+        jnc         LegacyApicMode\r
+        movl        $0x802, %ecx      # Read APIC_ID\r
+        rdmsr\r
+        movl        %eax, %ebx        # ebx == apicid\r
+        jmp         GetCpuNumber\r
+\r
+LegacyApicMode:\r
         andl        $0xfffff000, %eax\r
         addl        $0x20, %eax\r
         movl        (%eax), %ebx\r
-        shrl        $24, %ebx\r
-        \r
+        shrl        $24, %ebx         # ebx == apicid\r
+\r
+GetCpuNumber:        \r
         xorl        %ecx, %ecx\r
         movl        %esi,%edi\r
         addl        $ProcessorNumber, %edi\r