summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-25 03:02:26 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-25 03:02:26 +0000
commitde74f0c2860b839b4a11a1ba13f28b643a2ff29b (patch)
tree6b9ed367db8dfa406c98a3f81b5bce4d5e7e57cf /MdePkg
parenta974619978dff4528e810f74fb736cb474db65c1 (diff)
downloadedk2-platforms-de74f0c2860b839b4a11a1ba13f28b643a2ff29b.tar.xz
Correct a bug in AsmCpuidEx() to return correct ECX and EDX.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13359 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuIdEx.S10
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm10
2 files changed, 10 insertions, 10 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
index 80fb510798..67b54926d6 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
+++ b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 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
@@ -53,13 +53,13 @@ L1:
jecxz L2
movl %ebx, (%ecx)
L2:
- movl 28(%ebp), %ecx
+ movl 32(%ebp), %ecx
jecxz L3
- popl (%ecx)
+ movl %edx, (%ecx)
L3:
- movl 32(%ebp), %edx
+ movl 28(%ebp), %ecx
jecxz L4
- movl %edx, (%ecx)
+ popl (%ecx)
L4:
movl 12(%ebp), %eax
leave
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
index 879dd76ba2..4e54d0c360 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
+++ b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 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
@@ -52,13 +52,13 @@ AsmCpuidEx PROC USES ebx
jecxz @F
mov [ecx], ebx
@@:
- mov ecx, [ebp + 28]
+ mov ecx, [ebp + 32]
jecxz @F
- pop [ecx]
+ mov [ecx], edx
@@:
- mov edx, [ebp + 32]
+ mov edx, [ebp + 28]
jecxz @F
- mov [ecx], edx
+ pop [ecx]
@@:
mov eax, [ebp + 12]
leave