]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S
edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/(Ia32|X64...
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / CpuIdEx.S
CommitLineData
3f8f7fa5 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
8ad319e5 24#include <EdkIIGlueBase.h>
25
3f8f7fa5 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)
42ASM_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)
53L1:
54 movl 24(%ebp), %ecx
55 jecxz L2
56 movl %ebx, (%ecx)
57L2:
58 movl 28(%ebp), %ecx
59 jecxz L3
60 popl (%ecx)
61L3:
62 movl 32(%ebp), %edx
63 jecxz L4
64 movl %edx, (%ecx)
65L4:
66 movl 12(%ebp), %eax
67 leave
68 pop %ebx
69 ret