]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / CpuIdEx.asm
CommitLineData
3eb9473e 1; Copyright (c) 2004, Intel Corporation \r
2; All rights reserved. This program and the accompanying materials \r
3; are licensed and made available under the terms and conditions of the BSD License \r
4; which accompanies this distribution. The full text of the license may be found at \r
5; http://opensource.org/licenses/bsd-license.php \r
6; \r
7; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
8; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
9;\r
10; Module Name:\r
11;\r
12; CpuIdEx.Asm\r
13;\r
14; Abstract:\r
15;\r
16; AsmCpuidEx function\r
17;\r
18; Notes:\r
19;\r
20;------------------------------------------------------------------------------\r
21\r
22 .686\r
23 .model flat,C\r
24 .code\r
25\r
26;------------------------------------------------------------------------------\r
27; UINT32\r
28; EFIAPI\r
29; AsmCpuidEx (\r
30; IN UINT32 RegisterInEax,\r
31; IN UINT32 RegisterInEcx,\r
32; OUT UINT32 *RegisterOutEax OPTIONAL,\r
33; OUT UINT32 *RegisterOutEbx OPTIONAL,\r
34; OUT UINT32 *RegisterOutEcx OPTIONAL,\r
35; OUT UINT32 *RegisterOutEdx OPTIONAL\r
36; )\r
37;------------------------------------------------------------------------------\r
38AsmCpuidEx PROC USES ebx\r
39 push ebp\r
40 mov ebp, esp\r
41 mov eax, [ebp + 12]\r
42 mov ecx, [ebp + 16]\r
43 cpuid\r
44 push ecx\r
45 mov ecx, [ebp + 20]\r
46 jecxz @F\r
47 mov [ecx], eax\r
48@@:\r
49 mov ecx, [ebp + 24]\r
50 jecxz @F\r
51 mov [ecx], ebx\r
52@@:\r
53 mov ecx, [ebp + 28]\r
54 jecxz @F\r
55 pop [ecx]\r
56@@:\r
57 mov edx, [ebp + 32]\r
58 jecxz @F\r
59 mov [ecx], edx\r
60@@:\r
61 mov eax, [ebp + 12]\r
62 leave\r
63 ret\r
64AsmCpuidEx ENDP\r
65\r
66 END\r