]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/CpuIdEx.asm
1. Add Assert in SetJump.S
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.asm
CommitLineData
dee4740a 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\r
15;
16; Abstract:
17;
18; AsmCpuidEx function\r
19;
20; Notes:
21;
22;------------------------------------------------------------------------------
23
24 .686\r
25 .model flat,C\r
26 .code
27
28;------------------------------------------------------------------------------
29; UINT32
30; EFIAPI
31; AsmCpuidEx (\r
32; IN UINT32 RegisterInEax,
33; IN UINT32 RegisterInEcx,
34; OUT UINT32 *RegisterOutEax OPTIONAL,
35; OUT UINT32 *RegisterOutEbx OPTIONAL,
36; OUT UINT32 *RegisterOutEcx OPTIONAL,
37; OUT UINT32 *RegisterOutEdx OPTIONAL
38; )
39;------------------------------------------------------------------------------
40AsmCpuidEx PROC USES ebx\r
41 push ebp\r
42 mov ebp, esp\r
43 mov eax, [ebp + 12]\r
44 mov ecx, [ebp + 16]\r
45 cpuid\r
46 push ecx\r
47 mov ecx, [ebp + 20]\r
48 jecxz @F\r
49 mov [ecx], eax\r
50@@:\r
51 mov ecx, [ebp + 24]\r
52 jecxz @F\r
53 mov [ecx], ebx\r
54@@:\r
55 mov ecx, [ebp + 28]\r
56 jecxz @F\r
57 pop [ecx]\r
58@@:\r
59 mov edx, [ebp + 32]\r
60 jecxz @F\r
61 mov [ecx], edx\r
62@@:\r
63 mov eax, [ebp + 12]\r
64 leave\r
65 ret\r
66AsmCpuidEx ENDP\r
67
68 END