]>
Commit | Line | Data |
---|---|---|
32ed92de | 1 | ;------------------------------------------------------------------------------\r |
2 | ;\r | |
bb817c56 HT |
3 | ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
4 | ; This program and the accompanying materials\r | |
32ed92de | 5 | ; are licensed and made available under the terms and conditions of the BSD License\r |
6 | ; which accompanies this distribution. The full text of the license may be found at\r | |
2fc59a00 | 7 | ; http://opensource.org/licenses/bsd-license.php.\r |
32ed92de | 8 | ;\r |
9 | ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | ;\r | |
12 | ; Module Name:\r | |
13 | ;\r | |
14 | ; CpuIdEx.Asm\r | |
15 | ;\r | |
16 | ; Abstract:\r | |
17 | ;\r | |
18 | ; AsmCpuidEx function\r | |
19 | ;\r | |
20 | ; Notes:\r | |
21 | ;\r | |
22 | ;------------------------------------------------------------------------------\r | |
23 | \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 | |
38 | AsmCpuidEx PROC USES rbx\r | |
39 | mov eax, ecx\r | |
40 | mov ecx, edx\r | |
41 | push rax ; save Index on stack\r | |
42 | cpuid\r | |
43 | mov r10, [rsp + 38h]\r | |
44 | test r10, r10\r | |
45 | jz @F\r | |
46 | mov [r10], ecx\r | |
47 | @@:\r | |
48 | mov rcx, r8\r | |
49 | jrcxz @F\r | |
50 | mov [rcx], eax\r | |
51 | @@:\r | |
52 | mov rcx, r9\r | |
53 | jrcxz @F\r | |
54 | mov [rcx], ebx\r | |
55 | @@:\r | |
56 | mov rcx, [rsp + 40h]\r | |
57 | jrcxz @F\r | |
58 | mov [rcx], edx\r | |
59 | @@:\r | |
60 | pop rax ; restore Index to rax as return value\r | |
61 | ret\r | |
62 | AsmCpuidEx ENDP\r | |
63 | \r | |
64 | END\r |