Fixes for gcc assembly.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.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 # CpuIdEx.Asm
15 #
16 # Abstract:
17 #
18 # AsmCpuidEx function
19 #
20 # Notes:
21 #
22 #------------------------------------------------------------------------------
23
24 .686:
25 .code:
26
27 #------------------------------------------------------------------------------
28 # UINT32
29 # EFIAPI
30 # AsmCpuidEx (
31 # IN UINT32 RegisterInEax,
32 # IN UINT32 RegisterInEcx,
33 # OUT UINT32 *RegisterOutEax OPTIONAL,
34 # OUT UINT32 *RegisterOutEbx OPTIONAL,
35 # OUT UINT32 *RegisterOutEcx OPTIONAL,
36 # OUT UINT32 *RegisterOutEdx OPTIONAL
37 # )
38 #------------------------------------------------------------------------------
39 .globl _AsmCpuidEx
40 _AsmCpuidEx:
41 push %ebx
42 pushl %ebp
43 movl %esp, %ebp
44 movl 12(%ebp), %eax
45 movl 16(%ebp), %ecx
46 cpuid
47 pushl %ecx
48 movl 20(%ebp), %ecx
49 jecxz L1
50 movl %eax, (%ecx)
51 L1:
52 movl 24(%ebp), %ecx
53 jecxz L2
54 movl %ebx, (%ecx)
55 L2:
56 movl 28(%ebp), %ecx
57 jecxz L3
58 popl %ecx
59 L3:
60 movl 32(%ebp), %edx
61 jecxz L4
62 movl %edx, (%ecx)
63 L4:
64 movl 12(%ebp), %eax
65 pop %ebx
66 leave
67 ret