]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.S
As ECP package is EDKI style, the AutoGen.h will not include anything. So if we use...
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / X64 / CpuIdEx.S
CommitLineData
3f8f7fa5 1#------------------------------------------------------------------------------
2#
3# Copyright (c) 2006, Intel Corporation
4# All rights reserved. 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#------------------------------------------------------------------------------
b27af9d2 23#include <EdkIIGlueBase.h>
3f8f7fa5 24
25#------------------------------------------------------------------------------
26# UINT32
27# EFIAPI
28# AsmCpuidEx (
29# IN UINT32 RegisterInEax,
30# IN UINT32 RegisterInEcx,
31# OUT UINT32 *RegisterOutEax OPTIONAL,
32# OUT UINT32 *RegisterOutEbx OPTIONAL,
33# OUT UINT32 *RegisterOutEcx OPTIONAL,
34# OUT UINT32 *RegisterOutEdx OPTIONAL
35# )
36#------------------------------------------------------------------------------
34e4a9a6 37.global ASM_PFX(AsmCpuidEx)
38ASM_PFX(AsmCpuidEx):
3f8f7fa5 39 push %rbx
40 movl %ecx,%eax
41 movl %edx,%ecx
42 push %rax
43 cpuid
44 mov 0x38(%rsp), %r10
45 test %r10, %r10
46 jz L1
47 mov %ecx,(%r10)
48L1:
49 mov %r8, %rcx
50 jrcxz L2
51 movl %eax,(%rcx)
52L2:
53 mov %r9, %rcx
54 jrcxz L3
55 mov %ebx, (%rcx)
56L3:
57 mov 0x40(%rsp), %rcx
58 jrcxz L4
59 mov %edx, (%rcx)
60L4:
61 pop %rax
62 pop %rbx
63 ret