]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/CpuId.c
Removed the usage of an Intel package include.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuId.c
1 /** @file
2 AsmCpuid function.
3
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 //
16 // Include common header file for this module.
17 //
18 #include "CommonHeader.h"
19
20 UINT32
21 EFIAPI
22 AsmCpuid (
23 IN UINT32 Index,
24 OUT UINT32 *RegisterEax, OPTIONAL
25 OUT UINT32 *RegisterEbx, OPTIONAL
26 OUT UINT32 *RegisterEcx, OPTIONAL
27 OUT UINT32 *RegisterEdx OPTIONAL
28 )
29 {
30 _asm {
31 mov eax, Index
32 cpuid
33 push ecx
34 mov ecx, RegisterEax
35 jecxz SkipEax
36 mov [ecx], eax
37 SkipEax:
38 mov ecx, RegisterEbx
39 jecxz SkipEbx
40 mov [ecx], ebx
41 SkipEbx:
42 pop eax
43 mov ecx, RegisterEcx
44 jecxz SkipEcx
45 mov [ecx], eax
46 SkipEcx:
47 mov ecx, RegisterEdx
48 jecxz SkipEdx
49 mov [ecx], edx
50 SkipEdx:
51 mov eax, Index
52 }
53 }
54