Update to use DOS format

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6360 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2008-11-03 09:25:10 +00:00
parent db835e01d3
commit b1ff428c96
182 changed files with 8928 additions and 8928 deletions

View File

@ -1,67 +1,67 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuIdEx.S # CpuIdEx.S
# #
# Abstract: # Abstract:
# #
# AsmCpuidEx function # AsmCpuidEx function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.686: .686:
.code: .code:
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# AsmCpuidEx ( # AsmCpuidEx (
# IN UINT32 RegisterInEax, # IN UINT32 RegisterInEax,
# IN UINT32 RegisterInEcx, # IN UINT32 RegisterInEcx,
# OUT UINT32 *RegisterOutEax OPTIONAL, # OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL, # OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL, # OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL # OUT UINT32 *RegisterOutEdx OPTIONAL
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmCpuidEx) .globl ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx): ASM_PFX(AsmCpuidEx):
push %ebx push %ebx
push %ebp push %ebp
movl %esp, %ebp movl %esp, %ebp
movl 12(%ebp), %eax movl 12(%ebp), %eax
movl 16(%ebp), %ecx movl 16(%ebp), %ecx
cpuid cpuid
push %ecx push %ecx
movl 20(%ebp), %ecx movl 20(%ebp), %ecx
jecxz L1 jecxz L1
movl %eax, (%ecx) movl %eax, (%ecx)
L1: L1:
movl 24(%ebp), %ecx movl 24(%ebp), %ecx
jecxz L2 jecxz L2
movl %ebx, (%ecx) movl %ebx, (%ecx)
L2: L2:
movl 28(%ebp), %ecx movl 28(%ebp), %ecx
jecxz L3 jecxz L3
popl (%ecx) popl (%ecx)
L3: L3:
movl 32(%ebp), %edx movl 32(%ebp), %edx
jecxz L4 jecxz L4
movl %edx, (%ecx) movl %edx, (%ecx)
L4: L4:
movl 12(%ebp), %eax movl 12(%ebp), %eax
leave leave
pop %ebx pop %ebx
ret ret

View File

@ -1,41 +1,41 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# DivU64x32.S # DivU64x32.S
# #
# Abstract: # Abstract:
# #
# Calculate the quotient of a 64-bit integer by a 32-bit integer # Calculate the quotient of a 64-bit integer by a 32-bit integer
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathDivU64x32) .globl ASM_PFX(InternalMathDivU64x32)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InternalMathDivU64x32 ( # InternalMathDivU64x32 (
# IN UINT64 Dividend, # IN UINT64 Dividend,
# IN UINT32 Divisor # IN UINT32 Divisor
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMathDivU64x32): ASM_PFX(InternalMathDivU64x32):
movl 8(%esp), %eax movl 8(%esp), %eax
movl 12(%esp), %ecx movl 12(%esp), %ecx
xorl %edx, %edx xorl %edx, %edx
divl %ecx divl %ecx
push %eax # save quotient on stack push %eax # save quotient on stack
movl 8(%esp), %eax movl 8(%esp), %eax
divl %ecx divl %ecx
pop %edx # restore high-order dword of the quotient pop %edx # restore high-order dword of the quotient
ret ret

View File

@ -1,41 +1,41 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# LShiftU64.S # LShiftU64.S
# #
# Abstract: # Abstract:
# #
# 64-bit left shift function for IA-32 # 64-bit left shift function for IA-32
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathLShiftU64) .globl ASM_PFX(InternalMathLShiftU64)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InternalMathLShiftU64 ( # InternalMathLShiftU64 (
# IN UINT64 Operand, # IN UINT64 Operand,
# IN UINTN Count # IN UINTN Count
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMathLShiftU64): ASM_PFX(InternalMathLShiftU64):
movb 12(%esp), %cl movb 12(%esp), %cl
xorl %eax, %eax xorl %eax, %eax
movl 4(%esp), %edx movl 4(%esp), %edx
testb $32, %cl # Count >= 32? testb $32, %cl # Count >= 32?
cmovz %edx, %eax cmovz %edx, %eax
cmovz 0x8(%esp), %edx cmovz 0x8(%esp), %edx
shld %cl, %eax, %edx shld %cl, %eax, %edx
shl %cl, %eax shl %cl, %eax
ret ret

View File

@ -1,41 +1,41 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# LongJump.S # LongJump.S
# #
# Abstract: # Abstract:
# #
# Implementation of _LongJump() on IA-32. # Implementation of _LongJump() on IA-32.
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalLongJump) .globl ASM_PFX(InternalLongJump)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalLongJump ( # InternalLongJump (
# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, # IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalLongJump): ASM_PFX(InternalLongJump):
pop %eax # skip return address pop %eax # skip return address
pop %edx # edx <- JumpBuffer pop %edx # edx <- JumpBuffer
pop %eax # eax <- Value pop %eax # eax <- Value
movl (%edx), %ebx movl (%edx), %ebx
movl 4(%edx), %esi movl 4(%edx), %esi
movl 8(%edx), %edi movl 8(%edx), %edi
movl 12(%edx), %ebp movl 12(%edx), %ebp
movl 16(%edx), %esp movl 16(%edx), %esp
jmp *20(%edx) # restore "eip" jmp *20(%edx) # restore "eip"

View File

@ -1,41 +1,41 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# MultU64x32.S # MultU64x32.S
# #
# Abstract: # Abstract:
# #
# Calculate the product of a 64-bit integer and a 32-bit integer # Calculate the product of a 64-bit integer and a 32-bit integer
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.386: .386:
.code: .code:
.globl ASM_PFX(InternalMathMultU64x32) .globl ASM_PFX(InternalMathMultU64x32)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InternalMathMultU64x32 ( # InternalMathMultU64x32 (
# IN UINT64 Multiplicand, # IN UINT64 Multiplicand,
# IN UINT32 Multiplier # IN UINT32 Multiplier
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMathMultU64x32): ASM_PFX(InternalMathMultU64x32):
movl 12(%esp), %ecx movl 12(%esp), %ecx
movl %ecx, %eax movl %ecx, %eax
imull 8(%esp), %ecx # overflow not detectable imull 8(%esp), %ecx # overflow not detectable
mull 0x4(%esp) mull 0x4(%esp)
addl %ecx, %edx addl %ecx, %edx
ret ret

View File

@ -1,44 +1,44 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# RShiftU64.S # RShiftU64.S
# #
# Abstract: # Abstract:
# #
# 64-bit logical right shift function for IA-32 # 64-bit logical right shift function for IA-32
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.686: .686:
.code: .code:
.globl ASM_PFX(InternalMathRShiftU64) .globl ASM_PFX(InternalMathRShiftU64)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InternalMathRShiftU64 ( # InternalMathRShiftU64 (
# IN UINT64 Operand, # IN UINT64 Operand,
# IN UINTN Count # IN UINTN Count
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMathRShiftU64): ASM_PFX(InternalMathRShiftU64):
movb 12(%esp), %cl # cl <- Count movb 12(%esp), %cl # cl <- Count
xorl %edx, %edx xorl %edx, %edx
movl 8(%esp), %eax movl 8(%esp), %eax
testb $32, %cl # Count >= 32? testb $32, %cl # Count >= 32?
cmovz %eax, %edx cmovz %eax, %edx
cmovz 0x4(%esp), %eax cmovz 0x4(%esp), %eax
shrdl %cl, %edx, %eax shrdl %cl, %edx, %eax
shr %cl, %edx shr %cl, %edx
ret ret

View File

@ -1,38 +1,38 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuId.S # CpuId.S
# #
# Abstract: # Abstract:
# #
# AsmCpuid function # AsmCpuid function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InternalMathSwapBytes64 ( # InternalMathSwapBytes64 (
# IN UINT64 Operand # IN UINT64 Operand
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathSwapBytes64) .globl ASM_PFX(InternalMathSwapBytes64)
ASM_PFX(InternalMathSwapBytes64): ASM_PFX(InternalMathSwapBytes64):
movl 8(%esp), %eax # eax <- upper 32 bits movl 8(%esp), %eax # eax <- upper 32 bits
movl 4(%esp), %edx # edx <- lower 32 bits movl 4(%esp), %edx # edx <- lower 32 bits
bswapl %eax bswapl %eax
bswapl %edx bswapl %edx
ret ret

View File

@ -1,25 +1,25 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuBreakpoint.S # CpuBreakpoint.S
# #
# Abstract: # Abstract:
# #
# Implementation of CpuBreakpoint() on x86_64 # Implementation of CpuBreakpoint() on x86_64
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(CpuBreakpoint) .global ASM_PFX(CpuBreakpoint)
ASM_PFX(CpuBreakpoint): ASM_PFX(CpuBreakpoint):
int $0x3 int $0x3
ret ret

View File

@ -1,60 +1,60 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuId.S # CpuId.S
# #
# Abstract: # Abstract:
# #
# AsmCpuid function # AsmCpuid function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmCpuid ( # AsmCpuid (
# IN UINT32 RegisterInEax, # IN UINT32 RegisterInEax,
# OUT UINT32 *RegisterOutEax OPTIONAL, # OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL, # OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL, # OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL # OUT UINT32 *RegisterOutEdx OPTIONAL
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmCpuid) .global ASM_PFX(AsmCpuid)
ASM_PFX(AsmCpuid): ASM_PFX(AsmCpuid):
push %rbx push %rbx
mov %ecx, %eax mov %ecx, %eax
push %rax # save Index on stack push %rax # save Index on stack
push %rdx push %rdx
cpuid cpuid
test %r9, %r9 test %r9, %r9
jz L1 jz L1
mov %ecx, (%r9) mov %ecx, (%r9)
L1: L1:
pop %rcx pop %rcx
jrcxz L2 jrcxz L2
mov %eax, (%rcx) mov %eax, (%rcx)
L2: L2:
mov %r8, %rcx mov %r8, %rcx
jrcxz L3 jrcxz L3
mov %ebx, (%rcx) mov %ebx, (%rcx)
L3: L3:
mov 0x38(%rsp), %rcx mov 0x38(%rsp), %rcx
jrcxz L4 jrcxz L4
mov %edx, (%rcx) mov %edx, (%rcx)
L4: L4:
pop %rax # restore Index to rax as return value pop %rax # restore Index to rax as return value
pop %rbx pop %rbx
ret ret

View File

