]>
Commit | Line | Data |
---|---|---|
3357f083 JJ |
1 | ;------------------------------------------------------------------------------\r |
2 | ;\r | |
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r | |
9344f092 | 4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3357f083 JJ |
5 | ;\r |
6 | ; Module Name:\r | |
7 | ;\r | |
8 | ; CpuId.Asm\r | |
9 | ;\r | |
10 | ; Abstract:\r | |
11 | ;\r | |
12 | ; AsmCpuid function\r | |
13 | ;\r | |
14 | ; Notes:\r | |
15 | ;\r | |
16 | ;------------------------------------------------------------------------------\r | |
17 | \r | |
18 | SECTION .text\r | |
19 | \r | |
20 | ;------------------------------------------------------------------------------\r | |
21 | ; VOID\r | |
22 | ; EFIAPI\r | |
23 | ; AsmCpuid (\r | |
24 | ; IN UINT32 RegisterInEax,\r | |
25 | ; OUT UINT32 *RegisterOutEax OPTIONAL,\r | |
26 | ; OUT UINT32 *RegisterOutEbx OPTIONAL,\r | |
27 | ; OUT UINT32 *RegisterOutEcx OPTIONAL,\r | |
28 | ; OUT UINT32 *RegisterOutEdx OPTIONAL\r | |
29 | ; );\r | |
30 | ;------------------------------------------------------------------------------\r | |
31 | global ASM_PFX(AsmCpuid)\r | |
32 | ASM_PFX(AsmCpuid):\r | |
33 | push ebx\r | |
34 | push ebp\r | |
35 | mov ebp, esp\r | |
36 | mov eax, [ebp + 12]\r | |
37 | cpuid\r | |
38 | push ecx\r | |
39 | mov ecx, [ebp + 16]\r | |
40 | jecxz .0\r | |
41 | mov [ecx], eax\r | |
42 | .0:\r | |
43 | mov ecx, [ebp + 20]\r | |
44 | jecxz .1\r | |
45 | mov [ecx], ebx\r | |
46 | .1:\r | |
47 | mov ecx, [ebp + 24]\r | |
48 | jecxz .2\r | |
49 | pop DWORD [ecx]\r | |
50 | .2:\r | |
51 | mov ecx, [ebp + 28]\r | |
52 | jecxz .3\r | |
53 | mov [ecx], edx\r | |
54 | .3:\r | |
55 | mov eax, [ebp + 12]\r | |
56 | leave\r | |
57 | pop ebx\r | |
58 | ret\r | |
59 | \r |