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