@ -1,62 +1,62 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuIdEx.S # CpuIdEx.S
# #
# Abstract: # Abstract:
# #
# AsmCpuidEx function # AsmCpuidEx function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# AsmCpuidEx ( # AsmCpuidEx (
# IN UINT32 RegisterInEax, # IN UINT32 RegisterInEax,
# IN UINT32 RegisterInEcx, # IN UINT32 RegisterInEcx,
# OUT UINT32 *RegisterOutEax OPTIONAL, # OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL, # OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL, # OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL # OUT UINT32 *RegisterOutEdx OPTIONAL
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmCpuidEx) .global ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx): ASM_PFX(AsmCpuidEx):
push %rbx push %rbx
movl %ecx,%eax movl %ecx,%eax
movl %edx,%ecx movl %edx,%ecx
push %rax # save Index on stack push %rax # save Index on stack
cpuid cpuid
mov 0x38(%rsp), %r10 mov 0x38(%rsp), %r10
test %r10, %r10 test %r10, %r10
jz L1 jz L1
mov %ecx,(%r10) mov %ecx,(%r10)
L1: L1:
mov %r8, %rcx mov %r8, %rcx
jrcxz L2 jrcxz L2
movl %eax,(%rcx) movl %eax,(%rcx)
L2: L2:
mov %r9, %rcx mov %r9, %rcx
jrcxz L3 jrcxz L3
mov %ebx, (%rcx) mov %ebx, (%rcx)
L3: L3:
mov 0x40(%rsp), %rcx mov 0x40(%rsp), %rcx
jrcxz L4 jrcxz L4
mov %edx, (%rcx) mov %edx, (%rcx)
L4: L4:
pop %rax # restore Index to rax as return value pop %rax # restore Index to rax as return value
pop %rbx pop %rbx
ret ret

View File

@ -1,65 +1,65 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# DisablePaging64.S # DisablePaging64.S
# #
# Abstract: # Abstract:
# #
# AsmDisablePaging64 function # AsmDisablePaging64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86DisablePaging64 ( # InternalX86DisablePaging64 (
# IN UINT16 Cs, # IN UINT16 Cs,
# IN UINT64 EntryPoint, # IN UINT64 EntryPoint,
# IN UINT64 Context1, OPTIONAL # IN UINT64 Context1, OPTIONAL
# IN UINT32 Context2, OPTIONAL # IN UINT32 Context2, OPTIONAL
# IN UINT64 NewStack # IN UINT64 NewStack
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86DisablePaging64) .global ASM_PFX(InternalX86DisablePaging64)
ASM_PFX(InternalX86DisablePaging64): ASM_PFX(InternalX86DisablePaging64):
cli cli
shl $0x20,%rcx # rcx[32..47] <- Cs shl $0x20,%rcx # rcx[32..47] <- Cs
lea L1, %eax lea L1, %eax
mov %r8d, %esi mov %r8d, %esi
or %rax, %rcx # rcx[0..47] <- Cs:@F or %rax, %rcx # rcx[0..47] <- Cs:@F
mov %r9d, %edi mov %r9d, %edi
mov 0x28(%rsp), %eax # eax <- New Stack mov 0x28(%rsp), %eax # eax <- New Stack
push %rcx push %rcx
ret # switch to compatibility mode ret # switch to compatibility mode
L1: L1:
mov %eax,%esp # set up new stack mov %eax,%esp # set up new stack
mov %cr0,%rax mov %cr0,%rax
btr $0x1f,%eax btr $0x1f,%eax
mov %rax,%cr0 # disable paging mov %rax,%cr0 # disable paging
mov $0xc0000080,%ecx mov $0xc0000080,%ecx
rdmsr rdmsr
and $0xfe,%ah # clear LME and $0xfe,%ah # clear LME
wrmsr wrmsr
mov %cr4,%rax mov %cr4,%rax
and $0xdf,%al # clear PAE and $0xdf,%al # clear PAE
mov %rax,%cr4 mov %rax,%cr4
push %rdi # push Context2 push %rdi # push Context2
push %rsi # push Context1 push %rsi # push Context1
callq *%rdx # transfer control to EntryPoint callq *%rdx # transfer control to EntryPoint
jmp . # no one should get here jmp . # no one should get here

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnableDisableInterrupts.S # EnableDisableInterrupts.S
# #
# Abstract: # Abstract:
# #
# EnableDisableInterrupts function # EnableDisableInterrupts function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# EnableDisableInterrupts ( # EnableDisableInterrupts (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(EnableDisableInterrupts) .global ASM_PFX(EnableDisableInterrupts)
.align 16 .align 16
ASM_PFX(EnableDisableInterrupts): ASM_PFX(EnableDisableInterrupts):
sti sti
cli cli
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnableInterrupts.S # EnableInterrupts.S
# #
# Abstract: # Abstract:
# #
# EnableInterrupts function # EnableInterrupts function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# EnableInterrupts ( # EnableInterrupts (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(EnableInterrupts) .global ASM_PFX(EnableInterrupts)
ASM_PFX(EnableInterrupts): ASM_PFX(EnableInterrupts):
sti sti
ret ret

View File

@ -1,61 +1,61 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnablePaging64.S # EnablePaging64.S
# #
# Abstract: # Abstract:
# #
# AsmEnablePaging64 function # AsmEnablePaging64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86EnablePaging64 ( # InternalX86EnablePaging64 (
# IN UINT16 Cs, # IN UINT16 Cs,
# IN UINT64 EntryPoint, # IN UINT64 EntryPoint,
# IN UINT64 Context1, OPTIONAL # IN UINT64 Context1, OPTIONAL
# IN UINT64 Context2, OPTIONAL # IN UINT64 Context2, OPTIONAL
# IN UINT64 NewStack # IN UINT64 NewStack
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86EnablePaging64) .global ASM_PFX(InternalX86EnablePaging64)
ASM_PFX(InternalX86EnablePaging64): ASM_PFX(InternalX86EnablePaging64):
cli cli
pop %rax # skip the return address pop %rax # skip the return address
callq Base callq Base
Base: Base:
addl $(L1-Base),(%rsp) # offset for ret, seg is the 1st arg addl $(L1-Base),(%rsp) # offset for ret, seg is the 1st arg
mov %cr4,%rax mov %cr4,%rax
or $0x20,%al or $0x20,%al
mov %rax,%cr4 # enable PAE mov %rax,%cr4 # enable PAE
mov $0xc0000080,%ecx mov $0xc0000080,%ecx
rdmsr rdmsr
or $0x1,%ah # set LME or $0x1,%ah # set LME
wrmsr wrmsr
mov %cr0,%rax mov %cr0,%rax
bts $0x1f,%eax bts $0x1f,%eax
mov %rax,%cr0 # enable paging mov %rax,%cr0 # enable paging
lret lret
L1: # long mode starts here L1: # long mode starts here
addr32 mov (%esp),%rbx addr32 mov (%esp),%rbx
addr32 mov 0x8(%esp),%rcx addr32 mov 0x8(%esp),%rcx
addr32 mov 0x10(%esp),%rdx addr32 mov 0x10(%esp),%rdx
addr32 mov 0x18(%esp),%rsp addr32 mov 0x18(%esp),%rsp
add $-0x20,%rsp add $-0x20,%rsp
callq *%rbx callq *%rbx
jmp . # dead loop if EntryPoint() returned jmp . # dead loop if EntryPoint() returned

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FlushCacheLine.S # FlushCacheLine.S
# #
# Abstract: # Abstract:
# #
# AsmFlushCacheLine function # AsmFlushCacheLine function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# AsmFlushCacheLine ( # AsmFlushCacheLine (
# IN VOID *LinearAddress # IN VOID *LinearAddress
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmFlushCacheLine) .global ASM_PFX(AsmFlushCacheLine)
ASM_PFX(AsmFlushCacheLine): ASM_PFX(AsmFlushCacheLine):
clflush (%rcx) clflush (%rcx)
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FxRestore.S # FxRestore.S
# #
# Abstract: # Abstract:
# #
# AsmFxRestore function # AsmFxRestore function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86FxRestore ( # InternalX86FxRestore (
# IN CONST IA32_FX_BUFFER *Buffer # IN CONST IA32_FX_BUFFER *Buffer
# )# # )#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86FxRestore) .global ASM_PFX(InternalX86FxRestore)
ASM_PFX(InternalX86FxRestore): ASM_PFX(InternalX86FxRestore):
fxrstor (%rcx) fxrstor (%rcx)
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FxSave.S # FxSave.S
# #
# Abstract: # Abstract:
# #
# AsmFxSave function # AsmFxSave function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86FxSave ( # InternalX86FxSave (
# OUT IA32_FX_BUFFER *Buffer # OUT IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86FxSave) .global ASM_PFX(InternalX86FxSave)
ASM_PFX(InternalX86FxSave): ASM_PFX(InternalX86FxSave):
fxsave (%rcx) fxsave (%rcx)
ret ret

View File

@ -1,39 +1,39 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedCompareExchange64.S # InterlockedCompareExchange64.S
# #
# Abstract: # Abstract:
# #
# InterlockedCompareExchange64 function # InterlockedCompareExchange64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InterlockedCompareExchange64 ( # InterlockedCompareExchange64 (
# IN UINT64 *Value, # IN UINT64 *Value,
# IN UINT64 CompareValue, # IN UINT64 CompareValue,
# IN UINT64 ExchangeValue # IN UINT64 ExchangeValue
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalSyncCompareExchange64) .global ASM_PFX(InternalSyncCompareExchange64)
.align 16 .align 16
ASM_PFX(InternalSyncCompareExchange64): ASM_PFX(InternalSyncCompareExchange64):
mov %rdx, %rax mov %rdx, %rax
lock cmpxchg %r8,(%rcx) lock cmpxchg %r8,(%rcx)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedDecrement.S # InterlockedDecrement.S
# #
# Abstract: # Abstract:
# #
# InterlockedDecrement function # InterlockedDecrement function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedDecrement ( # InterlockedDecrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalSyncDecrement) .global ASM_PFX(InternalSyncDecrement)
ASM_PFX(InternalSyncDecrement): ASM_PFX(InternalSyncDecrement):
lock decl (%rcx) lock decl (%rcx)
mov (%rcx), %eax mov (%rcx), %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedIncrement.S # InterlockedIncrement.S
# #
# Abstract: # Abstract:
# #
# InterlockedIncrement function # InterlockedIncrement function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedIncrement ( # InterlockedIncrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalSyncIncrement) .global ASM_PFX(InternalSyncIncrement)
ASM_PFX(InternalSyncIncrement): ASM_PFX(InternalSyncIncrement):
lock incl (%rcx) lock incl (%rcx)
mov (%rcx), %eax mov (%rcx), %eax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Invd.S # Invd.S
# #
# Abstract: # Abstract:
# #
# AsmInvd function # AsmInvd function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmInvd ( # AsmInvd (
# VOID # VOID
# )# # )#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmInvd) .global ASM_PFX(AsmInvd)
ASM_PFX(AsmInvd): ASM_PFX(AsmInvd):
invd invd
ret ret

View File

@ -1,41 +1,41 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Monitor.S # Monitor.S
# #
# Abstract: # Abstract:
# #
# AsmMonitor function # AsmMonitor function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmMonitor ( # AsmMonitor (
# IN UINTN Eax, # IN UINTN Eax,
# IN UINTN Ecx, # IN UINTN Ecx,
# IN UINTN Edx # IN UINTN Edx
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmMonitor) .global ASM_PFX(AsmMonitor)
.align 16 .align 16
ASM_PFX(AsmMonitor): ASM_PFX(AsmMonitor):
mov %ecx,%eax mov %ecx,%eax
mov %edx,%ecx mov %edx,%ecx
mov %r8d,%edx mov %r8d,%edx
monitor monitor
ret ret

