]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/CpuId.s
Fixes for GCC.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuId.s
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006, Intel Corporation
4 # All rights reserved. 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 # CpuId.Asm
15 #
16 # Abstract:
17 #
18 # AsmCpuid function
19 #
20 # Notes:
21 #
22 #------------------------------------------------------------------------------
23
24
25
26
27 #------------------------------------------------------------------------------
28 # VOID
29 # EFIAPI
30 # AsmCpuid (
31 # IN UINT32 RegisterInEax,
32 # OUT UINT32 *RegisterOutEax OPTIONAL,
33 # OUT UINT32 *RegisterOutEbx OPTIONAL,
34 # OUT UINT32 *RegisterOutEcx OPTIONAL,
35 # OUT UINT32 *RegisterOutEdx OPTIONAL
36 # )
37 #------------------------------------------------------------------------------
38 .globl _AsmCpuid
39 _AsmCpuid:
40 push %ebx
41 push %edi
42 movl 12(%esp),%eax
43 cpuid
44 movl %ecx,%edi
45 movl 16(%esp),%ecx
46 jecxz L1
47 movl %eax,(%ecx)
48 L1:
49 movl 20(%esp),%ecx
50 jecxz L2
51 movl %ebx,(%ecx)
52 L2:
53 movl 24(%esp),%ecx
54 jecxz L3
55 movl %edi,(%ecx)
56 L3:
57 movl 28(%esp),%ecx
58 jecxz L4
59 movl %edx,(%ecx)
60 L4:
61 pop %edi
62 pop %ebx
63 ret