2006-04-22 00:54:32 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006, Intel Corporation
|
|
|
|
# All rights reserved. This program and the accompanying materials
|
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
|
|
|
# Module Name:
|
|
|
|
#
|
|
|
|
# CpuId.Asm
|
|
|
|
#
|
|
|
|
# Abstract:
|
|
|
|
#
|
|
|
|
# AsmCpuid function
|
|
|
|
#
|
|
|
|
# Notes:
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2006-07-21 10:47:38 +02:00
|
|
|
.globl _AsmCpuid
|
2006-04-22 00:54:32 +02:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# VOID
|
|
|
|
# EFIAPI
|
|
|
|
# AsmCpuid (
|
|
|
|
# IN UINT32 RegisterInEax,
|
|
|
|
# OUT UINT32 *RegisterOutEax OPTIONAL,
|
|
|
|
# OUT UINT32 *RegisterOutEbx OPTIONAL,
|
|
|
|
# OUT UINT32 *RegisterOutEcx OPTIONAL,
|
|
|
|
# OUT UINT32 *RegisterOutEdx OPTIONAL
|
|
|
|
# )
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
_AsmCpuid:
|
2006-07-21 10:47:38 +02:00
|
|
|
push %ebx
|
|
|
|
push %ebp
|
2006-07-12 16:15:40 +02:00
|
|
|
movl %esp, %ebp
|
|
|
|
movl 12(%ebp), %eax
|
2006-04-22 00:54:32 +02:00
|
|
|
cpuid
|
2006-07-21 10:47:38 +02:00
|
|
|
push %ecx
|
2006-07-12 16:15:40 +02:00
|
|
|
movl 16(%ebp), %ecx
|
2006-04-22 00:54:32 +02:00
|
|
|
jecxz L1
|
2006-07-12 16:15:40 +02:00
|
|
|
movl %eax, (%ecx)
|
2006-07-21 10:47:38 +02:00
|
|
|
L1:
|
2006-07-12 16:15:40 +02:00
|
|
|
movl 20(%ebp), %ecx
|
2006-04-22 00:54:32 +02:00
|
|
|
jecxz L2
|
2006-07-12 16:15:40 +02:00
|
|
|
movl %ebx, (%ecx)
|
2006-07-21 10:47:38 +02:00
|
|
|
L2:
|
2006-07-12 16:15:40 +02:00
|
|
|
movl 24(%ebp), %ecx
|
2006-04-22 00:54:32 +02:00
|
|
|
jecxz L3
|
2006-07-12 16:15:40 +02:00
|
|
|
popl (%ecx)
|
2006-07-21 10:47:38 +02:00
|
|
|
L3:
|
2006-07-12 16:15:40 +02:00
|
|
|
movl 28(%ebp), %ecx
|
2006-04-22 00:54:32 +02:00
|
|
|
jecxz L4
|
2006-07-12 16:15:40 +02:00
|
|
|
movl %edx, (%ecx)
|
2006-07-21 10:47:38 +02:00
|
|
|
L4:
|
2006-07-12 16:15:40 +02:00
|
|
|
movl 12(%ebp), %eax
|
|
|
|
leave
|
2006-07-21 10:47:38 +02:00
|
|
|
pop %ebx
|
2006-04-22 00:54:32 +02:00
|
|
|
ret
|