View File

@ -1,39 +1,39 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Mwait.S # Mwait.S
# #
# Abstract: # Abstract:
# #
# AsmMwait function # AsmMwait function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmMwait ( # AsmMwait (
# IN UINTN Eax, # IN UINTN Eax,
# IN UINTN Ecx # IN UINTN Ecx
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmMwait) .global ASM_PFX(AsmMwait)
.align 16 .align 16
ASM_PFX(AsmMwait): ASM_PFX(AsmMwait):
mov %ecx,%eax mov %ecx,%eax
mov %edx,%ecx mov %edx,%ecx
mwait %rax,%rcx mwait %rax,%rcx
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadCr0.S # ReadCr0.S
# #
# Abstract: # Abstract:
# #
# AsmReadCr0 function # AsmReadCr0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadCr0 ( # AsmReadCr0 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadCr0) .global ASM_PFX(AsmReadCr0)
.align 16 .align 16
ASM_PFX(AsmReadCr0): ASM_PFX(AsmReadCr0):
mov %cr0, %rax mov %cr0, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadCr2.S # ReadCr2.S
# #
# Abstract: # Abstract:
# #
# AsmReadCr2 function # AsmReadCr2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadCr2 ( # AsmReadCr2 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadCr2) .global ASM_PFX(AsmReadCr2)
.align 16 .align 16
ASM_PFX(AsmReadCr2): ASM_PFX(AsmReadCr2):
mov %cr2, %rax mov %cr2, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadCr3.S # ReadCr3.S
# #
# Abstract: # Abstract:
# #
# AsmReadCr3 function # AsmReadCr3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadCr3 ( # AsmReadCr3 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadCr3) .global ASM_PFX(AsmReadCr3)
.align 16 .align 16
ASM_PFX(AsmReadCr3): ASM_PFX(AsmReadCr3):
mov %cr3, %rax mov %cr3, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadCr4.S # ReadCr4.S
# #
# Abstract: # Abstract:
# #
# AsmReadCr4 function # AsmReadCr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadCr4 ( # AsmReadCr4 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadCr4) .global ASM_PFX(AsmReadCr4)
.align 16 .align 16
ASM_PFX(AsmReadCr4): ASM_PFX(AsmReadCr4):
mov %cr4, %rax mov %cr4, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadCs.S # ReadCs.S
# #
# Abstract: # Abstract:
# #
# AsmReadCs function # AsmReadCs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadCs ( # AsmReadCs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadCs) .global ASM_PFX(AsmReadCs)
.align 16 .align 16
ASM_PFX(AsmReadCs): ASM_PFX(AsmReadCs):
mov %cs, %eax mov %cs, %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr0.S # ReadDr0.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr0 function # AsmReadDr0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr0 ( # AsmReadDr0 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr0) .global ASM_PFX(AsmReadDr0)
.align 16 .align 16
ASM_PFX(AsmReadDr0): ASM_PFX(AsmReadDr0):
mov %dr0, %rax mov %dr0, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr1.S # ReadDr1.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr1 function # AsmReadDr1 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr1 ( # AsmReadDr1 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr1) .global ASM_PFX(AsmReadDr1)
.align 16 .align 16
ASM_PFX(AsmReadDr1): ASM_PFX(AsmReadDr1):
mov %dr1, %rax mov %dr1, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr2.S # ReadDr2.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr2 function # AsmReadDr2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr2 ( # AsmReadDr2 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr2) .global ASM_PFX(AsmReadDr2)
.align 16 .align 16
ASM_PFX(AsmReadDr2): ASM_PFX(AsmReadDr2):
mov %dr2, %rax mov %dr2, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr3.S # ReadDr3.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr3 function # AsmReadDr3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr3 ( # AsmReadDr3 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr3) .global ASM_PFX(AsmReadDr3)
.align 16 .align 16
ASM_PFX(AsmReadDr3): ASM_PFX(AsmReadDr3):
mov %dr3, %rax mov %dr3, %rax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr4.S # ReadDr4.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr4 function # AsmReadDr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr4 ( # AsmReadDr4 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr4) .global ASM_PFX(AsmReadDr4)
.align 16 .align 16
ASM_PFX(AsmReadDr4): ASM_PFX(AsmReadDr4):
#DB 0fh, 21h, 0e0h #DB 0fh, 21h, 0e0h
mov %dr4, %rax mov %dr4, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr5.S # ReadDr5.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr5 function # AsmReadDr5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr5 ( # AsmReadDr5 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr5) .global ASM_PFX(AsmReadDr5)
.align 16 .align 16
ASM_PFX(AsmReadDr5): ASM_PFX(AsmReadDr5):
mov %dr5, %rax mov %dr5, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr6.S # ReadDr6.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr6 function # AsmReadDr6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr6 ( # AsmReadDr6 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr6) .global ASM_PFX(AsmReadDr6)
.align 16 .align 16
ASM_PFX(AsmReadDr6): ASM_PFX(AsmReadDr6):
mov %dr6, %rax mov %dr6, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDr7.S # ReadDr7.S
# #
# Abstract: # Abstract:
# #
# AsmReadDr7 function # AsmReadDr7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadDr7 ( # AsmReadDr7 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDr7) .global ASM_PFX(AsmReadDr7)
.align 16 .align 16
ASM_PFX(AsmReadDr7): ASM_PFX(AsmReadDr7):
mov %dr7, %rax mov %dr7, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadDs.S # ReadDs.S
# #
# Abstract: # Abstract:
# #
# AsmReadDs function # AsmReadDs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadDs ( # AsmReadDs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadDs) .global ASM_PFX(AsmReadDs)
.align 16 .align 16
ASM_PFX(AsmReadDs): ASM_PFX(AsmReadDs):
movl %ds, %eax movl %ds, %eax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadEflags.S # ReadEflags.S
# #
# Abstract: # Abstract:
# #
# AsmReadEflags function # AsmReadEflags function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmReadEflags ( # AsmReadEflags (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadEflags) .global ASM_PFX(AsmReadEflags)
.align 16 .align 16
ASM_PFX(AsmReadEflags): ASM_PFX(AsmReadEflags):
pushfq pushfq
pop %rax pop %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadEs.S # ReadEs.S
# #
# Abstract: # Abstract:
# #
# AsmReadEs function # AsmReadEs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadEs ( # AsmReadEs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadEs) .global ASM_PFX(AsmReadEs)
.align 16 .align 16
ASM_PFX(AsmReadEs): ASM_PFX(AsmReadEs):
mov %es, %eax mov %es, %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadFs.S # ReadFs.S
# #
# Abstract: # Abstract:
# #
# AsmReadFs function # AsmReadFs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadFs ( # AsmReadFs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadFs) .global ASM_PFX(AsmReadFs)
.align 16 .align 16
ASM_PFX(AsmReadFs): ASM_PFX(AsmReadFs):
mov %fs, %eax mov %fs, %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadGdtr.S # ReadGdtr.S
# #
# Abstract: # Abstract:
# #
# AsmReadGdtr function # AsmReadGdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86ReadGdtr ( # InternalX86ReadGdtr (
# OUT IA32_DESCRIPTOR *Gdtr # OUT IA32_DESCRIPTOR *Gdtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86ReadGdtr) .global ASM_PFX(InternalX86ReadGdtr)
.align 16 .align 16
ASM_PFX(InternalX86ReadGdtr): ASM_PFX(InternalX86ReadGdtr):
sgdt (%rcx) sgdt (%rcx)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadGs.S # ReadGs.S
# #
# Abstract: # Abstract:
# #
# AsmReadGs function # AsmReadGs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadGs ( # AsmReadGs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadGs) .global ASM_PFX(AsmReadGs)
.align 16 .align 16
ASM_PFX(AsmReadGs): ASM_PFX(AsmReadGs):
mov %gs, %eax mov %gs, %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadIdtr.AS # ReadIdtr.AS
# #
# Abstract: # Abstract:
# #
# AsmReadIdtr function # AsmReadIdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86ReadIdtr ( # InternalX86ReadIdtr (
# OUT IA32_DESCRIPTOR *Idtr # OUT IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86ReadIdtr) .global ASM_PFX(InternalX86ReadIdtr)
.align 16 .align 16
ASM_PFX(InternalX86ReadIdtr): ASM_PFX(InternalX86ReadIdtr):
sidt (%rcx) sidt (%rcx)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadLdtr.AS # ReadLdtr.AS
# #
# Abstract: # Abstract:
# #
# AsmReadLdtr function # AsmReadLdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadLdtr ( # AsmReadLdtr (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadLdtr) .global ASM_PFX(AsmReadLdtr)
.align 16 .align 16
ASM_PFX(AsmReadLdtr): ASM_PFX(AsmReadLdtr):
sldt %eax sldt %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm0.S # ReadMm0.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm0 function # AsmReadMm0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm0 ( # AsmReadMm0 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm0) .global ASM_PFX(AsmReadMm0)
.align 16 .align 16
ASM_PFX(AsmReadMm0): ASM_PFX(AsmReadMm0):
movd %mm0, %rax movd %mm0, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm1.S # ReadMm1.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm1 function # AsmReadMm1 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm1 ( # AsmReadMm1 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm1) .global ASM_PFX(AsmReadMm1)
.align 16 .align 16
ASM_PFX(AsmReadMm1): ASM_PFX(AsmReadMm1):
movd %mm1, %rax movd %mm1, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm2.S # ReadMm2.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm2 function # AsmReadMm2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm2 ( # AsmReadMm2 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm2) .global ASM_PFX(AsmReadMm2)
.align 16 .align 16
ASM_PFX(AsmReadMm2): ASM_PFX(AsmReadMm2):
movd %mm2, %rax movd %mm2, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm3.S # ReadMm3.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm3 function # AsmReadMm3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm3 ( # AsmReadMm3 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm3) .global ASM_PFX(AsmReadMm3)
.align 16 .align 16
ASM_PFX(AsmReadMm3): ASM_PFX(AsmReadMm3):
movd %mm3, %rax movd %mm3, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm4.AS # ReadMm4.AS
# #
# Abstract: # Abstract:
# #
# AsmReadMm4 function # AsmReadMm4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm4 ( # AsmReadMm4 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm4) .global ASM_PFX(AsmReadMm4)
.align 16 .align 16
ASM_PFX(AsmReadMm4): ASM_PFX(AsmReadMm4):
movd %mm4, %rax movd %mm4, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm5.S # ReadMm5.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm5 function # AsmReadMm5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm5 ( # AsmReadMm5 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm5) .global ASM_PFX(AsmReadMm5)
.align 16 .align 16
ASM_PFX(AsmReadMm5): ASM_PFX(AsmReadMm5):
movd %mm5, %rax movd %mm5, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm6.S # ReadMm6.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm6 function # AsmReadMm6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm6 ( # AsmReadMm6 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm6) .global ASM_PFX(AsmReadMm6)
.align 16 .align 16
ASM_PFX(AsmReadMm6): ASM_PFX(AsmReadMm6):
movd %mm6, %rax movd %mm6, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMm7.S # ReadMm7.S
# #
# Abstract: # Abstract:
# #
# AsmReadMm7 function # AsmReadMm7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMm7 ( # AsmReadMm7 (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMm7) .global ASM_PFX(AsmReadMm7)
.align 16 .align 16
ASM_PFX(AsmReadMm7): ASM_PFX(AsmReadMm7):
movd %mm7, %rax movd %mm7, %rax
ret ret

