]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S
dcc6c64d30d3d84f3a152f05ab425ef451e19486
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / CpuIdEx.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006, 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 #include <EdkIIGlueBase.h>
25
26 .686:
27 .code:
28
29 #------------------------------------------------------------------------------
30 # UINT32
31 # EFIAPI
32 # AsmCpuidEx (
33 # IN UINT32 RegisterInEax,
34 # IN UINT32 RegisterInEcx,
35 # OUT UINT32 *RegisterOutEax OPTIONAL,
36 # OUT UINT32 *RegisterOutEbx OPTIONAL,
37 # OUT UINT32 *RegisterOutEcx OPTIONAL,
38 # OUT UINT32 *RegisterOutEdx OPTIONAL
39 # )
40 #------------------------------------------------------------------------------
41 .globl ASM_PFX(AsmCpuidEx)
42 ASM_PFX(AsmCpuidEx):
43 push %ebx
44 push %ebp
45 movl %esp, %ebp
46 movl 12(%ebp), %eax
47 movl 16(%ebp), %ecx
48 cpuid
49 push %ecx
50 movl 20(%ebp), %ecx
51 jecxz L1
52 movl %eax, (%ecx)
53 L1:
54 movl 24(%ebp), %ecx
55 jecxz L2
56 movl %ebx, (%ecx)
57 L2:
58 movl 28(%ebp), %ecx
59 jecxz L3
60 popl (%ecx)
61 L3:
62 movl 32(%ebp), %edx
63 jecxz L4
64 movl %edx, (%ecx)
65 L4:
66 movl 12(%ebp), %eax
67 leave
68 pop %ebx
69 ret