]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X64/CpuIdEx.asm
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / CpuIdEx.asm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php
8 ;
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ; Module Name:
13 ;
14 ; CpuIdEx.Asm
15 ;
16 ; Abstract:
17 ;
18 ; AsmCpuidEx function
19 ;
20 ; Notes:
21 ;
22 ;------------------------------------------------------------------------------
23
24 .code
25
26 ;------------------------------------------------------------------------------
27 ; UINT32
28 ; EFIAPI
29 ; AsmCpuidEx (
30 ; IN UINT32 RegisterInEax,
31 ; IN UINT32 RegisterInEcx,
32 ; OUT UINT32 *RegisterOutEax OPTIONAL,
33 ; OUT UINT32 *RegisterOutEbx OPTIONAL,
34 ; OUT UINT32 *RegisterOutEcx OPTIONAL,
35 ; OUT UINT32 *RegisterOutEdx OPTIONAL
36 ; )
37 ;------------------------------------------------------------------------------
38 AsmCpuidEx PROC USES rbx
39 mov eax, ecx
40 mov ecx, edx
41 push rax ; save Index on stack
42 cpuid
43 mov r10, [rsp + 38h]
44 test r10, r10
45 jz @F
46 mov [r10], ecx
47 @@:
48 mov rcx, r8
49 jrcxz @F
50 mov [rcx], eax
51 @@:
52 mov rcx, r9
53 jrcxz @F
54 mov [rcx], ebx
55 @@:
56 mov rcx, [rsp + 40h]
57 jrcxz @F
58 mov [rcx], edx
59 @@:
60 pop rax ; restore Index to rax as return value
61 ret
62 AsmCpuidEx ENDP
63
64 END