View File

@ -1,38 +1,38 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadMsr64.S # ReadMsr64.S
# #
# Abstract: # Abstract:
# #
# AsmReadMsr64 function # AsmReadMsr64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadMsr64 ( # AsmReadMsr64 (
# IN UINT32 Index # IN UINT32 Index
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadMsr64) .global ASM_PFX(AsmReadMsr64)
.align 16 .align 16
ASM_PFX(AsmReadMsr64): ASM_PFX(AsmReadMsr64):
rdmsr # edx & eax are zero extended rdmsr # edx & eax are zero extended
shl $0x20, %rdx shl $0x20, %rdx
or %rdx, %rax or %rdx, %rax
ret ret

View File

@ -1,38 +1,38 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadPmc.S # ReadPmc.S
# #
# Abstract: # Abstract:
# #
# AsmReadPmc function # AsmReadPmc function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadPmc ( # AsmReadPmc (
# IN UINT32 PmcIndex # IN UINT32 PmcIndex
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadPmc) .global ASM_PFX(AsmReadPmc)
.align 16 .align 16
ASM_PFX(AsmReadPmc): ASM_PFX(AsmReadPmc):
rdpmc rdpmc
shl $0x20, %rdx shl $0x20, %rdx
or %rdx, %rax or %rdx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadSs.S # ReadSs.S
# #
# Abstract: # Abstract:
# #
# AsmReadSs function # AsmReadSs function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadSs ( # AsmReadSs (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadSs) .global ASM_PFX(AsmReadSs)
.align 16 .align 16
ASM_PFX(AsmReadSs): ASM_PFX(AsmReadSs):
movl %ss, %eax movl %ss, %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadTr.S # ReadTr.S
# #
# Abstract: # Abstract:
# #
# AsmReadTr function # AsmReadTr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT16 # UINT16
# EFIAPI # EFIAPI
# AsmReadTr ( # AsmReadTr (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadTr) .global ASM_PFX(AsmReadTr)
.align 16 .align 16
ASM_PFX(AsmReadTr): ASM_PFX(AsmReadTr):
str %eax str %eax
ret ret

View File

@ -1,38 +1,38 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ReadTsc.S # ReadTsc.S
# #
# Abstract: # Abstract:
# #
# AsmReadTsc function # AsmReadTsc function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmReadTsc ( # AsmReadTsc (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmReadTsc) .global ASM_PFX(AsmReadTsc)
.align 16 .align 16
ASM_PFX(AsmReadTsc): ASM_PFX(AsmReadTsc):
rdtsc rdtsc
shl $0x20, %rdx shl $0x20, %rdx
or %rdx, %rax or %rdx, %rax
ret ret

View File

@ -1,42 +1,42 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetJump.S # SetJump.S
# #
# Abstract: # Abstract:
# #
# Implementation of SetJump() on x86_64 # Implementation of SetJump() on x86_64
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.extern ASM_PFX(InternalAssertJumpBuffer) .extern ASM_PFX(InternalAssertJumpBuffer)
.global ASM_PFX(SetJump) .global ASM_PFX(SetJump)
ASM_PFX(SetJump): ASM_PFX(SetJump):
push %rcx push %rcx
add $0xffffffffffffffe0,%rsp add $0xffffffffffffffe0,%rsp
call ASM_PFX(InternalAssertJumpBuffer) call ASM_PFX(InternalAssertJumpBuffer)
add $0x20,%rsp add $0x20,%rsp
pop %rcx pop %rcx
pop %rdx pop %rdx
mov %rbx,(%rcx) mov %rbx,(%rcx)
mov %rsp,0x8(%rcx) mov %rsp,0x8(%rcx)
mov %rbp,0x10(%rcx) mov %rbp,0x10(%rcx)
mov %rdi,0x18(%rcx) mov %rdi,0x18(%rcx)
mov %rsi,0x20(%rcx) mov %rsi,0x20(%rcx)
mov %r12,0x28(%rcx) mov %r12,0x28(%rcx)
mov %r13,0x30(%rcx) mov %r13,0x30(%rcx)
mov %r14,0x38(%rcx) mov %r14,0x38(%rcx)
mov %r15,0x40(%rcx) mov %r15,0x40(%rcx)
mov %rdx,0x48(%rcx) mov %rdx,0x48(%rcx)
xor %rax,%rax xor %rax,%rax
jmpq *%rdx jmpq *%rdx

View File

@ -1,48 +1,48 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SwitchStack.S # SwitchStack.S
# #
# Abstract: # Abstract:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Routine Description: # Routine Description:
# #
# Routine for switching stacks with 2 parameters # Routine for switching stacks with 2 parameters
# #
# Arguments: # Arguments:
# #
# (rcx) EntryPoint - Entry point with new stack. # (rcx) EntryPoint - Entry point with new stack.
# (rdx) Context1 - Parameter1 for entry point. # (rdx) Context1 - Parameter1 for entry point.
# (r8) Context2 - Parameter2 for entry point. # (r8) Context2 - Parameter2 for entry point.
# (r9) NewStack - Pointer to new stack. # (r9) NewStack - Pointer to new stack.
# #
# Returns: # Returns:
# #
# None # None
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalSwitchStack) .global ASM_PFX(InternalSwitchStack)
ASM_PFX(InternalSwitchStack): ASM_PFX(InternalSwitchStack):
mov %rcx, %rax mov %rcx, %rax
mov %rdx, %rcx mov %rdx, %rcx
mov %r8, %rdx mov %r8, %rdx
# #
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack, # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them. # in case the callee wishes to spill them.
# #
lea -0x20(%r9), %rsp lea -0x20(%r9), %rsp
call *%rax call *%rax

View File

