]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/CpuIdEx.nasm
MdePkg BaseLib: Convert Ia32/CpuIdEx.asm to NASM
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php.
8 ;
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ; Module Name:
13 ;
14 ; CpuIdEx.Asm
15 ;
16 ; Abstract:
17 ;
18 ; AsmCpuidEx function
19 ;
20 ; Notes:
21 ;
22 ;------------------------------------------------------------------------------
23
24 SECTION .text
25
26 ;------------------------------------------------------------------------------
27 ; UINT32
28 ; EFIAPI
29 ; AsmCpuidEx (
30 ; IN UINT32 RegisterInEax,
31 ; IN UINT32 RegisterInEcx,
32 ; OUT UINT32 *RegisterOutEax OPTIONAL,
33 ; OUT UINT32 *RegisterOutEbx OPTIONAL,
34 ; OUT UINT32 *RegisterOutEcx OPTIONAL,
35 ; OUT UINT32 *RegisterOutEdx OPTIONAL
36 ; )
37 ;------------------------------------------------------------------------------
38 global ASM_PFX(AsmCpuidEx)
39 ASM_PFX(AsmCpuidEx):
40 push ebx
41 push ebp
42 mov ebp, esp
43 mov eax, [ebp + 12]
44 mov ecx, [ebp + 16]
45 cpuid
46 push ecx
47 mov ecx, [ebp + 20]
48 jecxz .0
49 mov [ecx], eax
50 .0:
51 mov ecx, [ebp + 24]
52 jecxz .1
53 mov [ecx], ebx
54 .1:
55 mov ecx, [ebp + 32]
56 jecxz .2
57 mov [ecx], edx
58 .2:
59 mov ecx, [ebp + 28]
60 jecxz .3
61 pop DWORD [ecx]
62 .3:
63 mov eax, [ebp + 12]
64 leave
65 pop ebx
66 ret
67