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