@ -1,298 +1,298 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Thunk16.S # Thunk16.S
# #
# Abstract: # Abstract:
# #
# Real mode thunk # Real mode thunk
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
.globl ASM_PFX(m16Start) .globl ASM_PFX(m16Start)
.globl ASM_PFX(m16Size) .globl ASM_PFX(m16Size)
.globl ASM_PFX(mThunk16Attr) .globl ASM_PFX(mThunk16Attr)
.globl ASM_PFX(m16Gdt) .globl ASM_PFX(m16Gdt)
.globl ASM_PFX(m16GdtrBase) .globl ASM_PFX(m16GdtrBase)
.globl ASM_PFX(mTransition) .globl ASM_PFX(mTransition)
.globl ASM_PFX(InternalAsmThunk16) .globl ASM_PFX(InternalAsmThunk16)
# define the structure of IA32_REGS # define the structure of IA32_REGS
.equ _EDI, 0 #size 4 .equ _EDI, 0 #size 4
.equ _ESI, 4 #size 4 .equ _ESI, 4 #size 4
.equ _EBP, 8 #size 4 .equ _EBP, 8 #size 4
.equ _ESP, 12 #size 4 .equ _ESP, 12 #size 4
.equ _EBX, 16 #size 4 .equ _EBX, 16 #size 4
.equ _EDX, 20 #size 4 .equ _EDX, 20 #size 4
.equ _ECX, 24 #size 4 .equ _ECX, 24 #size 4
.equ _EAX, 28 #size 4 .equ _EAX, 28 #size 4
.equ _DS, 32 #size 2 .equ _DS, 32 #size 2
.equ _ES, 34 #size 2 .equ _ES, 34 #size 2
.equ _FS, 36 #size 2 .equ _FS, 36 #size 2
.equ _GS, 38 #size 2 .equ _GS, 38 #size 2
.equ _EFLAGS, 40 #size 8 .equ _EFLAGS, 40 #size 8
.equ _EIP, 48 #size 4 .equ _EIP, 48 #size 4
.equ _CS, 52 #size 2 .equ _CS, 52 #size 2
.equ _SS, 54 #size 2 .equ _SS, 54 #size 2
.equ IA32_REGS_SIZE, 56 .equ IA32_REGS_SIZE, 56
.data .data
ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start) ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
ASM_PFX(mThunk16Attr): .word _ThunkAttr - ASM_PFX(m16Start) ASM_PFX(mThunk16Attr): .word _ThunkAttr - ASM_PFX(m16Start)
ASM_PFX(m16Gdt): .word _NullSeg - ASM_PFX(m16Start) ASM_PFX(m16Gdt): .word _NullSeg - ASM_PFX(m16Start)
ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start) ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start)
ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start) ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start)
.text .text
ASM_PFX(m16Start): ASM_PFX(m16Start):
SavedGdt: .space 10 SavedGdt: .space 10
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# _BackFromUserCode() takes control in real mode after 'retf' has been executed # _BackFromUserCode() takes control in real mode after 'retf' has been executed
# by user code. It will be shadowed to somewhere in memory below 1MB. # by user code. It will be shadowed to somewhere in memory below 1MB.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(BackFromUserCode) .globl ASM_PFX(BackFromUserCode)
ASM_PFX(BackFromUserCode): ASM_PFX(BackFromUserCode):
# #
# The order of saved registers on the stack matches the order they appears # The order of saved registers on the stack matches the order they appears
# in IA32_REGS structure. This facilitates wrapper function to extract them # in IA32_REGS structure. This facilitates wrapper function to extract them
# into that structure. # into that structure.
# #
# Some instructions for manipulation of segment registers have to be written # Some instructions for manipulation of segment registers have to be written
# in opcode since 64-bit MASM prevents accesses to those registers. # in opcode since 64-bit MASM prevents accesses to those registers.
# #
.byte 0x16 # push ss .byte 0x16 # push ss
.byte 0xe # push cs .byte 0xe # push cs
.byte 0x66 .byte 0x66
call L_Base # push eip call L_Base # push eip
L_Base: L_Base:
.byte 0x66 .byte 0x66
pushq $0 # reserved high order 32 bits of EFlags pushq $0 # reserved high order 32 bits of EFlags
.byte 0x66, 0x9c # pushfd actually .byte 0x66, 0x9c # pushfd actually
cli # disable interrupts cli # disable interrupts
push %gs push %gs
push %fs push %fs
.byte 6 # push es .byte 6 # push es
.byte 0x1e # push ds .byte 0x1e # push ds
.byte 0x66,0x60 # pushad .byte 0x66,0x60 # pushad
.byte 0x66,0xba # mov edx, imm32 .byte 0x66,0xba # mov edx, imm32
_ThunkAttr: .space 4 _ThunkAttr: .space 4
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
jz L_1 jz L_1
movl $0x15cd2401,%eax # mov ax, 2401h & int 15h movl $0x15cd2401,%eax # mov ax, 2401h & int 15h
cli # disable interrupts cli # disable interrupts
jnc L_2 jnc L_2
L_1: L_1:
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
jz L_2 jz L_2
inb $0x92,%al inb $0x92,%al
orb $2,%al orb $2,%al
outb %al, $0x92 # deactivate A20M# outb %al, $0x92 # deactivate A20M#
L_2: L_2:
movl %ss,%eax movl %ss,%eax
lea IA32_REGS_SIZE(%esp), %bp lea IA32_REGS_SIZE(%esp), %bp
# #
# rsi in the following 2 instructions is indeed bp in 16-bit code # rsi in the following 2 instructions is indeed bp in 16-bit code
# #
movw %bp, (_ESP - IA32_REGS_SIZE)(%rsi) movw %bp, (_ESP - IA32_REGS_SIZE)(%rsi)
.byte 0x66 .byte 0x66
movl (_EIP - IA32_REGS_SIZE)(%rsi), %ebx movl (_EIP - IA32_REGS_SIZE)(%rsi), %ebx
shlw $4,%ax # shl eax, 4 shlw $4,%ax # shl eax, 4
addw %ax,%bp # add ebp, eax addw %ax,%bp # add ebp, eax
movw %cs,%ax movw %cs,%ax
shlw $4,%ax shlw $4,%ax
lea (L_64BitCode - L_Base)(%ebx, %eax), %ax lea (L_64BitCode - L_Base)(%ebx, %eax), %ax
.byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax .byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax
.word L_64Eip - L_Base .word L_64Eip - L_Base
.byte 0x66,0xb8 # mov eax, imm32 .byte 0x66,0xb8 # mov eax, imm32
SavedCr4: .space 4 SavedCr4: .space 4
movq %rax, %cr4 movq %rax, %cr4
# #
# rdi in the instruction below is indeed bx in 16-bit code # rdi in the instruction below is indeed bx in 16-bit code
# #
.byte 0x66,0x2e # 2eh is "cs:" segment override .byte 0x66,0x2e # 2eh is "cs:" segment override
lgdt (SavedGdt - L_Base)(%rdi) lgdt (SavedGdt - L_Base)(%rdi)
.byte 0x66 .byte 0x66
movl $0xc0000080,%ecx movl $0xc0000080,%ecx
rdmsr rdmsr
orb $1,%ah orb $1,%ah
wrmsr wrmsr
.byte 0x66,0xb8 # mov eax, imm32 .byte 0x66,0xb8 # mov eax, imm32
SavedCr0: .space 4 SavedCr0: .space 4
movq %rax, %cr0 movq %rax, %cr0
.byte 0x66,0xea # jmp far cs:L_64Bit .byte 0x66,0xea # jmp far cs:L_64Bit
L_64Eip: .space 4 L_64Eip: .space 4
SavedCs: .space 2 SavedCs: .space 2
L_64BitCode: L_64BitCode:
movq %r8, %rsp movq %r8, %rsp
ret ret
_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start) _EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
.word CODE16 .word CODE16
_16Gdtr: .word GDT_SIZE - 1 _16Gdtr: .word GDT_SIZE - 1
_16GdtrBase: .quad _NullSeg _16GdtrBase: .quad _NullSeg
_16Idtr: .word 0x3ff _16Idtr: .word 0x3ff
.long 0 .long 0
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# _ToUserCode() takes control in real mode before passing control to user code. # _ToUserCode() takes control in real mode before passing control to user code.
# It will be shadowed to somewhere in memory below 1MB. # It will be shadowed to somewhere in memory below 1MB.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(ToUserCode) .globl ASM_PFX(ToUserCode)
ASM_PFX(ToUserCode): ASM_PFX(ToUserCode):
movl %edx,%ss # set new segment selectors movl %edx,%ss # set new segment selectors
movl %edx,%ds movl %edx,%ds
movl %edx,%es movl %edx,%es
movl %edx,%fs movl %edx,%fs
movl %edx,%gs movl %edx,%gs
.byte 0x66 .byte 0x66
movl $0xc0000080,%ecx movl $0xc0000080,%ecx
movq %rax, %cr0 movq %rax, %cr0
rdmsr rdmsr
andb $0b11111110, %ah andb $0b11111110, %ah
wrmsr wrmsr
movq %rbp, %cr4 movq %rbp, %cr4
movl %esi,%ss # set up 16-bit stack segment movl %esi,%ss # set up 16-bit stack segment
movw %bx,%sp # set up 16-bit stack pointer movw %bx,%sp # set up 16-bit stack pointer
.byte 0x66 # make the following call 32-bit .byte 0x66 # make the following call 32-bit
call L_Base1 # push eip call L_Base1 # push eip
L_Base1: L_Base1:
popw %bp # ebp <- address of L_Base1 popw %bp # ebp <- address of L_Base1
pushq (IA32_REGS_SIZE + 2)(%esp) pushq (IA32_REGS_SIZE + 2)(%esp)
lea 0x0c(%rsi), %eax lea 0x0c(%rsi), %eax
pushq %rax pushq %rax
lret # execution begins at next instruction lret # execution begins at next instruction
L_RealMode: L_RealMode:
.byte 0x66,0x2e # CS and operand size override .byte 0x66,0x2e # CS and operand size override
lidt (_16Idtr - L_Base1)(%rsi) lidt (_16Idtr - L_Base1)(%rsi)
.byte 0x66,0x61 # popad .byte 0x66,0x61 # popad
.byte 0x1f # pop ds .byte 0x1f # pop ds
.byte 0x7 # pop es .byte 0x7 # pop es
.byte 0x0f, 0xa1 # pop fs .byte 0x0f, 0xa1 # pop fs
.byte 0x0f, 0xa9 # pop gs .byte 0x0f, 0xa9 # pop gs
.byte 0x66, 0x9d # popfd .byte 0x66, 0x9d # popfd
leaw 4(%esp),%sp # skip high order 32 bits of EFlags leaw 4(%esp),%sp # skip high order 32 bits of EFlags
.byte 0x66 # make the following retf 32-bit .byte 0x66 # make the following retf 32-bit
lret # transfer control to user code lret # transfer control to user code
.equ CODE16, ASM_PFX(16Code) - . .equ CODE16, ASM_PFX(16Code) - .
.equ DATA16, ASM_PFX(16Data) - . .equ DATA16, ASM_PFX(16Data) - .
.equ DATA32, ASM_PFX(32Data) - . .equ DATA32, ASM_PFX(32Data) - .
_NullSeg: .quad 0 _NullSeg: .quad 0
ASM_PFX(16Code): ASM_PFX(16Code):
.word -1 .word -1
.word 0 .word 0
.byte 0 .byte 0
.byte 0x9b .byte 0x9b
.byte 0x8f # 16-bit segment, 4GB limit .byte 0x8f # 16-bit segment, 4GB limit
.byte 0 .byte 0
ASM_PFX(16Data): ASM_PFX(16Data):
.word -1 .word -1
.word 0 .word 0
.byte 0 .byte 0
.byte 0x93 .byte 0x93
.byte 0x8f # 16-bit segment, 4GB limit .byte 0x8f # 16-bit segment, 4GB limit
.byte 0 .byte 0
ASM_PFX(32Data): ASM_PFX(32Data):
.word -1 .word -1
.word 0 .word 0
.byte 0 .byte 0
.byte 0x93 .byte 0x93
.byte 0xcf # 16-bit segment, 4GB limit .byte 0xcf # 16-bit segment, 4GB limit
.byte 0 .byte 0
.equ GDT_SIZE, . - ASM_PFX(NullSeg) .equ GDT_SIZE, . - ASM_PFX(NullSeg)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# IA32_REGISTER_SET * # IA32_REGISTER_SET *
# EFIAPI # EFIAPI
# InternalAsmThunk16 ( # InternalAsmThunk16 (
# IN IA32_REGISTER_SET *RegisterSet, # IN IA32_REGISTER_SET *RegisterSet,
# IN OUT VOID *Transition # IN OUT VOID *Transition
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# MISMATCH: "InternalAsmThunk16 PROC USES rbp rbx rsi rdi" # MISMATCH: "InternalAsmThunk16 PROC USES rbp rbx rsi rdi"
.globl ASM_PFX(InternalAsmThunk16) .globl ASM_PFX(InternalAsmThunk16)
ASM_PFX(InternalAsmThunk16): ASM_PFX(InternalAsmThunk16):
pushq %rbp pushq %rbp
pushq %rbx pushq %rbx
pushq %rsi pushq %rsi
pushq %rdi pushq %rdi
movl %ds, %r10d # r9 ~ r11 are not accessible in 16-bit movl %ds, %r10d # r9 ~ r11 are not accessible in 16-bit
movl %es, %r11d # so use them for saving seg registers movl %es, %r11d # so use them for saving seg registers
movl %ss, %r9d movl %ss, %r9d
.byte 0x0f, 0xa0 #push fs .byte 0x0f, 0xa0 #push fs
.byte 0x0f, 0xa8 #push gs .byte 0x0f, 0xa8 #push gs
movq %rcx, %rsi movq %rcx, %rsi
movzwl _SS(%rsi), %r8d movzwl _SS(%rsi), %r8d
movl _ESP(%rsi), %edi movl _ESP(%rsi), %edi
lea -(IA32_REGS_SIZE + 4)(%edi), %rdi lea -(IA32_REGS_SIZE + 4)(%edi), %rdi
imul $16, %r8d, %eax imul $16, %r8d, %eax
movl %edi,%ebx # ebx <- stack for 16-bit code movl %edi,%ebx # ebx <- stack for 16-bit code
pushq $(IA32_REGS_SIZE / 4) pushq $(IA32_REGS_SIZE / 4)
addl %eax,%edi # edi <- linear address of 16-bit stack addl %eax,%edi # edi <- linear address of 16-bit stack
popq %rcx popq %rcx
rep rep
movsl # copy RegSet movsl # copy RegSet
lea (SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx lea (SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx
movl %edx,%eax # eax <- transition code address movl %edx,%eax # eax <- transition code address
andl $0xf,%edx andl $0xf,%edx
shll $12,%eax # segment address in high order 16 bits shll $12,%eax # segment address in high order 16 bits
lea (_BackFromUserCode - ASM_PFX(m16Start))(%rdx), %ax lea (_BackFromUserCode - ASM_PFX(m16Start))(%rdx), %ax
stosl # [edi] <- return address of user code stosl # [edi] <- return address of user code
sgdt (SavedGdt - SavedCr4)(%rcx) sgdt (SavedGdt - SavedCr4)(%rcx)
sidt 0x38(%rsp) sidt 0x38(%rsp)
movq %cr0, %rax movq %cr0, %rax
movl %eax, (SavedCr0 - SavedCr4)(%rcx) movl %eax, (SavedCr0 - SavedCr4)(%rcx)
andl $0x7ffffffe,%eax # clear PE, PG bits andl $0x7ffffffe,%eax # clear PE, PG bits
movq %cr4, %rbp movq %cr4, %rbp
movl %ebp, (%rcx) # save CR4 in SavedCr4 movl %ebp, (%rcx) # save CR4 in SavedCr4
andl $0x300,%ebp # clear all but PCE and OSFXSR bits andl $0x300,%ebp # clear all but PCE and OSFXSR bits
movl %r8d, %esi # esi <- 16-bit stack segment movl %r8d, %esi # esi <- 16-bit stack segment
.byte 0x6a, DATA32 .byte 0x6a, DATA32
popq %rdx popq %rdx
lgdt (_16Gdtr - SavedCr4)(%rcx) lgdt (_16Gdtr - SavedCr4)(%rcx)
movl %edx,%ss movl %edx,%ss
pushfq pushfq
lea -8(%rdx), %edx lea -8(%rdx), %edx
lea L_RetFromRealMode, %r8 lea L_RetFromRealMode, %r8
pushq %r8 pushq %r8
movl %cs, %r8d movl %cs, %r8d
movw %r8w, (SavedCs - SavedCr4)(%rcx) movw %r8w, (SavedCs - SavedCr4)(%rcx)
movq %rsp, %r8 movq %rsp, %r8
.byte 0xff, 0x69 # jmp (_EntryPoint - SavedCr4)(%rcx) .byte 0xff, 0x69 # jmp (_EntryPoint - SavedCr4)(%rcx)
.byte _EntryPoint - SavedCr4 .byte _EntryPoint - SavedCr4
L_RetFromRealMode: L_RetFromRealMode:
popfq popfq
lidt 0x38(%rsp) lidt 0x38(%rsp)
lea -IA32_REGS_SIZE(%rbp), %eax lea -IA32_REGS_SIZE(%rbp), %eax
.byte 0x0f, 0xa9 # pop gs .byte 0x0f, 0xa9 # pop gs
.byte 0x0f, 0xa1 # pop fs .byte 0x0f, 0xa1 # pop fs
movl %r9d, %ss movl %r9d, %ss
movl %r11d, %es movl %r11d, %es
movl %r10d, %ds movl %r10d, %ds
popq %rdi popq %rdi
popq %rsi popq %rsi
popq %rbx popq %rbx
popq %rbp popq %rbp
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Wbinvd.S # Wbinvd.S
# #
# Abstract: # Abstract:
# #
# AsmWbinvd function # AsmWbinvd function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWbinvd ( # AsmWbinvd (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWbinvd) .global ASM_PFX(AsmWbinvd)
.align 16 .align 16
ASM_PFX(AsmWbinvd): ASM_PFX(AsmWbinvd):
wbinvd wbinvd
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr0.S # WriteCr0.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr0 function # AsmWriteCr0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr0 ( # AsmWriteCr0 (
# UINTN Cr0 # UINTN Cr0
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteCr0) .global ASM_PFX(AsmWriteCr0)
ASM_PFX(AsmWriteCr0): ASM_PFX(AsmWriteCr0):
mov %rcx,%cr0 mov %rcx,%cr0
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr2.S # WriteCr2.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr2 function # AsmWriteCr2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr2 ( # AsmWriteCr2 (
# UINTN Cr2 # UINTN Cr2
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteCr2) .global ASM_PFX(AsmWriteCr2)
ASM_PFX(AsmWriteCr2): ASM_PFX(AsmWriteCr2):
mov %rcx,%cr2 mov %rcx,%cr2
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr3.S # WriteCr3.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr3 function # AsmWriteCr3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr3 ( # AsmWriteCr3 (
# UINTN Cr3 # UINTN Cr3
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteCr3) .global ASM_PFX(AsmWriteCr3)
ASM_PFX(AsmWriteCr3): ASM_PFX(AsmWriteCr3):
mov %rcx,%cr3 mov %rcx,%cr3
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr4.S # WriteCr4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr4 function # AsmWriteCr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr4 ( # AsmWriteCr4 (
# UINTN Cr4 # UINTN Cr4
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteCr4) .global ASM_PFX(AsmWriteCr4)
ASM_PFX(AsmWriteCr4): ASM_PFX(AsmWriteCr4):
mov %rcx,%cr4 mov %rcx,%cr4
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr0.S # WriteDr0.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr0 function # AsmWriteDr0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr0 ( # AsmWriteDr0 (
# UINTN Value # UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr0) .global ASM_PFX(AsmWriteDr0)
.align 16 .align 16
ASM_PFX(AsmWriteDr0): ASM_PFX(AsmWriteDr0):
mov %rcx, %dr0 mov %rcx, %dr0
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr1.S # WriteDr1.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr1 function # AsmWriteDr1 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr1 ( # AsmWriteDr1 (
# UINTN Value # UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr1) .global ASM_PFX(AsmWriteDr1)
.align 16 .align 16
ASM_PFX(AsmWriteDr1): ASM_PFX(AsmWriteDr1):
mov %rcx, %dr1 mov %rcx, %dr1
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr2.S # WriteDr2.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr2 function # AsmWriteDr2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr2 ( # AsmWriteDr2 (
# UINTN Value # UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr2) .global ASM_PFX(AsmWriteDr2)
.align 16 .align 16
ASM_PFX(AsmWriteDr2): ASM_PFX(AsmWriteDr2):
mov %rcx, %dr2 mov %rcx, %dr2
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr3.S # WriteDr3.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr3 function # AsmWriteDr3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr3 ( # AsmWriteDr3 (
# UINTN Value # UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr3) .global ASM_PFX(AsmWriteDr3)
.align 16 .align 16
ASM_PFX(AsmWriteDr3): ASM_PFX(AsmWriteDr3):
mov %rcx, %dr3 mov %rcx, %dr3
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr4.S # WriteDr4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr4 function # AsmWriteDr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr4 ( # AsmWriteDr4 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr4) .global ASM_PFX(AsmWriteDr4)
ASM_PFX(AsmWriteDr4): ASM_PFX(AsmWriteDr4):
mov %rcx, %dr4 mov %rcx, %dr4
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr5.S # WriteDr5.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr5 function # AsmWriteDr5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr5 ( # AsmWriteDr5 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr5) .global ASM_PFX(AsmWriteDr5)
ASM_PFX(AsmWriteDr5): ASM_PFX(AsmWriteDr5):
mov %rcx, %dr5 mov %rcx, %dr5
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr6.S # WriteDr6.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr6 function # AsmWriteDr6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr6 ( # AsmWriteDr6 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr6) .global ASM_PFX(AsmWriteDr6)
ASM_PFX(AsmWriteDr6): ASM_PFX(AsmWriteDr6):
mov %rcx, %dr6 mov %rcx, %dr6
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr7.S # WriteDr7.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr7 function # AsmWriteDr7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr7 ( # AsmWriteDr7 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteDr7) .global ASM_PFX(AsmWriteDr7)
ASM_PFX(AsmWriteDr7): ASM_PFX(AsmWriteDr7):
mov %rcx, %dr7 mov %rcx, %dr7
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteGdtr.S # WriteGdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteGdtr function # AsmWriteGdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86WriteGdtr ( # InternalX86WriteGdtr (
# IN CONST IA32_DESCRIPTOR *Idtr # IN CONST IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86WriteGdtr) .global ASM_PFX(InternalX86WriteGdtr)
ASM_PFX(InternalX86WriteGdtr): ASM_PFX(InternalX86WriteGdtr):
lgdt (%rcx) lgdt (%rcx)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteIdtr.S # WriteIdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteIdtr function # AsmWriteIdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86WriteIdtr ( # InternalX86WriteIdtr (
# IN CONST IA32_DESCRIPTOR *Idtr # IN CONST IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(InternalX86WriteIdtr) .global ASM_PFX(InternalX86WriteIdtr)
.align 16 .align 16
ASM_PFX(InternalX86WriteIdtr): ASM_PFX(InternalX86WriteIdtr):
lidt (%rcx) lidt (%rcx)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteLdtr.S # WriteLdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteLdtr function # AsmWriteLdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteLdtr ( # AsmWriteLdtr (
# IN UINT16 Ldtr # IN UINT16 Ldtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteLdtr) .global ASM_PFX(AsmWriteLdtr)
.align 16 .align 16
ASM_PFX(AsmWriteLdtr): ASM_PFX(AsmWriteLdtr):
lldt %cx lldt %cx
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm0.S # WriteMm0.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm0 function # AsmWriteMm0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm0 ( # AsmWriteMm0 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm0) .global ASM_PFX(AsmWriteMm0)
ASM_PFX(AsmWriteMm0): ASM_PFX(AsmWriteMm0):
movd %rcx, %mm0 movd %rcx, %mm0
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm1.S # WriteMm1.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm1 function # AsmWriteMm1 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm1 ( # AsmWriteMm1 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm1) .global ASM_PFX(AsmWriteMm1)
ASM_PFX(AsmWriteMm1): ASM_PFX(AsmWriteMm1):
movd %rcx, %mm1 movd %rcx, %mm1
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm2.S # WriteMm2.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm2 function # AsmWriteMm2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm2 ( # AsmWriteMm2 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm2) .global ASM_PFX(AsmWriteMm2)
ASM_PFX(AsmWriteMm2): ASM_PFX(AsmWriteMm2):
movd %rcx, %mm2 movd %rcx, %mm2
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm3.S # WriteMm3.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm3 function # AsmWriteMm3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm3 ( # AsmWriteMm3 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm3) .global ASM_PFX(AsmWriteMm3)
ASM_PFX(AsmWriteMm3): ASM_PFX(AsmWriteMm3):
movd %rcx, %mm3 movd %rcx, %mm3
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm4.S # WriteMm4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm4 function # AsmWriteMm4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm4 ( # AsmWriteMm4 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm4) .global ASM_PFX(AsmWriteMm4)
ASM_PFX(AsmWriteMm4): ASM_PFX(AsmWriteMm4):
movd %rcx, %mm4 movd %rcx, %mm4
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm5.S # WriteMm5.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm5 function # AsmWriteMm5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm5 ( # AsmWriteMm5 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm5) .global ASM_PFX(AsmWriteMm5)
ASM_PFX(AsmWriteMm5): ASM_PFX(AsmWriteMm5):
movd %rcx, %mm5 movd %rcx, %mm5
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm6.S # WriteMm6.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm6 function # AsmWriteMm6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm6 ( # AsmWriteMm6 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm6) .global ASM_PFX(AsmWriteMm6)
ASM_PFX(AsmWriteMm6): ASM_PFX(AsmWriteMm6):
movd %rcx, %mm6 movd %rcx, %mm6
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm7.S # WriteMm7.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm7 function # AsmWriteMm7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm7 ( # AsmWriteMm7 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMm7) .global ASM_PFX(AsmWriteMm7)
ASM_PFX(AsmWriteMm7): ASM_PFX(AsmWriteMm7):
movd %rcx, %mm7 movd %rcx, %mm7
ret ret

