]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/CpuIdEx.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / CpuIdEx.nasm
CommitLineData
c7f75a99
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
c7f75a99
JJ
5;\r
6; Module Name:\r
7;\r
8; CpuIdEx.Asm\r
9;\r
10; Abstract:\r
11;\r
12; AsmCpuidEx function\r
13;\r
14; Notes:\r
15;\r
16;------------------------------------------------------------------------------\r
17\r
18 SECTION .text\r
19\r
20;------------------------------------------------------------------------------\r
21; UINT32\r
22; EFIAPI\r
23; AsmCpuidEx (\r
24; IN UINT32 RegisterInEax,\r
25; IN UINT32 RegisterInEcx,\r
26; OUT UINT32 *RegisterOutEax OPTIONAL,\r
27; OUT UINT32 *RegisterOutEbx OPTIONAL,\r
28; OUT UINT32 *RegisterOutEcx OPTIONAL,\r
29; OUT UINT32 *RegisterOutEdx OPTIONAL\r
30; )\r
31;------------------------------------------------------------------------------\r
32global ASM_PFX(AsmCpuidEx)\r
33ASM_PFX(AsmCpuidEx):\r
34 push ebx\r
35 push ebp\r
36 mov ebp, esp\r
37 mov eax, [ebp + 12]\r
38 mov ecx, [ebp + 16]\r
39 cpuid\r
40 push ecx\r
41 mov ecx, [ebp + 20]\r
42 jecxz .0\r
43 mov [ecx], eax\r
44.0:\r
45 mov ecx, [ebp + 24]\r
46 jecxz .1\r
47 mov [ecx], ebx\r
48.1:\r
49 mov ecx, [ebp + 32]\r
50 jecxz .2\r
51 mov [ecx], edx\r
52.2:\r
53 mov ecx, [ebp + 28]\r
54 jecxz .3\r
55 pop DWORD [ecx]\r
56.3:\r
57 mov eax, [ebp + 12]\r
58 leave\r
59 pop ebx\r
60 ret\r
61\r