]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/X64/MpFuncs.S
EdkCompatibilityPkg MpServicesOnFrameworkMpServicesThunk: Update .S files to be consi...
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / MpServicesOnFrameworkMpServicesThunk / X64 / MpFuncs.S
index 6ea0f3e690fb2342ca1ea72e93353194e377e647..9585d322413559f0efc919655288deda9702d43a 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------\r
 # X64 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
@@ -134,11 +134,21 @@ LongModeStart:
         #\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
+        shrl        $24, %ebx         # ebx == apicid\r
         \r
+GetCpuNumber:        \r
         xorq        %rcx, %rcx\r
         movl        %esi,%edi\r
         addl        $ProcessorNumberLocation, %edi\r