View File

@ -1,39 +1,39 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation # Copyright (c) 2006 - 2008, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMsr64.S # WriteMsr64.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMsr64 function # AsmWriteMsr64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmWriteMsr64 ( # AsmWriteMsr64 (
# IN UINT32 Index, # IN UINT32 Index,
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global ASM_PFX(AsmWriteMsr64) .global ASM_PFX(AsmWriteMsr64)
.align 16 .align 16
ASM_PFX(AsmWriteMsr64): ASM_PFX(AsmWriteMsr64):
mov %rdx, %rax # meanwhile, rax <- return value mov %rdx, %rax # meanwhile, rax <- return value
shr $0x20, %rdx # edx:eax contains the value to write shr $0x20, %rdx # edx:eax contains the value to write
wrmsr wrmsr
ret ret

View File

@ -1,60 +1,60 @@
# #
# ConvertAsm.py: Automatically generated from CompareMem.asm # ConvertAsm.py: Automatically generated from CompareMem.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CompareMem.S # CompareMem.S
# #
# Abstract: # Abstract:
# #
# CompareMem function # CompareMem function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# INTN # INTN
# EFIAPI # EFIAPI
# InternalMemCompareMem ( # InternalMemCompareMem (
# IN CONST VOID *DestinationBuffer, # IN CONST VOID *DestinationBuffer,
# IN CONST VOID *SourceBuffer, # IN CONST VOID *SourceBuffer,
# IN UINTN Length # IN UINTN Length
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemCompareMem) .globl ASM_PFX(InternalMemCompareMem)
ASM_PFX(InternalMemCompareMem): ASM_PFX(InternalMemCompareMem):
push rsi push rsi
push rdi push rdi
mov rsi, rcx mov rsi, rcx
mov rdi, rdx mov rdi, rdx
mov rcx, r8 mov rcx, r8
repe cmpsb repe cmpsb
movzx rax, byte ptr [rsi - 1] movzx rax, byte ptr [rsi - 1]
movzx rdx, byte ptr [rdi - 1] movzx rdx, byte ptr [rdi - 1]
sub rax, rdx sub rax, rdx
pop rdi pop rdi
pop rsi pop rsi
ret ret

