]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
Removed the usage of an Intel package include.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.c
1 /** @file
2 AsmCpuidEx 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 AsmCpuidEx (
23 IN UINT32 Index,
24 IN UINT32 SubIndex,
25 OUT UINT32 *RegisterEax, OPTIONAL
26 OUT UINT32 *RegisterEbx, OPTIONAL
27 OUT UINT32 *RegisterEcx, OPTIONAL
28 OUT UINT32 *RegisterEdx OPTIONAL
29 )
30 {
31 _asm {
32 mov eax, Index
33 mov ecx, SubIndex
34 cpuid
35 push ecx
36 mov ecx, RegisterEax
37 jecxz SkipEax
38 mov [ecx], eax
39 SkipEax:
40 mov ecx, RegisterEbx
41 jecxz SkipEbx
42 mov [ecx], ebx
43 SkipEbx:
44 pop eax
45 mov ecx, RegisterEcx
46 jecxz SkipEcx
47 mov [ecx], eax
48 SkipEcx:
49 mov ecx, RegisterEdx
50 jecxz SkipEdx
51 mov [ecx], edx
52 SkipEdx:
53 mov eax, Index
54 }
55 }