]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
Import some basic libraries instances for Mde Packages.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.S
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
5
6 #------------------------------------------------------------------------------
7 #
8 # Copyright (c) 2006, Intel Corporation
9 # All rights reserved. This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #
17 # Module Name:
18 #
19 # CpuIdEx.Asm
20 #
21 # Abstract:
22 #
23 # AsmCpuidEx function
24 #
25 # Notes:
26 #
27 #------------------------------------------------------------------------------
28
29 .686:
30 .code:
31
32 #------------------------------------------------------------------------------
33 # UINT32
34 # EFIAPI
35 # AsmCpuidEx (
36 # IN UINT32 RegisterInEax,
37 # IN UINT32 RegisterInEcx,
38 # OUT UINT32 *RegisterOutEax OPTIONAL,
39 # OUT UINT32 *RegisterOutEbx OPTIONAL,
40 # OUT UINT32 *RegisterOutEcx OPTIONAL,
41 # OUT UINT32 *RegisterOutEdx OPTIONAL
42 # )
43 #------------------------------------------------------------------------------
44 .globl ASM_PFX(AsmCpuidEx)
45 ASM_PFX(AsmCpuidEx):
46 push %ebx
47 push %ebp
48 movl %esp, %ebp
49 movl 12(%ebp), %eax
50 movl 16(%ebp), %ecx
51 cpuid
52 push %ecx
53 movl 20(%ebp), %ecx
54 jecxz L1
55 movl %eax, (%ecx)
56 L1:
57 movl 24(%ebp), %ecx
58 jecxz L2
59 movl %ebx, (%ecx)
60 L2:
61 movl 28(%ebp), %ecx
62 jecxz L3
63 popl (%ecx)
64 L3:
65 movl 32(%ebp), %edx
66 jecxz L4
67 movl %edx, (%ecx)
68 L4:
69 movl 12(%ebp), %eax
70 leave
71 pop %ebx
72 ret