View File

@ -1,75 +1,75 @@
# #
# ConvertAsm.py: Automatically generated from CopyMem.asm # ConvertAsm.py: Automatically generated from CopyMem.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CopyMem.S # CopyMem.S
# #
# Abstract: # Abstract:
# #
# CopyMem function # CopyMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# InternalMemCopyMem ( # InternalMemCopyMem (
# IN VOID *Destination, # IN VOID *Destination,
# IN VOID *Source, # IN VOID *Source,
# IN UINTN Count # IN UINTN Count
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemCopyMem) .globl ASM_PFX(InternalMemCopyMem)
ASM_PFX(InternalMemCopyMem): ASM_PFX(InternalMemCopyMem):
push rsi push rsi
push rdi push rdi
mov rsi, rdx # rsi <- Source mov rsi, rdx # rsi <- Source
mov rdi, rcx # rdi <- Destination mov rdi, rcx # rdi <- Destination
lea r9, [rsi + r8 - 1] # r9 <- End of Source lea r9, [rsi + r8 - 1] # r9 <- End of Source
cmp rsi, rdi cmp rsi, rdi
mov rax, rdi # rax <- Destination as return value mov rax, rdi # rax <- Destination as return value
jae L0 jae L0
cmp r9, rdi cmp r9, rdi
jae L_CopyBackward # Copy backward if overlapped jae L_CopyBackward # Copy backward if overlapped
L0: L0:
mov rcx, r8 mov rcx, r8
and r8, 7 and r8, 7
shr rcx, 3 # rcx <- # of Qwords to copy shr rcx, 3 # rcx <- # of Qwords to copy
jz L_CopyBytes jz L_CopyBytes
movd r10, mm0 # (Save mm0 in r10) movd r10, mm0 # (Save mm0 in r10)
L1: L1:
movq mm0, [rsi] movq mm0, [rsi]
movntq [rdi], mm0 movntq [rdi], mm0
add rsi, 8 add rsi, 8
add rdi, 8 add rdi, 8
loop L1 loop L1
mfence mfence
movd mm0, r10 # (Restore mm0) movd mm0, r10 # (Restore mm0)
jmp L_CopyBytes jmp L_CopyBytes
L_CopyBackward: L_CopyBackward:
mov rsi, r9 # rsi <- End of Source mov rsi, r9 # rsi <- End of Source
lea rdi, [rdi + r8 - 1] # rdi <- End of Destination lea rdi, [rdi + r8 - 1] # rdi <- End of Destination
std # set direction flag std # set direction flag
L_CopyBytes: L_CopyBytes:
mov rcx, r8 mov rcx, r8
rep movsb # Copy bytes backward rep movsb # Copy bytes backward
cld cld
pop rdi pop rdi
pop rsi pop rsi
ret ret

View File

@ -1,57 +1,57 @@
# #
# ConvertAsm.py: Automatically generated from ScanMem16.asm # ConvertAsm.py: Automatically generated from ScanMem16.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem16.S # ScanMem16.S
# #
# Abstract: # Abstract:
# #
# ScanMem16 function # ScanMem16 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem16 ( # InternalMemScanMem16 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT16 Value # IN UINT16 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemScanMem16) .globl ASM_PFX(InternalMemScanMem16)
ASM_PFX(InternalMemScanMem16): ASM_PFX(InternalMemScanMem16):
push rdi push rdi
mov rdi, rcx mov rdi, rcx
mov rax, r8 mov rax, r8
mov rcx, rdx mov rcx, rdx
repne scasw repne scasw
lea rax, [rdi - 2] lea rax, [rdi - 2]
cmovnz rax, rcx cmovnz rax, rcx
pop rdi pop rdi
ret ret

View File

@ -1,57 +1,57 @@
# #
# ConvertAsm.py: Automatically generated from ScanMem32.asm # ConvertAsm.py: Automatically generated from ScanMem32.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem32.S # ScanMem32.S
# #
# Abstract: # Abstract:
# #
# ScanMem32 function # ScanMem32 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem32 ( # InternalMemScanMem32 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT32 Value # IN UINT32 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemScanMem32) .globl ASM_PFX(InternalMemScanMem32)
ASM_PFX(InternalMemScanMem32): ASM_PFX(InternalMemScanMem32):
push rdi push rdi
mov rdi, rcx mov rdi, rcx
mov rax, r8 mov rax, r8
mov rcx, rdx mov rcx, rdx
repne scasd repne scasd
lea rax, [rdi - 4] lea rax, [rdi - 4]
cmovnz rax, rcx cmovnz rax, rcx
pop rdi pop rdi
ret ret

View File

@ -1,56 +1,56 @@
# #
# ConvertAsm.py: Automatically generated from ScanMem64.asm # ConvertAsm.py: Automatically generated from ScanMem64.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem64.S # ScanMem64.S
# #
# Abstract: # Abstract:
# #
# ScanMem64 function # ScanMem64 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem64 ( # InternalMemScanMem64 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemScanMem64) .globl ASM_PFX(InternalMemScanMem64)
ASM_PFX(InternalMemScanMem64): ASM_PFX(InternalMemScanMem64):
push rdi push rdi
mov rdi, rcx mov rdi, rcx
mov rax, r8 mov rax, r8
mov rcx, rdx mov rcx, rdx
repne scasq repne scasq
lea rax, [rdi - 8] lea rax, [rdi - 8]
cmovnz rax, rcx cmovnz rax, rcx
pop rdi pop rdi
ret ret

View File

@ -1,57 +1,57 @@
# #
# ConvertAsm.py: Automatically generated from ScanMem8.asm # ConvertAsm.py: Automatically generated from ScanMem8.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem8.S # ScanMem8.S
# #
# Abstract: # Abstract:
# #
# ScanMem8 function # ScanMem8 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem8 ( # InternalMemScanMem8 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT8 Value # IN UINT8 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemScanMem8) .globl ASM_PFX(InternalMemScanMem8)
ASM_PFX(InternalMemScanMem8): ASM_PFX(InternalMemScanMem8):
push rdi push rdi
mov rdi, rcx mov rdi, rcx
mov rcx, rdx mov rcx, rdx
mov rax, r8 mov rax, r8
repne scasb repne scasb
lea rax, [rdi - 1] lea rax, [rdi - 1]
cmovnz rax, rcx # set rax to 0 if not found cmovnz rax, rcx # set rax to 0 if not found
pop rdi pop rdi
ret ret

View File

@ -1,62 +1,62 @@
# #
# ConvertAsm.py: Automatically generated from SetMem.asm # ConvertAsm.py: Automatically generated from SetMem.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetMem.S # SetMem.S
# #
# Abstract: # Abstract:
# #
# SetMem function # SetMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# InternalMemSetMem ( # InternalMemSetMem (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Count, # IN UINTN Count,
# IN UINT8 Value # IN UINT8 Value
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemSetMem) .globl ASM_PFX(InternalMemSetMem)
ASM_PFX(InternalMemSetMem): ASM_PFX(InternalMemSetMem):
push rdi push rdi
mov rax, r8 mov rax, r8
mov ah, al mov ah, al
movq mm0, rax movq mm0, rax
mov r8, rcx mov r8, rcx
mov rdi, r8 # rdi <- Buffer mov rdi, r8 # rdi <- Buffer
mov rcx, rdx mov rcx, rdx
and edx, 7 and edx, 7
shr rcx, 3 shr rcx, 3
jz L_SetBytes jz L_SetBytes
pshufw mm0, mm0, 0x0 pshufw mm0, mm0, 0x0
L0: L0:
movntq [rdi], mm0 movntq [rdi], mm0
add rdi, 8 add rdi, 8
loop L0 loop L0
mfence mfence
L_SetBytes: L_SetBytes:
mov ecx, edx mov ecx, edx
rep stosb rep stosb
mov rax, r8 mov rax, r8
pop rdi pop rdi
ret ret

View File

@ -1,61 +1,61 @@
# #
# ConvertAsm.py: Automatically generated from SetMem16.asm # ConvertAsm.py: Automatically generated from SetMem16.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetMem16.S # SetMem16.S
# #
# Abstract: # Abstract:
# #
# SetMem16 function # SetMem16 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# InternalMemSetMem16 ( # InternalMemSetMem16 (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Count, # IN UINTN Count,
# IN UINT16 Value # IN UINT16 Value
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemSetMem16) .globl ASM_PFX(InternalMemSetMem16)
ASM_PFX(InternalMemSetMem16): ASM_PFX(InternalMemSetMem16):
push rdi push rdi
mov rax, r8 mov rax, r8
movq mm0, rax movq mm0, rax
mov r8, rcx mov r8, rcx
mov rdi, r8 mov rdi, r8
mov rcx, rdx mov rcx, rdx
and edx, 3 and edx, 3
shr rcx, 2 shr rcx, 2
jz L_SetWords jz L_SetWords
pshufw mm0, mm0, 0x0 pshufw mm0, mm0, 0x0
L0: L0:
movntq [rdi], mm0 movntq [rdi], mm0
add rdi, 8 add rdi, 8
loop L0 loop L0
mfence mfence
L_SetWords: L_SetWords:
mov ecx, edx mov ecx, edx
rep stosw rep stosw
mov rax, r8 mov rax, r8
pop rdi pop rdi
ret ret

