]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.asm
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / CpuId.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; CpuId.Asm\r
13;\r
14; Abstract:\r
15;\r
16; AsmCpuid function\r
17;\r
18; Notes:\r
19;\r
20;------------------------------------------------------------------------------\r
21\r
22 .586P\r
23 .model flat,C\r
24 .code\r
25\r
26;------------------------------------------------------------------------------\r
27; VOID\r
28; EFIAPI\r
29; AsmCpuid (\r
30; IN UINT32 RegisterInEax,\r
31; OUT UINT32 *RegisterOutEax OPTIONAL,\r
32; OUT UINT32 *RegisterOutEbx OPTIONAL,\r
33; OUT UINT32 *RegisterOutEcx OPTIONAL,\r
34; OUT UINT32 *RegisterOutEdx OPTIONAL\r
35; );\r
36;------------------------------------------------------------------------------\r
37AsmCpuid PROC USES ebx\r
38 push ebp\r
39 mov ebp, esp\r
40 mov eax, [ebp + 12]\r
41 cpuid\r
42 push ecx\r
43 mov ecx, [ebp + 16]\r
44 jecxz @F\r
45 mov [ecx], eax\r
46@@:\r
47 mov ecx, [ebp + 20]\r
48 jecxz @F\r
49 mov [ecx], ebx\r
50@@:\r
51 mov ecx, [ebp + 24]\r
52 jecxz @F\r
53 pop [ecx]\r
54@@:\r
55 mov ecx, [ebp + 28]\r
56 jecxz @F\r
57 mov [ecx], edx\r
58@@:\r
59 mov eax, [ebp + 12]\r
60 leave\r
61 ret\r
62AsmCpuid ENDP\r
63\r
64 END\r