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