View File

@ -1,56 +1,56 @@
# #
# ConvertAsm.py: Automatically generated from SetMem32.asm # ConvertAsm.py: Automatically generated from SetMem32.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetMem32.S # SetMem32.S
# #
# Abstract: # Abstract:
# #
# SetMem32 function # SetMem32 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# InternalMemSetMem32 ( # InternalMemSetMem32 (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Count, # IN UINTN Count,
# IN UINT32 Value # IN UINT32 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemSetMem32) .globl ASM_PFX(InternalMemSetMem32)
ASM_PFX(InternalMemSetMem32): ASM_PFX(InternalMemSetMem32):
movq mm0, r8 # mm0 <- Value movq mm0, r8 # mm0 <- Value
mov rax, rcx # rax <- Buffer mov rax, rcx # rax <- Buffer
xchg rcx, rdx # rcx <- Count rdx <- Buffer xchg rcx, rdx # rcx <- Count rdx <- Buffer
shr rcx, 1 # rcx <- # of qwords to set shr rcx, 1 # rcx <- # of qwords to set
jz L_SetDwords jz L_SetDwords
pshufw mm0, mm0, 0x44 pshufw mm0, mm0, 0x44
L0: L0:
movntq [rdx], mm0 movntq [rdx], mm0
lea rdx, [rdx + 8] # use "lea" to avoid flag changes lea rdx, [rdx + 8] # use "lea" to avoid flag changes
loop L0 loop L0
mfence mfence
L_SetDwords: L_SetDwords:
jnc L1 jnc L1
movd [rdx], mm0 movd [rdx], mm0
L1: L1:
ret ret

View File

@ -1,48 +1,48 @@
# #
# ConvertAsm.py: Automatically generated from SetMem64.asm # ConvertAsm.py: Automatically generated from SetMem64.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetMem64.S # SetMem64.S
# #
# Abstract: # Abstract:
# #
# SetMem64 function # SetMem64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# InternalMemSetMem64 ( # InternalMemSetMem64 (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Count, # IN UINTN Count,
# IN UINT64 Value # IN UINT64 Value
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemSetMem64) .globl ASM_PFX(InternalMemSetMem64)
ASM_PFX(InternalMemSetMem64): ASM_PFX(InternalMemSetMem64):
movq mm0, r8 #Value movq mm0, r8 #Value
mov rax, rcx #rax <- Buffer mov rax, rcx #rax <- Buffer
xchg rcx, rdx #rcx <- Count xchg rcx, rdx #rcx <- Count
L0: L0:
movntq [rdx], mm0 movntq [rdx], mm0
add rdx, 8 add rdx, 8
loop L0 loop L0
mfence mfence
ret ret

View File

@ -1,58 +1,58 @@
# #
# ConvertAsm.py: Automatically generated from ZeroMem.asm # ConvertAsm.py: Automatically generated from ZeroMem.asm
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ZeroMem.S # ZeroMem.S
# #
# Abstract: # Abstract:
# #
# ZeroMem function # ZeroMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# InternalMemZeroMem ( # InternalMemZeroMem (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Count # IN UINTN Count
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.intel_syntax noprefix .intel_syntax noprefix
.globl ASM_PFX(InternalMemZeroMem) .globl ASM_PFX(InternalMemZeroMem)
ASM_PFX(InternalMemZeroMem): ASM_PFX(InternalMemZeroMem):
push rdi push rdi
mov rdi, rcx mov rdi, rcx
mov rcx, rdx mov rcx, rdx
mov r8, rdi mov r8, rdi
and edx, 7 and edx, 7
shr rcx, 3 shr rcx, 3
jz L_ZeroBytes jz L_ZeroBytes
pxor mm0, mm0 pxor mm0, mm0
L0: L0:
movntq [rdi], mm0 movntq [rdi], mm0
add rdi, 8 add rdi, 8
loop L0 loop L0
mfence mfence
L_ZeroBytes: L_ZeroBytes:
xor eax, eax xor eax, eax
mov ecx, edx mov ecx, edx
rep stosb rep stosb
mov rax, r8 mov rax, r8
pop rdi pop rdi
ret ret

View File

@ -1,55 +1,55 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CompareMem.S # CompareMem.S
# #
# Abstract: # Abstract:
# #
# CompareMem function # CompareMem function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMemCompareMem) .globl ASM_PFX(InternalMemCompareMem)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# INTN # INTN
# EFIAPI # EFIAPI
# InternalMemCompareMem ( # InternalMemCompareMem (
# IN CONST VOID *DestinationBuffer, # IN CONST VOID *DestinationBuffer,
# IN CONST VOID *SourceBuffer, # IN CONST VOID *SourceBuffer,
# IN UINTN Length # IN UINTN Length
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMemCompareMem): ASM_PFX(InternalMemCompareMem):
push %esi push %esi
push %edi push %edi
movl 12(%esp), %esi movl 12(%esp), %esi
movl 16(%esp), %edi movl 16(%esp), %edi
movl 20(%esp), %ecx movl 20(%esp), %ecx
repe cmpsb repe cmpsb
movzbl -1(%esi), %eax movzbl -1(%esi), %eax
movzbl -1(%edi), %edx movzbl -1(%edi), %edx
subl %edx, %eax subl %edx, %eax
pop %edi pop %edi
pop %esi pop %esi
ret ret

View File

@ -1,85 +1,85 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CopyMem.S # CopyMem.S
# #
# Abstract: # Abstract:
# #
# CopyMem function # CopyMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMemCopyMem) .globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# InternalMemCopyMem ( # InternalMemCopyMem (
# IN VOID *Destination, # IN VOID *Destination,
# IN VOID *Source, # IN VOID *Source,
# IN UINTN Count # IN UINTN Count
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMemCopyMem): ASM_PFX(InternalMemCopyMem):
push %esi push %esi
push %edi push %edi
movl 16(%esp), %esi # esi <- Source movl 16(%esp), %esi # esi <- Source
movl 12(%esp), %edi # edi <- Destination movl 12(%esp), %edi # edi <- Destination
movl 20(%esp), %edx # edx <- Count movl 20(%esp), %edx # edx <- Count
leal -1(%esi,%edx,), %eax # eax <- End of Source leal -1(%esi,%edx,), %eax # eax <- End of Source
cmpl %edi, %esi cmpl %edi, %esi
jae L0 jae L0
cmpl %edi, %eax # Overlapped? cmpl %edi, %eax # Overlapped?
jae L_CopyBackward # Copy backward if overlapped jae L_CopyBackward # Copy backward if overlapped
L0: L0:
xorl %ecx, %ecx xorl %ecx, %ecx
subl %edi, %ecx subl %edi, %ecx
andl $15, %ecx # ecx + edi aligns on 16-byte boundary andl $15, %ecx # ecx + edi aligns on 16-byte boundary
jz L1 jz L1
cmpl %edx, %ecx cmpl %edx, %ecx
cmova %edx, %ecx cmova %edx, %ecx
subl %ecx, %edx # edx <- remaining bytes to copy subl %ecx, %edx # edx <- remaining bytes to copy
rep rep
movsb movsb
L1: L1:
movl %edx, %ecx movl %edx, %ecx
andl $15, %edx andl $15, %edx
shrl $4, %ecx # ecx <- # of DQwords to copy shrl $4, %ecx # ecx <- # of DQwords to copy
jz L_CopyBytes jz L_CopyBytes
addl $-16, %esp addl $-16, %esp
movdqu %xmm0, (%esp) movdqu %xmm0, (%esp)
L2: L2:
movdqu (%esi), %xmm0 movdqu (%esi), %xmm0
movntdq %xmm0, (%edi) movntdq %xmm0, (%edi)
addl $16, %esi addl $16, %esi
addl $16, %edi addl $16, %edi
loop L2 loop L2
mfence mfence
movdqu (%esp),%xmm0 movdqu (%esp),%xmm0
addl $16, %esp # stack cleanup addl $16, %esp # stack cleanup
jmp L_CopyBytes jmp L_CopyBytes
L_CopyBackward: L_CopyBackward:
movl %eax, %esi # esi <- Last byte in Source movl %eax, %esi # esi <- Last byte in Source
leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination
std std
L_CopyBytes: L_CopyBytes:
movl %edx, %ecx movl %edx, %ecx
rep rep
movsb movsb
cld cld
movl 12(%esp), %eax # eax <- Destination as return value movl 12(%esp), %eax # eax <- Destination as return value
pop %edi pop %edi
pop %esi pop %esi
ret ret

View File

@ -1,52 +1,52 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem16.Asm # ScanMem16.Asm
# #
# Abstract: # Abstract:
# #
# ScanMem16 function # ScanMem16 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMemScanMem16) .globl ASM_PFX(InternalMemScanMem16)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem16 ( # InternalMemScanMem16 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT16 Value # IN UINT16 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMemScanMem16): ASM_PFX(InternalMemScanMem16):
push %edi push %edi
movl 12(%esp), %ecx movl 12(%esp), %ecx
movl 8(%esp), %edi movl 8(%esp), %edi
movl 16(%esp), %eax movl 16(%esp), %eax
repne scasw repne scasw
leal -2(%edi), %eax leal -2(%edi), %eax
cmovnz %ecx, %eax cmovnz %ecx, %eax
pop %edi pop %edi
ret ret

View File

@ -1,52 +1,52 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation # Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ScanMem32.S # ScanMem32.S
# #
# Abstract: # Abstract:
# #
# ScanMem32 function # ScanMem32 function
# #
# Notes: # Notes:
# #
# The following BaseMemoryLib instances contain the same copy of this file: # The following BaseMemoryLib instances contain the same copy of this file:
# #
# BaseMemoryLibRepStr # BaseMemoryLibRepStr
# BaseMemoryLibMmx # BaseMemoryLibMmx
# BaseMemoryLibSse2 # BaseMemoryLibSse2
# BaseMemoryLibOptDxe # BaseMemoryLibOptDxe
# BaseMemoryLibOptPei # BaseMemoryLibOptPei
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalMemScanMem32) .globl ASM_PFX(InternalMemScanMem32)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# CONST VOID * # CONST VOID *
# EFIAPI # EFIAPI
# InternalMemScanMem32 ( # InternalMemScanMem32 (
# IN CONST VOID *Buffer, # IN CONST VOID *Buffer,
# IN UINTN Length, # IN UINTN Length,
# IN UINT32 Value # IN UINT32 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(InternalMemScanMem32): ASM_PFX(InternalMemScanMem32):
push %edi push %edi
movl 12(%esp), %ecx movl 12(%esp), %ecx
movl 8(%esp), %edi movl 8(%esp), %edi
movl 16(%esp), %eax movl 16(%esp), %eax
repne scasl repne scasl
leal -4(%edi), %eax leal -4(%edi), %eax
cmovnz %ecx, %eax cmovnz %ecx, %eax
pop %edi pop %edi
ret ret

Some files were not shown because too many files have changed in this diff Show More