]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OldMdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Library / BaseLib / Ia32 / CpuIdEx.asm
diff --git a/OldMdePkg/Library/BaseLib/Ia32/CpuIdEx.asm b/OldMdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
new file mode 100644 (file)
index 0000000..cdebec2
--- /dev/null
@@ -0,0 +1,68 @@
+;------------------------------------------------------------------------------
+;
+; Copyright (c) 2006, 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
+; http://opensource.org/licenses/bsd-license.php
+;
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+; Module Name:
+;
+;   CpuIdEx.Asm\r
+;
+; Abstract:
+;
+;   AsmCpuidEx function\r
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+    .686\r
+    .model  flat,C\r
+    .code
+
+;------------------------------------------------------------------------------
+;  UINT32
+;  EFIAPI
+;  AsmCpuidEx (\r
+;    IN   UINT32  RegisterInEax,
+;    IN   UINT32  RegisterInEcx,
+;    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+;    )
+;------------------------------------------------------------------------------
+AsmCpuidEx  PROC    USES    ebx\r
+    push    ebp\r
+    mov     ebp, esp\r
+    mov     eax, [ebp + 12]\r
+    mov     ecx, [ebp + 16]\r
+    cpuid\r
+    push    ecx\r
+    mov     ecx, [ebp + 20]\r
+    jecxz   @F\r
+    mov     [ecx], eax\r
+@@:\r
+    mov     ecx, [ebp + 24]\r
+    jecxz   @F\r
+    mov     [ecx], ebx\r
+@@:\r
+    mov     ecx, [ebp + 28]\r
+    jecxz   @F\r
+    pop     [ecx]\r
+@@:\r
+    mov     edx, [ebp + 32]\r
+    jecxz   @F\r
+    mov     [ecx], edx\r
+@@:\r
+    mov     eax, [ebp + 12]\r
+    leave\r
+    ret\r
+AsmCpuidEx  ENDP\r
+
+    END