3 # Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 # This program and the accompanying materials are licensed and made available under
6 # the terms and conditions of the BSD License that accompanies this distribution.
7 # The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php.
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
26 #---------------------------------------------------------------------------
31 #---------------------------------------------------------------------------
33 .globl ASM_PFX(EfiHalt)
34 .globl ASM_PFX(EfiWbinvd)
35 .globl ASM_PFX(EfiInvd)
36 .globl ASM_PFX(EfiCpuid)
37 .globl ASM_PFX(EfiReadMsr)
38 .globl ASM_PFX(EfiWriteMsr)
39 .globl ASM_PFX(EfiReadTsc)
40 .globl ASM_PFX(EfiDisableCache)
41 .globl ASM_PFX(EfiEnableCache)
42 .globl ASM_PFX(EfiGetEflags)
43 .globl ASM_PFX(EfiDisableInterrupts)
44 .globl ASM_PFX(EfiEnableInterrupts)
45 .globl ASM_PFX(EfiCpuidExt)
76 #EfiCpuid (IN UINT32 RegisterInEax,
77 # OUT EFI_CPUID_REGISTER *Reg OPTIONAL)
86 movl 8(%ebp), %eax #RegisterInEax
88 cmpl $0, 0xC(%ebp) # Reg
90 movl 0xC(%ebp), %edi # Reg
92 movl %eax, (%edi) # Reg->RegEax
93 movl %ebx, 4(%edi) # Reg->RegEbx
94 movl %ecx, 8(%edi) # Reg->RegEcx
95 movl %edx, 0xC(%edi) # Reg->RegEdx
113 movl 4(%esp), %ecx # Index
123 ASM_PFX(EfiWriteMsr):
124 movl 4(%esp), %ecx # Index
125 movl 8(%esp), %eax # DWORD PTR Value[0]
126 movl 0xC(%esp), %edx # DWORD PTR Value[4]
144 ASM_PFX(EfiDisableCache):
151 orl $0x60000000, %eax
156 #EfiDisableCache ENDP
162 ASM_PFX(EfiEnableCache):
165 andl $0x9fffffff, %eax
174 ASM_PFX(EfiGetEflags):
181 #EfiDisableInterrupts (
184 ASM_PFX(EfiDisableInterrupts):
187 #EfiDisableInterrupts ENDP
190 #EfiEnableInterrupts (
193 ASM_PFX(EfiEnableInterrupts):
196 #EfiEnableInterrupts ENDP
200 # IN UINT32 RegisterInEax,
201 # IN UINT32 CacheLevel,
202 # OUT EFI_CPUID_REGISTER *Regs
204 ASM_PFX(EfiCpuidExt):
210 movl 0x30(%esp), %eax # RegisterInEax
211 movl 0x34(%esp), %ecx # CacheLevel
213 movl 0x38(%esp), %edi # DWORD PTR Regs
215 movl %eax, (%edi) # Reg->RegEax
216 movl %ebx, 4(%edi) # Reg->RegEbx
217 movl %ecx, 8(%edi) # Reg->RegEcx
218 movl %edx, 0xC(%edi) # Reg->RegEdx