]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / CpuIdEx.asm
1 ; Copyright (c) 2004, Intel Corporation
2 ; All rights reserved. This program and the accompanying materials
3 ; are licensed and made available under the terms and conditions of the BSD License
4 ; which accompanies this distribution. The full text of the license may be found at
5 ; http://opensource.org/licenses/bsd-license.php
6 ;
7 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
9 ;
10 ; Module Name:
11 ;
12 ; CpuIdEx.Asm
13 ;
14 ; Abstract:
15 ;
16 ; AsmCpuidEx function
17 ;
18 ; Notes:
19 ;
20 ;------------------------------------------------------------------------------
21
22 .686
23 .model flat,C
24 .code
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 AsmCpuidEx PROC USES ebx
39 push ebp
40 mov ebp, esp
41 mov eax, [ebp + 12]
42 mov ecx, [ebp + 16]
43 cpuid
44 push ecx
45 mov ecx, [ebp + 20]
46 jecxz @F
47 mov [ecx], eax
48 @@:
49 mov ecx, [ebp + 24]
50 jecxz @F
51 mov [ecx], ebx
52 @@:
53 mov ecx, [ebp + 28]
54 jecxz @F
55 pop [ecx]
56 @@:
57 mov edx, [ebp + 32]
58 jecxz @F
59 mov [ecx], edx
60 @@:
61 mov eax, [ebp + 12]
62 leave
63 ret
64 AsmCpuidEx ENDP
65
66 END