From: bbahnsen Date: Tue, 20 Jun 2006 21:50:44 +0000 (+0000) Subject: Use capital S for GCC assembly. This enables pre-processing for PCD support. X-Git-Tag: edk2-stable201903~25212 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=975201130c7223ef29be7a28500ed107623fc4be Use capital S for GCC assembly. This enables pre-processing for PCD support. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@576 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S new file mode 100644 index 0000000000..d6af974d0f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ARShiftU64.asm +# +# Abstract: +# +# 64-bit arithmetic right shift function for IA-32 +# +#------------------------------------------------------------------------------ + + + + + +.global _ARShiftU64 +_ARShiftU64: + movb 12(%esp),%cl + movl 8(%esp),%eax + cltd + testb $32,%cl +# MISMATCH: " cmovz edx, eax" + cmovz %eax, %edx +# MISMATCH: " cmovz eax, [esp + 4]" + cmovz 4(%esp), %eax + shrdl %cl,%edx,%eax + sar %cl,%edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.s b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.s deleted file mode 100644 index d6af974d0f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ARShiftU64.asm -# -# Abstract: -# -# 64-bit arithmetic right shift function for IA-32 -# -#------------------------------------------------------------------------------ - - - - - -.global _ARShiftU64 -_ARShiftU64: - movb 12(%esp),%cl - movl 8(%esp),%eax - cltd - testb $32,%cl -# MISMATCH: " cmovz edx, eax" - cmovz %eax, %edx -# MISMATCH: " cmovz eax, [esp + 4]" - cmovz 4(%esp), %eax - shrdl %cl,%edx,%eax - sar %cl,%edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S new file mode 100644 index 0000000000..859369e50f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ ; +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuBreakpoint.s +# +# Abstract: +# +# CpuBreakpoint function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# CpuBreakpoint ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _CpuBreakpoint +_CpuBreakpoint: + int $3 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.s b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.s deleted file mode 100644 index 859369e50f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ ; -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuBreakpoint.s -# -# Abstract: -# -# CpuBreakpoint function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# CpuBreakpoint ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _CpuBreakpoint -_CpuBreakpoint: - int $3 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.S b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.S new file mode 100644 index 0000000000..1d85fa77da --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ ; +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuFlushTlb.Asm +# +# Abstract: +# +# CpuFlushTlb function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# CpuFlushTlb ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _CpuFlushTlb +_CpuFlushTlb: + movl %cr3, %eax + movl %eax, %cr3 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.s b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.s deleted file mode 100644 index 1d85fa77da..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ ; -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuFlushTlb.Asm -# -# Abstract: -# -# CpuFlushTlb function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# CpuFlushTlb ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _CpuFlushTlb -_CpuFlushTlb: - movl %cr3, %eax - movl %eax, %cr3 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/CpuId.S b/MdePkg/Library/BaseLib/Ia32/CpuId.S new file mode 100644 index 0000000000..989daba127 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuId.S @@ -0,0 +1,63 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuId.Asm +# +# Abstract: +# +# AsmCpuid function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmCpuid ( +# IN UINT32 RegisterInEax, +# OUT UINT32 *RegisterOutEax OPTIONAL, +# OUT UINT32 *RegisterOutEbx OPTIONAL, +# OUT UINT32 *RegisterOutEcx OPTIONAL, +# OUT UINT32 *RegisterOutEdx OPTIONAL +# ) +#------------------------------------------------------------------------------ +.globl _AsmCpuid +_AsmCpuid: + push %ebx + push %edi + movl 12(%esp),%eax + cpuid + movl %ecx,%edi + movl 16(%esp),%ecx + jecxz L1 + movl %eax,(%ecx) +L1: + movl 20(%esp),%ecx + jecxz L2 + movl %ebx,(%ecx) +L2: + movl 24(%esp),%ecx + jecxz L3 + movl %edi,(%ecx) +L3: + movl 28(%esp),%ecx + jecxz L4 + movl %edx,(%ecx) +L4: + pop %edi + pop %ebx + ret diff --git a/MdePkg/Library/BaseLib/Ia32/CpuId.s b/MdePkg/Library/BaseLib/Ia32/CpuId.s deleted file mode 100644 index 989daba127..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuId.s +++ /dev/null @@ -1,63 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuId.Asm -# -# Abstract: -# -# AsmCpuid function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmCpuid ( -# IN UINT32 RegisterInEax, -# OUT UINT32 *RegisterOutEax OPTIONAL, -# OUT UINT32 *RegisterOutEbx OPTIONAL, -# OUT UINT32 *RegisterOutEcx OPTIONAL, -# OUT UINT32 *RegisterOutEdx OPTIONAL -# ) -#------------------------------------------------------------------------------ -.globl _AsmCpuid -_AsmCpuid: - push %ebx - push %edi - movl 12(%esp),%eax - cpuid - movl %ecx,%edi - movl 16(%esp),%ecx - jecxz L1 - movl %eax,(%ecx) -L1: - movl 20(%esp),%ecx - jecxz L2 - movl %ebx,(%ecx) -L2: - movl 24(%esp),%ecx - jecxz L3 - movl %edi,(%ecx) -L3: - movl 28(%esp),%ecx - jecxz L4 - movl %edx,(%ecx) -L4: - pop %edi - pop %ebx - ret diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S new file mode 100644 index 0000000000..43c23b6415 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S @@ -0,0 +1,67 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuIdEx.Asm +# +# Abstract: +# +# AsmCpuidEx function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + .code: + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# AsmCpuidEx ( +# IN UINT32 RegisterInEax, +# IN UINT32 RegisterInEcx, +# OUT UINT32 *RegisterOutEax OPTIONAL, +# OUT UINT32 *RegisterOutEbx OPTIONAL, +# OUT UINT32 *RegisterOutEcx OPTIONAL, +# OUT UINT32 *RegisterOutEdx OPTIONAL +# ) +#------------------------------------------------------------------------------ +.globl _AsmCpuidEx +_AsmCpuidEx: + push %ebx + pushl %ebp + movl %esp, %ebp + movl 12(%ebp), %eax + movl 16(%ebp), %ecx + cpuid + pushl %ecx + movl 20(%ebp), %ecx + jecxz L1 + movl %eax, (%ecx) +L1: + movl 24(%ebp), %ecx + jecxz L2 + movl %ebx, (%ecx) +L2: + movl 28(%ebp), %ecx + jecxz L3 + popl %ecx +L3: + movl 32(%ebp), %edx + jecxz L4 + movl %edx, (%ecx) +L4: + movl 12(%ebp), %eax + pop %ebx + leave + ret diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.s b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.s deleted file mode 100644 index 43c23b6415..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.s +++ /dev/null @@ -1,67 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuIdEx.Asm -# -# Abstract: -# -# AsmCpuidEx function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - .code: - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# AsmCpuidEx ( -# IN UINT32 RegisterInEax, -# IN UINT32 RegisterInEcx, -# OUT UINT32 *RegisterOutEax OPTIONAL, -# OUT UINT32 *RegisterOutEbx OPTIONAL, -# OUT UINT32 *RegisterOutEcx OPTIONAL, -# OUT UINT32 *RegisterOutEdx OPTIONAL -# ) -#------------------------------------------------------------------------------ -.globl _AsmCpuidEx -_AsmCpuidEx: - push %ebx - pushl %ebp - movl %esp, %ebp - movl 12(%ebp), %eax - movl 16(%ebp), %ecx - cpuid - pushl %ecx - movl 20(%ebp), %ecx - jecxz L1 - movl %eax, (%ecx) -L1: - movl 24(%ebp), %ecx - jecxz L2 - movl %ebx, (%ecx) -L2: - movl 28(%ebp), %ecx - jecxz L3 - popl %ecx -L3: - movl 32(%ebp), %edx - jecxz L4 - movl %edx, (%ecx) -L4: - movl 12(%ebp), %eax - pop %ebx - leave - ret diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.S b/MdePkg/Library/BaseLib/Ia32/CpuPause.S new file mode 100644 index 0000000000..ace2c6764a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuPause.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ ; +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuPause.Asm +# +# Abstract: +# +# CpuPause function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# CpuPause ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _CpuPause +_CpuPause: + pause + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.s b/MdePkg/Library/BaseLib/Ia32/CpuPause.s deleted file mode 100644 index ace2c6764a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuPause.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ ; -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuPause.Asm -# -# Abstract: -# -# CpuPause function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# CpuPause ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _CpuPause -_CpuPause: - pause - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.S b/MdePkg/Library/BaseLib/Ia32/CpuSleep.S new file mode 100644 index 0000000000..9b7713128f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/CpuSleep.S @@ -0,0 +1,40 @@ +#------------------------------------------------------------------------------ ; +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuSleep.Asm +# +# Abstract: +# +# CpuSleep function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# CpuSleep ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _CpuSleep +_CpuSleep: + hlt + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.s b/MdePkg/Library/BaseLib/Ia32/CpuSleep.s deleted file mode 100644 index 9b7713128f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/CpuSleep.s +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------ ; -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuSleep.Asm -# -# Abstract: -# -# CpuSleep function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# CpuSleep ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _CpuSleep -_CpuSleep: - hlt - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S new file mode 100644 index 0000000000..cc9c95c30f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DisableInterrupts.Asm +# +# Abstract: +# +# DisableInterrupts function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# DisableInterrupts ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _DisableInterrupts +_DisableInterrupts: + cli + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.s b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.s deleted file mode 100644 index cc9c95c30f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DisableInterrupts.Asm -# -# Abstract: -# -# DisableInterrupts function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# DisableInterrupts ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _DisableInterrupts -_DisableInterrupts: - cli - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S new file mode 100644 index 0000000000..21e8a82c0e --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DisablePaging32.Asm +# +# Abstract: +# +# AsmDisablePaging32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmDisablePaging32 ( +# IN SWITCH_STACK_ENTRY_POINT EntryPoint, +# IN VOID *Context1, OPTIONAL +# IN VOID *Context2, OPTIONAL +# IN VOID *NewStack +# ); +#------------------------------------------------------------------------------ +.global _AsmDisablePaging32 +_AsmDisablePaging32: + movl 4(%esp),%ebx + movl 8(%esp),%ecx + movl 12(%esp),%edx + pushfl + popl %edi + cli + movl %cr0, %eax + btrl $31,%eax + movl 16(%esp),%esp + movl %eax, %cr0 + pushl %edi + popfl + pushl %edx + pushl %ecx + call *%ebx + jmp . + + + diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.s b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.s deleted file mode 100644 index 21e8a82c0e..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.s +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DisablePaging32.Asm -# -# Abstract: -# -# AsmDisablePaging32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmDisablePaging32 ( -# IN SWITCH_STACK_ENTRY_POINT EntryPoint, -# IN VOID *Context1, OPTIONAL -# IN VOID *Context2, OPTIONAL -# IN VOID *NewStack -# ); -#------------------------------------------------------------------------------ -.global _AsmDisablePaging32 -_AsmDisablePaging32: - movl 4(%esp),%ebx - movl 8(%esp),%ecx - movl 12(%esp),%edx - pushfl - popl %edi - cli - movl %cr0, %eax - btrl $31,%eax - movl 16(%esp),%esp - movl %eax, %cr0 - pushl %edi - popfl - pushl %edx - pushl %ecx - call *%ebx - jmp . - - - diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32.S b/MdePkg/Library/BaseLib/Ia32/DivU64x32.S new file mode 100644 index 0000000000..89d754614a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x32.S @@ -0,0 +1,35 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DivU64x32.asm +# +# Abstract: +# +# Calculate the quotient of a 64-bit integer by a 32-bit integer +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMathDivU64x32 +_InternalMathDivU64x32: + movl 8(%esp),%eax + movl 12(%esp),%ecx + xorl %edx,%edx + divl %ecx + pushl %eax + movl 8(%esp),%eax + divl %ecx + popl %edx + ret diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32.s b/MdePkg/Library/BaseLib/Ia32/DivU64x32.s deleted file mode 100644 index 89d754614a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x32.s +++ /dev/null @@ -1,35 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DivU64x32.asm -# -# Abstract: -# -# Calculate the quotient of a 64-bit integer by a 32-bit integer -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMathDivU64x32 -_InternalMathDivU64x32: - movl 8(%esp),%eax - movl 12(%esp),%ecx - xorl %edx,%edx - divl %ecx - pushl %eax - movl 8(%esp),%eax - divl %ecx - popl %edx - ret diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S new file mode 100644 index 0000000000..1f34f18255 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DivError.asm +# +# Abstract: +# +# Set error flag for all division functions +# +#------------------------------------------------------------------------------ + + + + + +.global _InternalMathDivRemU64x32 +_InternalMathDivRemU64x32: + movl 12(%esp),%ecx + movl 8(%esp),%eax + xorl %edx,%edx + divl %ecx + pushl %eax + movl 8(%esp),%eax + divl %ecx + movl 20(%esp),%ecx + jecxz L1 + movl %edx,(%ecx) +L1: + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.s b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.s deleted file mode 100644 index 1f34f18255..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DivError.asm -# -# Abstract: -# -# Set error flag for all division functions -# -#------------------------------------------------------------------------------ - - - - - -.global _InternalMathDivRemU64x32 -_InternalMathDivRemU64x32: - movl 12(%esp),%ecx - movl 8(%esp),%eax - xorl %edx,%edx - divl %ecx - pushl %eax - movl 8(%esp),%eax - divl %ecx - movl 20(%esp),%ecx - jecxz L1 - movl %edx,(%ecx) -L1: - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S new file mode 100644 index 0000000000..f604f7c72e --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S @@ -0,0 +1,89 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DivU64x64Remainder.asm +# +# Abstract: +# +# Calculate the quotient of a 64-bit integer by a 64-bit integer and returns +# both the quotient and the remainder +# +#------------------------------------------------------------------------------ + + + + + +.extern _InternalMathDivRemU64x32 + +.global _InternalMathDivRemU64x64 +_InternalMathDivRemU64x64: + movl 16(%esp),%ecx + testl %ecx,%ecx + jnz _DivRemU64x64 + movl 20(%esp),%ecx + jecxz L1 + and $0,4(%ecx) + movl %ecx,16(%esp) +L1: + jmp _InternalMathDivRemU64x32 + + +.global DivRemU64x64 +DivRemU64x64: +# MISMATCH: "DivRemU64x64: USES ebx esi edi" + push %ebx + push %esi + push %edi + mov 20(%esp), %edx + mov 16(%esp), %eax + movl %edx,%edi + movl %eax,%esi + mov 24(%esp), %ebx +L2: + shrl %edx + rcrl $1,%eax + shrdl $1,%ecx,%ebx + shrl %ecx + jnz L2 + divl %ebx + movl %eax,%ebx + movl 28(%esp),%ecx + mull 24(%esp) + imull %ebx,%ecx + addl %ecx,%edx + mov 32(%esp), %ecx + jc TooLarge + cmpl %edx,%edi + ja Correct + jb TooLarge + cmpl %eax,%esi + jae Correct +TooLarge: + decl %ebx + jecxz Return + sub 24(%esp), %eax + sbb 28(%esp), %edx +Correct: + jecxz Return + subl %eax,%esi + sbbl %edx,%edi + movl %esi,(%ecx) + movl %edi,4(%ecx) +Return: + movl %ebx,%eax + xorl %edx,%edx + push %edi + push %esi + push %ebx + ret diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.s b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.s deleted file mode 100644 index f604f7c72e..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.s +++ /dev/null @@ -1,89 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DivU64x64Remainder.asm -# -# Abstract: -# -# Calculate the quotient of a 64-bit integer by a 64-bit integer and returns -# both the quotient and the remainder -# -#------------------------------------------------------------------------------ - - - - - -.extern _InternalMathDivRemU64x32 - -.global _InternalMathDivRemU64x64 -_InternalMathDivRemU64x64: - movl 16(%esp),%ecx - testl %ecx,%ecx - jnz _DivRemU64x64 - movl 20(%esp),%ecx - jecxz L1 - and $0,4(%ecx) - movl %ecx,16(%esp) -L1: - jmp _InternalMathDivRemU64x32 - - -.global DivRemU64x64 -DivRemU64x64: -# MISMATCH: "DivRemU64x64: USES ebx esi edi" - push %ebx - push %esi - push %edi - mov 20(%esp), %edx - mov 16(%esp), %eax - movl %edx,%edi - movl %eax,%esi - mov 24(%esp), %ebx -L2: - shrl %edx - rcrl $1,%eax - shrdl $1,%ecx,%ebx - shrl %ecx - jnz L2 - divl %ebx - movl %eax,%ebx - movl 28(%esp),%ecx - mull 24(%esp) - imull %ebx,%ecx - addl %ecx,%edx - mov 32(%esp), %ecx - jc TooLarge - cmpl %edx,%edi - ja Correct - jb TooLarge - cmpl %eax,%esi - jae Correct -TooLarge: - decl %ebx - jecxz Return - sub 24(%esp), %eax - sbb 28(%esp), %edx -Correct: - jecxz Return - subl %eax,%esi - sbbl %edx,%edi - movl %esi,(%ecx) - movl %edi,4(%ecx) -Return: - movl %ebx,%eax - xorl %edx,%edx - push %edi - push %esi - push %ebx - ret diff --git a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S new file mode 100644 index 0000000000..80362a95b2 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnableDisableInterrupts.Asm +# +# Abstract: +# +# EnableDisableInterrupts function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# EnableDisableInterrupts ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _EnableDisableInterrupts +_EnableDisableInterrupts: + sti + cli + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.s b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.s deleted file mode 100644 index 80362a95b2..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# EnableDisableInterrupts.Asm -# -# Abstract: -# -# EnableDisableInterrupts function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# EnableDisableInterrupts ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _EnableDisableInterrupts -_EnableDisableInterrupts: - sti - cli - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.S b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.S new file mode 100644 index 0000000000..74413d83b6 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnableInterrupts.Asm +# +# Abstract: +# +# EnableInterrupts function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# EnableInterrupts ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _EnableInterrupts +_EnableInterrupts: + sti + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.s b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.s deleted file mode 100644 index 74413d83b6..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# EnableInterrupts.Asm -# -# Abstract: -# -# EnableInterrupts function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# EnableInterrupts ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _EnableInterrupts -_EnableInterrupts: - sti - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S new file mode 100644 index 0000000000..6f9befcb4a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnablePaging32.Asm +# +# Abstract: +# +# AsmEnablePaging32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmEnablePaging32 ( +# IN SWITCH_STACK_ENTRY_POINT EntryPoint, +# IN VOID *Context1, OPTIONAL +# IN VOID *Context2, OPTIONAL +# IN VOID *NewStack +# ); +#------------------------------------------------------------------------------ +.global _AsmEnablePaging32 +_AsmEnablePaging32: + movl 4(%esp),%ebx + movl 8(%esp),%ecx + movl 12(%esp),%edx + pushfl + popl %edi + cli + movl %cr0, %eax + btsl $31,%eax + movl 16(%esp),%esp + movl %eax, %cr0 + pushl %edi + popfl + pushl %edx + pushl %ecx + call *%ebx + jmp . + + + diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.s b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.s deleted file mode 100644 index 6f9befcb4a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.s +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# EnablePaging32.Asm -# -# Abstract: -# -# AsmEnablePaging32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmEnablePaging32 ( -# IN SWITCH_STACK_ENTRY_POINT EntryPoint, -# IN VOID *Context1, OPTIONAL -# IN VOID *Context2, OPTIONAL -# IN VOID *NewStack -# ); -#------------------------------------------------------------------------------ -.global _AsmEnablePaging32 -_AsmEnablePaging32: - movl 4(%esp),%ebx - movl 8(%esp),%ecx - movl 12(%esp),%edx - pushfl - popl %edi - cli - movl %cr0, %eax - btsl $31,%eax - movl 16(%esp),%esp - movl %eax, %cr0 - pushl %edi - popfl - pushl %edx - pushl %ecx - call *%ebx - jmp . - - - diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S new file mode 100644 index 0000000000..b365ea762a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S @@ -0,0 +1,66 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnablePaging64.Asm +# +# Abstract: +# +# AsmEnablePaging64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + #.MODEL flat + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmEnablePaging64 ( +# IN UINT16 CodeSelector, +# IN UINT64 EntryPoint, +# IN UINT64 Context1, OPTIONAL +# IN UINT64 Context2, OPTIONAL +# IN UINT64 NewStack +# ); +#------------------------------------------------------------------------------ +.global _AsmEnablePaging64 +_AsmEnablePaging64: + cli + movl $$LongStart, (%esp) + movl %cr4, %eax + orb $0x20, %al + movl %eax, %cr4 # enable PAE + movl $0xc0000080, %ecx + rdmsr + orb $1, %ah # set LME + wrmsr + movl %cr0, %eax + btsl $31, %eax + movl %eax, %cr0 # enable paging + lret +LongStart: # long mode starts here + .byte 0x67,0x48 + movl (%esp), %ebx # mov rbx, [esp] + .byte 0x67,0x48 + movl 8(%esp), %ecx # mov rcx, [esp + 8] + .byte 0x67,0x48 + movl 0x10(%esp), %edx # mov rdx, [esp + 10h] + .byte 0x67,0x48 + movl 0x18(%esp), %esp # mov rsp, [esp + 18h] + .byte 0x48 + addl $0x-20, %esp # add rsp, -20h + call *%ebx # call rbx + jmp . diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.s b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.s deleted file mode 100644 index b365ea762a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.s +++ /dev/null @@ -1,66 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# EnablePaging64.Asm -# -# Abstract: -# -# AsmEnablePaging64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - #.MODEL flat - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmEnablePaging64 ( -# IN UINT16 CodeSelector, -# IN UINT64 EntryPoint, -# IN UINT64 Context1, OPTIONAL -# IN UINT64 Context2, OPTIONAL -# IN UINT64 NewStack -# ); -#------------------------------------------------------------------------------ -.global _AsmEnablePaging64 -_AsmEnablePaging64: - cli - movl $$LongStart, (%esp) - movl %cr4, %eax - orb $0x20, %al - movl %eax, %cr4 # enable PAE - movl $0xc0000080, %ecx - rdmsr - orb $1, %ah # set LME - wrmsr - movl %cr0, %eax - btsl $31, %eax - movl %eax, %cr0 # enable paging - lret -LongStart: # long mode starts here - .byte 0x67,0x48 - movl (%esp), %ebx # mov rbx, [esp] - .byte 0x67,0x48 - movl 8(%esp), %ecx # mov rcx, [esp + 8] - .byte 0x67,0x48 - movl 0x10(%esp), %edx # mov rdx, [esp + 10h] - .byte 0x67,0x48 - movl 0x18(%esp), %esp # mov rsp, [esp + 18h] - .byte 0x48 - addl $0x-20, %esp # add rsp, -20h - call *%ebx # call rbx - jmp . diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S new file mode 100644 index 0000000000..c14bd11d68 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# FlushCacheLine.Asm +# +# Abstract: +# +# AsmFlushCacheLine function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmFlushCacheLine ( +# IN VOID *LinearAddress +# ); +#------------------------------------------------------------------------------ +.global _AsmFlushCacheLine +_AsmFlushCacheLine: + movl 4(%esp),%eax + clflush (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.s b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.s deleted file mode 100644 index c14bd11d68..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# FlushCacheLine.Asm -# -# Abstract: -# -# AsmFlushCacheLine function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmFlushCacheLine ( -# IN VOID *LinearAddress -# ); -#------------------------------------------------------------------------------ -.global _AsmFlushCacheLine -_AsmFlushCacheLine: - movl 4(%esp),%eax - clflush (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.S b/MdePkg/Library/BaseLib/Ia32/FxRestore.S new file mode 100644 index 0000000000..631a3ef68a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/FxRestore.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# FxRestore.Asm +# +# Abstract: +# +# AsmFxRestore function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmFxRestore ( +# IN CONST IA32_FX_BUFFER *Buffer +# ); +#------------------------------------------------------------------------------ +.global _AsmFxRestore +_AsmFxRestore: + movl 4(%esp),%eax + fxrstor (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.s b/MdePkg/Library/BaseLib/Ia32/FxRestore.s deleted file mode 100644 index 631a3ef68a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/FxRestore.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# FxRestore.Asm -# -# Abstract: -# -# AsmFxRestore function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmFxRestore ( -# IN CONST IA32_FX_BUFFER *Buffer -# ); -#------------------------------------------------------------------------------ -.global _AsmFxRestore -_AsmFxRestore: - movl 4(%esp),%eax - fxrstor (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.S b/MdePkg/Library/BaseLib/Ia32/FxSave.S new file mode 100644 index 0000000000..44a55126a9 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/FxSave.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# FxSave.Asm +# +# Abstract: +# +# AsmFxSave function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmFxSave ( +# OUT IA32_FX_BUFFER *Buffer +# ); +#------------------------------------------------------------------------------ +.global _AsmFxSave +_AsmFxSave: + movl 4(%esp),%eax + fxsave (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.s b/MdePkg/Library/BaseLib/Ia32/FxSave.s deleted file mode 100644 index 44a55126a9..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/FxSave.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# FxSave.Asm -# -# Abstract: -# -# AsmFxSave function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmFxSave ( -# OUT IA32_FX_BUFFER *Buffer -# ); -#------------------------------------------------------------------------------ -.global _AsmFxSave -_AsmFxSave: - movl 4(%esp),%eax - fxsave (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S new file mode 100644 index 0000000000..43bb92526e --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S @@ -0,0 +1,64 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# InterlockedCompareExchange32.Asm +# +# Abstract: +# +# InterlockedCompareExchange32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID * +# EFIAPI +# InterlockedCompareExchangePointer ( +# IN VOID **Value, +# IN VOID *CompareValue, +# IN VOID *ExchangeValue +# ); +#------------------------------------------------------------------------------ +.global _InterlockedCompareExchangePointer +_InterlockedCompareExchangePointer: + # + # InterlockedCompareExchangePointer() shares the same code as + # InterlockedCompareExchange32() on IA32 and thus no code inside this + # function + # + + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# InterlockedCompareExchange32 ( +# IN UINT32 *Value, +# IN UINT32 CompareValue, +# IN UINT32 ExchangeValue +# ); +#------------------------------------------------------------------------------ +.global _InterlockedCompareExchange32 +_InterlockedCompareExchange32: + movl 4(%esp),%ecx + movl 8(%esp),%eax + movl 12(%esp),%edx + lock cmpxchgl %edx,(%ecx) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.s b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.s deleted file mode 100644 index 43bb92526e..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.s +++ /dev/null @@ -1,64 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# InterlockedCompareExchange32.Asm -# -# Abstract: -# -# InterlockedCompareExchange32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID * -# EFIAPI -# InterlockedCompareExchangePointer ( -# IN VOID **Value, -# IN VOID *CompareValue, -# IN VOID *ExchangeValue -# ); -#------------------------------------------------------------------------------ -.global _InterlockedCompareExchangePointer -_InterlockedCompareExchangePointer: - # - # InterlockedCompareExchangePointer() shares the same code as - # InterlockedCompareExchange32() on IA32 and thus no code inside this - # function - # - - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# InterlockedCompareExchange32 ( -# IN UINT32 *Value, -# IN UINT32 CompareValue, -# IN UINT32 ExchangeValue -# ); -#------------------------------------------------------------------------------ -.global _InterlockedCompareExchange32 -_InterlockedCompareExchange32: - movl 4(%esp),%ecx - movl 8(%esp),%eax - movl 12(%esp),%edx - lock cmpxchgl %edx,(%ecx) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S new file mode 100644 index 0000000000..abc51e905b --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S @@ -0,0 +1,52 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# InterlockedCompareExchange64.Asm +# +# Abstract: +# +# InterlockedCompareExchange64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# InterlockedCompareExchange64 ( +# IN UINT64 *Value, +# IN UINT64 CompareValue, +# IN UINT64 ExchangeValue +# ); +#------------------------------------------------------------------------------ +.global _InterlockedCompareExchange64 + push %esi + push %ebx + movl 12(%esp),%esi + movl 16(%esp),%eax + movl 20(%esp),%edx + movl 24(%esp),%ebx + movl 28(%esp),%ecx + lock + cmpxchg8b (%esi) + pop %ebx + pop %esi + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.s b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.s deleted file mode 100644 index abc51e905b..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.s +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# InterlockedCompareExchange64.Asm -# -# Abstract: -# -# InterlockedCompareExchange64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# InterlockedCompareExchange64 ( -# IN UINT64 *Value, -# IN UINT64 CompareValue, -# IN UINT64 ExchangeValue -# ); -#------------------------------------------------------------------------------ -.global _InterlockedCompareExchange64 - push %esi - push %ebx - movl 12(%esp),%esi - movl 16(%esp),%eax - movl 20(%esp),%edx - movl 24(%esp),%ebx - movl 28(%esp),%ecx - lock - cmpxchg8b (%esi) - pop %ebx - pop %esi - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S new file mode 100644 index 0000000000..a7b653ac20 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# InterlockedDecrement.Asm +# +# Abstract: +# +# InterlockedDecrement function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# InterlockedDecrement ( +# IN UINT32 *Value +# ); +#------------------------------------------------------------------------------ +.global _InterlockedDecrement +_InterlockedDecrement: + movl 4(%esp),%eax + lock + decl (%eax) + movl (%eax),%eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.s b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.s deleted file mode 100644 index a7b653ac20..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# InterlockedDecrement.Asm -# -# Abstract: -# -# InterlockedDecrement function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# InterlockedDecrement ( -# IN UINT32 *Value -# ); -#------------------------------------------------------------------------------ -.global _InterlockedDecrement -_InterlockedDecrement: - movl 4(%esp),%eax - lock - decl (%eax) - movl (%eax),%eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S new file mode 100644 index 0000000000..3f9beec211 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# InterlockedIncrement.Asm +# +# Abstract: +# +# InterlockedIncrement function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# InterlockedIncrement ( +# IN UINT32 *Value +# ); +#------------------------------------------------------------------------------ +.global _InterlockedIncrement +_InterlockedIncrement: + movl 4(%esp),%eax + lock + incl (%eax) + movl (%eax),%eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.s b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.s deleted file mode 100644 index 3f9beec211..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# InterlockedIncrement.Asm -# -# Abstract: -# -# InterlockedIncrement function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# InterlockedIncrement ( -# IN UINT32 *Value -# ); -#------------------------------------------------------------------------------ -.global _InterlockedIncrement -_InterlockedIncrement: - movl 4(%esp),%eax - lock - incl (%eax) - movl (%eax),%eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.S b/MdePkg/Library/BaseLib/Ia32/Invd.S new file mode 100644 index 0000000000..6d6c8d46cd --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/Invd.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Invd.Asm +# +# Abstract: +# +# AsmInvd function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmInvd ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmInvd +_AsmInvd: + invd + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.s b/MdePkg/Library/BaseLib/Ia32/Invd.s deleted file mode 100644 index 6d6c8d46cd..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/Invd.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# Invd.Asm -# -# Abstract: -# -# AsmInvd function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmInvd ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmInvd -_AsmInvd: - invd - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.S b/MdePkg/Library/BaseLib/Ia32/LRotU64.S new file mode 100644 index 0000000000..9c961ce378 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/LRotU64.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# LRotU64.asm +# +# Abstract: +# +# 64-bit left rotation for Ia32 +# +#------------------------------------------------------------------------------ + + + + + +.global _LRotU64 + push %ebx + movb 16(%esp),%cl + movl 12(%esp),%edx + movl 8(%esp),%eax + shldl %cl,%edx,%ebx + shldl %cl,%eax,%edx + rorl %cl,%ebx + shldl %cl,%ebx,%eax + testb $32,%cl + cmovnz %eax, %ecx + cmovnz %edx, %eax + cmovnz %ecx, %edx + pop %ebx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.s b/MdePkg/Library/BaseLib/Ia32/LRotU64.s deleted file mode 100644 index 9c961ce378..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/LRotU64.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# LRotU64.asm -# -# Abstract: -# -# 64-bit left rotation for Ia32 -# -#------------------------------------------------------------------------------ - - - - - -.global _LRotU64 - push %ebx - movb 16(%esp),%cl - movl 12(%esp),%edx - movl 8(%esp),%eax - shldl %cl,%edx,%ebx - shldl %cl,%eax,%edx - rorl %cl,%ebx - shldl %cl,%ebx,%eax - testb $32,%cl - cmovnz %eax, %ecx - cmovnz %edx, %eax - cmovnz %ecx, %edx - pop %ebx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/LShiftU64.S b/MdePkg/Library/BaseLib/Ia32/LShiftU64.S new file mode 100644 index 0000000000..4aa17c637d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/LShiftU64.S @@ -0,0 +1,36 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# LShiftU64.asm +# +# Abstract: +# +# 64-bit left shift function for IA-32 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMathLShiftU64 +_InternalMathLShiftU64: + movb 12(%esp), %cl + xorl %eax, %eax + movl 4(%esp), %edx + testb $32, %cl + cmovz %edx, %eax + cmovz 0x8(%esp), %edx + shld %cl,%eax,%edx + shl %cl, %eax + ret diff --git a/MdePkg/Library/BaseLib/Ia32/LShiftU64.s b/MdePkg/Library/BaseLib/Ia32/LShiftU64.s deleted file mode 100644 index 4aa17c637d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/LShiftU64.s +++ /dev/null @@ -1,36 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# LShiftU64.asm -# -# Abstract: -# -# 64-bit left shift function for IA-32 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMathLShiftU64 -_InternalMathLShiftU64: - movb 12(%esp), %cl - xorl %eax, %eax - movl 4(%esp), %edx - testb $32, %cl - cmovz %edx, %eax - cmovz 0x8(%esp), %edx - shld %cl,%eax,%edx - shl %cl, %eax - ret diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.S b/MdePkg/Library/BaseLib/Ia32/LongJump.S new file mode 100644 index 0000000000..5fa1521226 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/LongJump.S @@ -0,0 +1,38 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# LongJump.Asm +# +# Abstract: +# +# Implementation of _LongJump() on IA-32. +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.globl _InternalLongJump +_InternalLongJump: + popl %eax + popl %edx + popl %eax + movl (%edx), %ebx + movl 4(%edx), %esi + movl 8(%edx), %edi + movl 12(%edx), %ebp + movl 16(%edx), %esp + jmp *20(%edx) +#InternalLongJump ENDP + + diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.s b/MdePkg/Library/BaseLib/Ia32/LongJump.s deleted file mode 100644 index 5fa1521226..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/LongJump.s +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# LongJump.Asm -# -# Abstract: -# -# Implementation of _LongJump() on IA-32. -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.globl _InternalLongJump -_InternalLongJump: - popl %eax - popl %edx - popl %eax - movl (%edx), %ebx - movl 4(%edx), %esi - movl 8(%edx), %edi - movl 12(%edx), %ebp - movl 16(%edx), %esp - jmp *20(%edx) -#InternalLongJump ENDP - - diff --git a/MdePkg/Library/BaseLib/Ia32/ModU64x32.S b/MdePkg/Library/BaseLib/Ia32/ModU64x32.S new file mode 100644 index 0000000000..ed9c2fee25 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ModU64x32.S @@ -0,0 +1,38 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DivU64x32.asm +# +# Abstract: +# +# Calculate the remainder of a 64-bit integer by a 32-bit integer +# +#------------------------------------------------------------------------------ + + + + + +.global _ModU64x32 +_ModU64x32: + movl 8(%esp),%eax + movl 12(%esp),%ecx + xorl %edx,%edx + divl %ecx + movl 4(%esp),%eax + divl %ecx + movl %edx,%eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ModU64x32.s b/MdePkg/Library/BaseLib/Ia32/ModU64x32.s deleted file mode 100644 index ed9c2fee25..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ModU64x32.s +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# DivU64x32.asm -# -# Abstract: -# -# Calculate the remainder of a 64-bit integer by a 32-bit integer -# -#------------------------------------------------------------------------------ - - - - - -.global _ModU64x32 -_ModU64x32: - movl 8(%esp),%eax - movl 12(%esp),%ecx - xorl %edx,%edx - divl %ecx - movl 4(%esp),%eax - divl %ecx - movl %edx,%eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.S b/MdePkg/Library/BaseLib/Ia32/Monitor.S new file mode 100644 index 0000000000..8da0e341ed --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/Monitor.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Monitor.Asm +# +# Abstract: +# +# AsmMonitor function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmMonitor ( +# IN UINTN Eax, +# IN UINTN Ecx, +# IN UINTN Edx +# ); +#------------------------------------------------------------------------------ +.global _AsmMonitor +_AsmMonitor: + movl 4(%esp),%eax + movl 8(%esp),%ecx + movl 12(%esp),%edx + monitor %eax,%ecx,%edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.s b/MdePkg/Library/BaseLib/Ia32/Monitor.s deleted file mode 100644 index 8da0e341ed..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/Monitor.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# Monitor.Asm -# -# Abstract: -# -# AsmMonitor function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmMonitor ( -# IN UINTN Eax, -# IN UINTN Ecx, -# IN UINTN Edx -# ); -#------------------------------------------------------------------------------ -.global _AsmMonitor -_AsmMonitor: - movl 4(%esp),%eax - movl 8(%esp),%ecx - movl 12(%esp),%edx - monitor %eax,%ecx,%edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x32.S b/MdePkg/Library/BaseLib/Ia32/MultU64x32.S new file mode 100644 index 0000000000..572a312de8 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/MultU64x32.S @@ -0,0 +1,32 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# MultU64x32.asm +# +# Abstract: +# +# Calculate the product of a 64-bit integer and a 32-bit integer +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMathMultU64x32 +_InternalMathMultU64x32: + movl 12(%esp),%ecx + movl %ecx,%eax + imull 8(%esp),%ecx + mull 0x4(%esp) + addl %ecx,%edx + ret diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x32.s b/MdePkg/Library/BaseLib/Ia32/MultU64x32.s deleted file mode 100644 index 572a312de8..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/MultU64x32.s +++ /dev/null @@ -1,32 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# MultU64x32.asm -# -# Abstract: -# -# Calculate the product of a 64-bit integer and a 32-bit integer -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMathMultU64x32 -_InternalMathMultU64x32: - movl 12(%esp),%ecx - movl %ecx,%eax - imull 8(%esp),%ecx - mull 0x4(%esp) - addl %ecx,%edx - ret diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.S b/MdePkg/Library/BaseLib/Ia32/MultU64x64.S new file mode 100644 index 0000000000..8841fc44dc --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/MultU64x64.S @@ -0,0 +1,49 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# MultU64x64.asm +# +# Abstract: +# +# Calculate the product of a 64-bit integer and another 64-bit integer +# +#------------------------------------------------------------------------------ + + + + + +.global _MultS64x64 +_MultS64x64: + # + # MultS64x32 shares the same implementation with _MultU64x32, and thus no + # code inside this function. + # + + +.global _MultU64x64 + push %ebx + movl 8(%esp),%ebx + movl 16(%esp),%edx + movl %ebx,%ecx + movl %edx,%eax + imull 20(%esp),%ebx + imull 12(%esp),%edx + addl %edx,%ebx + mull %ecx + addl %ebx,%edx + pop %ebx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.s b/MdePkg/Library/BaseLib/Ia32/MultU64x64.s deleted file mode 100644 index 8841fc44dc..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/MultU64x64.s +++ /dev/null @@ -1,49 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# MultU64x64.asm -# -# Abstract: -# -# Calculate the product of a 64-bit integer and another 64-bit integer -# -#------------------------------------------------------------------------------ - - - - - -.global _MultS64x64 -_MultS64x64: - # - # MultS64x32 shares the same implementation with _MultU64x32, and thus no - # code inside this function. - # - - -.global _MultU64x64 - push %ebx - movl 8(%esp),%ebx - movl 16(%esp),%edx - movl %ebx,%ecx - movl %edx,%eax - imull 20(%esp),%ebx - imull 12(%esp),%edx - addl %edx,%ebx - mull %ecx - addl %ebx,%edx - pop %ebx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.S b/MdePkg/Library/BaseLib/Ia32/Mwait.S new file mode 100644 index 0000000000..7e04453352 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/Mwait.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Mwait.Asm +# +# Abstract: +# +# AsmMwait function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmMwait ( +# IN UINTN Eax, +# IN UINTN Ecx +# ); +#------------------------------------------------------------------------------ +.global _AsmMwait +_AsmMwait: + movl 4(%esp),%eax + movl 8(%esp),%ecx + mwait %eax,%ecx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.s b/MdePkg/Library/BaseLib/Ia32/Mwait.s deleted file mode 100644 index 7e04453352..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/Mwait.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# Mwait.Asm -# -# Abstract: -# -# AsmMwait function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmMwait ( -# IN UINTN Eax, -# IN UINTN Ecx -# ); -#------------------------------------------------------------------------------ -.global _AsmMwait -_AsmMwait: - movl 4(%esp),%eax - movl 8(%esp),%ecx - mwait %eax,%ecx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.S b/MdePkg/Library/BaseLib/Ia32/RRotU64.S new file mode 100644 index 0000000000..541e420a3c --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/RRotU64.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# RRotU64.asm +# +# Abstract: +# +# 64-bit right rotation for Ia32 +# +#------------------------------------------------------------------------------ + + + + + +.global _RRotU64 + push %ebx + movb 16(%esp),%cl + movl 8(%esp),%eax + movl 12(%esp),%edx + shrdl %cl,%eax,%ebx + shrdl %cl,%edx,%eax + roll %cl,%ebx + shrdl %cl,%ebx,%edx + testb $32,%cl + cmovnz %eax, %ecx + cmovnz %edx, %eax + cmovnz %ecx, %edx + pop %ebx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.s b/MdePkg/Library/BaseLib/Ia32/RRotU64.s deleted file mode 100644 index 541e420a3c..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/RRotU64.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# RRotU64.asm -# -# Abstract: -# -# 64-bit right rotation for Ia32 -# -#------------------------------------------------------------------------------ - - - - - -.global _RRotU64 - push %ebx - movb 16(%esp),%cl - movl 8(%esp),%eax - movl 12(%esp),%edx - shrdl %cl,%eax,%ebx - shrdl %cl,%edx,%eax - roll %cl,%ebx - shrdl %cl,%ebx,%edx - testb $32,%cl - cmovnz %eax, %ecx - cmovnz %edx, %eax - cmovnz %ecx, %edx - pop %ebx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/RShiftU64.S b/MdePkg/Library/BaseLib/Ia32/RShiftU64.S new file mode 100644 index 0000000000..f6c28dee96 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/RShiftU64.S @@ -0,0 +1,35 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# RShiftU64.asm +# +# Abstract: +# +# 64-bit logical right shift function for IA-32 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMathRShiftU64 +_InternalMathRShiftU64: + movb 12(%esp),%cl + xorl %edx,%edx + movl 8(%esp),%eax + testb $32,%cl + cmovz %eax, %edx + cmovz 0x4(%esp), %eax + shrdl %cl,%edx,%eax + shr %cl,%edx + ret diff --git a/MdePkg/Library/BaseLib/Ia32/RShiftU64.s b/MdePkg/Library/BaseLib/Ia32/RShiftU64.s deleted file mode 100644 index f6c28dee96..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/RShiftU64.s +++ /dev/null @@ -1,35 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# RShiftU64.asm -# -# Abstract: -# -# 64-bit logical right shift function for IA-32 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMathRShiftU64 -_InternalMathRShiftU64: - movb 12(%esp),%cl - xorl %edx,%edx - movl 8(%esp),%eax - testb $32,%cl - cmovz %eax, %edx - cmovz 0x4(%esp), %eax - shrdl %cl,%edx,%eax - shr %cl,%edx - ret diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.S b/MdePkg/Library/BaseLib/Ia32/ReadCr0.S new file mode 100644 index 0000000000..3108b71eeb --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadCr0.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadCr0.Asm +# +# Abstract: +# +# AsmReadCr0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadCr0 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadCr0 +_AsmReadCr0: + movl %cr0, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.s b/MdePkg/Library/BaseLib/Ia32/ReadCr0.s deleted file mode 100644 index 3108b71eeb..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr0.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadCr0.Asm -# -# Abstract: -# -# AsmReadCr0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadCr0 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadCr0 -_AsmReadCr0: - movl %cr0, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.S b/MdePkg/Library/BaseLib/Ia32/ReadCr2.S new file mode 100644 index 0000000000..3ce287a252 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadCr2.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadCr2.Asm +# +# Abstract: +# +# AsmReadCr2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadCr2 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadCr2 +_AsmReadCr2: + movl %cr2, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.s b/MdePkg/Library/BaseLib/Ia32/ReadCr2.s deleted file mode 100644 index 3ce287a252..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr2.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadCr2.Asm -# -# Abstract: -# -# AsmReadCr2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadCr2 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadCr2 -_AsmReadCr2: - movl %cr2, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.S b/MdePkg/Library/BaseLib/Ia32/ReadCr3.S new file mode 100644 index 0000000000..2bd63c725a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadCr3.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadCr3.Asm +# +# Abstract: +# +# AsmReadCr3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadCr3 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadCr3 +_AsmReadCr3: + movl %cr3, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.s b/MdePkg/Library/BaseLib/Ia32/ReadCr3.s deleted file mode 100644 index 2bd63c725a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr3.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadCr3.Asm -# -# Abstract: -# -# AsmReadCr3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadCr3 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadCr3 -_AsmReadCr3: - movl %cr3, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.S b/MdePkg/Library/BaseLib/Ia32/ReadCr4.S new file mode 100644 index 0000000000..4d746d807b --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadCr4.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadCr4.Asm +# +# Abstract: +# +# AsmReadCr4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadCr4 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadCr4 +_AsmReadCr4: + movl %cr4, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.s b/MdePkg/Library/BaseLib/Ia32/ReadCr4.s deleted file mode 100644 index 4d746d807b..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCr4.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadCr4.Asm -# -# Abstract: -# -# AsmReadCr4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadCr4 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadCr4 -_AsmReadCr4: - movl %cr4, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.S b/MdePkg/Library/BaseLib/Ia32/ReadCs.S new file mode 100644 index 0000000000..66bf4b9eeb --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadCs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadCs.Asm +# +# Abstract: +# +# AsmReadCs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadCs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadCs +_AsmReadCs: + movw %cs,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.s b/MdePkg/Library/BaseLib/Ia32/ReadCs.s deleted file mode 100644 index 66bf4b9eeb..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadCs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadCs.Asm -# -# Abstract: -# -# AsmReadCs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadCs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadCs -_AsmReadCs: - movw %cs,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.S b/MdePkg/Library/BaseLib/Ia32/ReadDr0.S new file mode 100644 index 0000000000..00c521b51d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr0.S @@ -0,0 +1,40 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr0.Asm +# +# Abstract: +# +# AsmReadDr0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr0 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr0 +_AsmReadDr0: + movl %dr0, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.s b/MdePkg/Library/BaseLib/Ia32/ReadDr0.s deleted file mode 100644 index 00c521b51d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr0.s +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr0.Asm -# -# Abstract: -# -# AsmReadDr0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr0 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr0 -_AsmReadDr0: - movl %dr0, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.S b/MdePkg/Library/BaseLib/Ia32/ReadDr1.S new file mode 100644 index 0000000000..81d0e54919 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr1.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr1.Asm +# +# Abstract: +# +# AsmReadDr1 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr1 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr1 +_AsmReadDr1: + movl %dr1, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.s b/MdePkg/Library/BaseLib/Ia32/ReadDr1.s deleted file mode 100644 index 81d0e54919..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr1.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr1.Asm -# -# Abstract: -# -# AsmReadDr1 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr1 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr1 -_AsmReadDr1: - movl %dr1, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.S b/MdePkg/Library/BaseLib/Ia32/ReadDr2.S new file mode 100644 index 0000000000..296fff699e --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr2.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr2.Asm +# +# Abstract: +# +# AsmReadDr2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr2 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr2 +_AsmReadDr2: + movl %dr2, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.s b/MdePkg/Library/BaseLib/Ia32/ReadDr2.s deleted file mode 100644 index 296fff699e..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr2.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr2.Asm -# -# Abstract: -# -# AsmReadDr2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr2 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr2 -_AsmReadDr2: - movl %dr2, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.S b/MdePkg/Library/BaseLib/Ia32/ReadDr3.S new file mode 100644 index 0000000000..e99391de81 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr3.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr3.Asm +# +# Abstract: +# +# AsmReadDr3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr3 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr3 +_AsmReadDr3: + movl %dr3, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.s b/MdePkg/Library/BaseLib/Ia32/ReadDr3.s deleted file mode 100644 index e99391de81..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr3.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr3.Asm -# -# Abstract: -# -# AsmReadDr3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr3 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr3 -_AsmReadDr3: - movl %dr3, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.S b/MdePkg/Library/BaseLib/Ia32/ReadDr4.S new file mode 100644 index 0000000000..7bff6766a4 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr4.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr4.Asm +# +# Abstract: +# +# AsmReadDr4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr4 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr4 +_AsmReadDr4: + movl %dr4, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.s b/MdePkg/Library/BaseLib/Ia32/ReadDr4.s deleted file mode 100644 index 7bff6766a4..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr4.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr4.Asm -# -# Abstract: -# -# AsmReadDr4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr4 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr4 -_AsmReadDr4: - movl %dr4, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.S b/MdePkg/Library/BaseLib/Ia32/ReadDr5.S new file mode 100644 index 0000000000..df409e3304 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr5.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr5.Asm +# +# Abstract: +# +# AsmReadDr5 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr5 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr5 +_AsmReadDr5: + movl %dr5, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.s b/MdePkg/Library/BaseLib/Ia32/ReadDr5.s deleted file mode 100644 index df409e3304..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr5.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr5.Asm -# -# Abstract: -# -# AsmReadDr5 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr5 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr5 -_AsmReadDr5: - movl %dr5, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.S b/MdePkg/Library/BaseLib/Ia32/ReadDr6.S new file mode 100644 index 0000000000..bdadd80672 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr6.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr6.Asm +# +# Abstract: +# +# AsmReadDr6 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr6 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr6 +_AsmReadDr6: + movl %dr6, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.s b/MdePkg/Library/BaseLib/Ia32/ReadDr6.s deleted file mode 100644 index bdadd80672..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr6.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr6.Asm -# -# Abstract: -# -# AsmReadDr6 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr6 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr6 -_AsmReadDr6: - movl %dr6, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.S b/MdePkg/Library/BaseLib/Ia32/ReadDr7.S new file mode 100644 index 0000000000..cf213caac9 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr7.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDr7.Asm +# +# Abstract: +# +# AsmReadDr7 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadDr7 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDr7 +_AsmReadDr7: + movl %dr7, %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.s b/MdePkg/Library/BaseLib/Ia32/ReadDr7.s deleted file mode 100644 index cf213caac9..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDr7.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDr7.Asm -# -# Abstract: -# -# AsmReadDr7 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadDr7 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDr7 -_AsmReadDr7: - movl %dr7, %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.S b/MdePkg/Library/BaseLib/Ia32/ReadDs.S new file mode 100644 index 0000000000..ca1e37937a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadDs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadDs.Asm +# +# Abstract: +# +# AsmReadDs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadDs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadDs +_AsmReadDs: + movw %ds,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.s b/MdePkg/Library/BaseLib/Ia32/ReadDs.s deleted file mode 100644 index ca1e37937a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadDs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadDs.Asm -# -# Abstract: -# -# AsmReadDs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadDs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadDs -_AsmReadDs: - movw %ds,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.S b/MdePkg/Library/BaseLib/Ia32/ReadEflags.S new file mode 100644 index 0000000000..a70a209ffb --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadEflags.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadEflags.Asm +# +# Abstract: +# +# AsmReadEflags function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadEflags ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadEflags +_AsmReadEflags: + pushfl + popl %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.s b/MdePkg/Library/BaseLib/Ia32/ReadEflags.s deleted file mode 100644 index a70a209ffb..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadEflags.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadEflags.Asm -# -# Abstract: -# -# AsmReadEflags function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadEflags ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadEflags -_AsmReadEflags: - pushfl - popl %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.S b/MdePkg/Library/BaseLib/Ia32/ReadEs.S new file mode 100644 index 0000000000..69727b5afc --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadEs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadEs.Asm +# +# Abstract: +# +# AsmReadEs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadEs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadEs +_AsmReadEs: + movw %es,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.s b/MdePkg/Library/BaseLib/Ia32/ReadEs.s deleted file mode 100644 index 69727b5afc..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadEs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadEs.Asm -# -# Abstract: -# -# AsmReadEs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadEs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadEs -_AsmReadEs: - movw %es,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.S b/MdePkg/Library/BaseLib/Ia32/ReadFs.S new file mode 100644 index 0000000000..7f4fdfa77c --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadFs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadFs.Asm +# +# Abstract: +# +# AsmReadFs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadFs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadFs +_AsmReadFs: + movw %fs,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.s b/MdePkg/Library/BaseLib/Ia32/ReadFs.s deleted file mode 100644 index 7f4fdfa77c..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadFs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadFs.Asm -# -# Abstract: -# -# AsmReadFs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadFs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadFs -_AsmReadFs: - movw %fs,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S new file mode 100644 index 0000000000..f03a05696d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadGdtr.Asm +# +# Abstract: +# +# AsmReadGdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmReadGdtr ( +# OUT IA32_DESCRIPTOR *Gdtr +# ); +#------------------------------------------------------------------------------ +.global _AsmReadGdtr +_AsmReadGdtr: + movl 4(%esp),%eax + sgdt (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.s b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.s deleted file mode 100644 index f03a05696d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadGdtr.Asm -# -# Abstract: -# -# AsmReadGdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmReadGdtr ( -# OUT IA32_DESCRIPTOR *Gdtr -# ); -#------------------------------------------------------------------------------ -.global _AsmReadGdtr -_AsmReadGdtr: - movl 4(%esp),%eax - sgdt (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.S b/MdePkg/Library/BaseLib/Ia32/ReadGs.S new file mode 100644 index 0000000000..0d88a60a52 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadGs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadGs.Asm +# +# Abstract: +# +# AsmReadGs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadGs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadGs +_AsmReadGs: + movw %gs,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.s b/MdePkg/Library/BaseLib/Ia32/ReadGs.s deleted file mode 100644 index 0d88a60a52..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadGs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadGs.Asm -# -# Abstract: -# -# AsmReadGs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadGs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadGs -_AsmReadGs: - movw %gs,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S new file mode 100644 index 0000000000..fa72d3ba7d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadIdtr.Asm +# +# Abstract: +# +# AsmReadIdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmReadIdtr ( +# OUT IA32_DESCRIPTOR *Idtr +# ); +#------------------------------------------------------------------------------ +.global _AsmReadIdtr +_AsmReadIdtr: + movl 4(%esp),%eax + sidt (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.s b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.s deleted file mode 100644 index fa72d3ba7d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadIdtr.Asm -# -# Abstract: -# -# AsmReadIdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmReadIdtr ( -# OUT IA32_DESCRIPTOR *Idtr -# ); -#------------------------------------------------------------------------------ -.global _AsmReadIdtr -_AsmReadIdtr: - movl 4(%esp),%eax - sidt (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S new file mode 100644 index 0000000000..aea1d9265c --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadLdtr.Asm +# +# Abstract: +# +# AsmReadLdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadLdtr ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadLdtr +_AsmReadLdtr: + sldt %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.s b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.s deleted file mode 100644 index aea1d9265c..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadLdtr.Asm -# -# Abstract: -# -# AsmReadLdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadLdtr ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadLdtr -_AsmReadLdtr: - sldt %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.S b/MdePkg/Library/BaseLib/Ia32/ReadMm0.S new file mode 100644 index 0000000000..dd6b846836 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm0.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm0.Asm +# +# Abstract: +# +# AsmReadMm0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm0 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm0 +_AsmReadMm0: + pushl %eax + pushl %eax + movq %mm0,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.s b/MdePkg/Library/BaseLib/Ia32/ReadMm0.s deleted file mode 100644 index dd6b846836..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm0.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm0.Asm -# -# Abstract: -# -# AsmReadMm0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm0 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm0 -_AsmReadMm0: - pushl %eax - pushl %eax - movq %mm0,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.S b/MdePkg/Library/BaseLib/Ia32/ReadMm1.S new file mode 100644 index 0000000000..cbaafff0f3 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm1.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm1.Asm +# +# Abstract: +# +# AsmReadMm1 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm1 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm1 +_AsmReadMm1: + pushl %eax + pushl %eax + movq %mm1,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.s b/MdePkg/Library/BaseLib/Ia32/ReadMm1.s deleted file mode 100644 index cbaafff0f3..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm1.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm1.Asm -# -# Abstract: -# -# AsmReadMm1 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm1 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm1 -_AsmReadMm1: - pushl %eax - pushl %eax - movq %mm1,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.S b/MdePkg/Library/BaseLib/Ia32/ReadMm2.S new file mode 100644 index 0000000000..22a5d71ebc --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm2.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm2.Asm +# +# Abstract: +# +# AsmReadMm2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm2 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm2 +_AsmReadMm2: + pushl %eax + pushl %eax + movq %mm2,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.s b/MdePkg/Library/BaseLib/Ia32/ReadMm2.s deleted file mode 100644 index 22a5d71ebc..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm2.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm2.Asm -# -# Abstract: -# -# AsmReadMm2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm2 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm2 -_AsmReadMm2: - pushl %eax - pushl %eax - movq %mm2,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.S b/MdePkg/Library/BaseLib/Ia32/ReadMm3.S new file mode 100644 index 0000000000..dae267af7a --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm3.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm3.Asm +# +# Abstract: +# +# AsmReadMm3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm3 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm3 +_AsmReadMm3: + pushl %eax + pushl %eax + movq %mm3,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.s b/MdePkg/Library/BaseLib/Ia32/ReadMm3.s deleted file mode 100644 index dae267af7a..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm3.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm3.Asm -# -# Abstract: -# -# AsmReadMm3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm3 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm3 -_AsmReadMm3: - pushl %eax - pushl %eax - movq %mm3,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.S b/MdePkg/Library/BaseLib/Ia32/ReadMm4.S new file mode 100644 index 0000000000..0ae1afcedd --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm4.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm4.Asm +# +# Abstract: +# +# AsmReadMm4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm4 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm4 +_AsmReadMm4: + pushl %eax + pushl %eax + movq %mm4,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.s b/MdePkg/Library/BaseLib/Ia32/ReadMm4.s deleted file mode 100644 index 0ae1afcedd..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm4.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm4.Asm -# -# Abstract: -# -# AsmReadMm4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm4 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm4 -_AsmReadMm4: - pushl %eax - pushl %eax - movq %mm4,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.S b/MdePkg/Library/BaseLib/Ia32/ReadMm5.S new file mode 100644 index 0000000000..2fad14a7e0 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm5.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm5.Asm +# +# Abstract: +# +# AsmReadMm5 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm5 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm5 +_AsmReadMm5: + pushl %eax + pushl %eax + movq %mm5,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.s b/MdePkg/Library/BaseLib/Ia32/ReadMm5.s deleted file mode 100644 index 2fad14a7e0..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm5.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm5.Asm -# -# Abstract: -# -# AsmReadMm5 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm5 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm5 -_AsmReadMm5: - pushl %eax - pushl %eax - movq %mm5,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.S b/MdePkg/Library/BaseLib/Ia32/ReadMm6.S new file mode 100644 index 0000000000..22cddfa486 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm6.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm6.Asm +# +# Abstract: +# +# AsmReadMm6 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm6 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm6 +_AsmReadMm6: + pushl %eax + pushl %eax + movq %mm6,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.s b/MdePkg/Library/BaseLib/Ia32/ReadMm6.s deleted file mode 100644 index 22cddfa486..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm6.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm6.Asm -# -# Abstract: -# -# AsmReadMm6 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm6 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm6 -_AsmReadMm6: - pushl %eax - pushl %eax - movq %mm6,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.S b/MdePkg/Library/BaseLib/Ia32/ReadMm7.S new file mode 100644 index 0000000000..fb485a00c9 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMm7.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMm7.Asm +# +# Abstract: +# +# AsmReadMm7 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmReadMm7 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMm7 +_AsmReadMm7: + pushl %eax + pushl %eax + movq %mm7,(%esp) + popl %eax + popl %edx + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.s b/MdePkg/Library/BaseLib/Ia32/ReadMm7.s deleted file mode 100644 index fb485a00c9..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMm7.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMm7.Asm -# -# Abstract: -# -# AsmReadMm7 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmReadMm7 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMm7 -_AsmReadMm7: - pushl %eax - pushl %eax - movq %mm7,(%esp) - popl %eax - popl %edx - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.S b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.S new file mode 100644 index 0000000000..6a2c9c6688 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.S @@ -0,0 +1,57 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadMsr64.Asm +# +# Abstract: +# +# AsmReadMsr64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# AsmReadMsr32 ( +# IN UINT32 Index +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMsr32 +_AsmReadMsr32: + # + # AsmReadMsr32 shares the same implementation with AsmReadMsr64 and thus no + # code inside this function + # + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmReadMsr64 ( +# IN UINT64 Index +# ); +#------------------------------------------------------------------------------ +.global _AsmReadMsr64 +_AsmReadMsr64: + movl 4(%esp),%ecx + rdmsr + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.s b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.s deleted file mode 100644 index 6a2c9c6688..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.s +++ /dev/null @@ -1,57 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadMsr64.Asm -# -# Abstract: -# -# AsmReadMsr64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# AsmReadMsr32 ( -# IN UINT32 Index -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMsr32 -_AsmReadMsr32: - # - # AsmReadMsr32 shares the same implementation with AsmReadMsr64 and thus no - # code inside this function - # - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmReadMsr64 ( -# IN UINT64 Index -# ); -#------------------------------------------------------------------------------ -.global _AsmReadMsr64 -_AsmReadMsr64: - movl 4(%esp),%ecx - rdmsr - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.S b/MdePkg/Library/BaseLib/Ia32/ReadPmc.S new file mode 100644 index 0000000000..868e85c23d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadPmc.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadPmc.Asm +# +# Abstract: +# +# AsmReadPmc function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmReadPmc ( +# IN UINT32 PmcIndex +# ); +#------------------------------------------------------------------------------ +.global _AsmReadPmc +_AsmReadPmc: + movl 4(%esp),%ecx + rdpmc + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.s b/MdePkg/Library/BaseLib/Ia32/ReadPmc.s deleted file mode 100644 index 868e85c23d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadPmc.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadPmc.Asm -# -# Abstract: -# -# AsmReadPmc function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmReadPmc ( -# IN UINT32 PmcIndex -# ); -#------------------------------------------------------------------------------ -.global _AsmReadPmc -_AsmReadPmc: - movl 4(%esp),%ecx - rdpmc - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadSs.S b/MdePkg/Library/BaseLib/Ia32/ReadSs.S new file mode 100644 index 0000000000..7db65c1490 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadSs.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadSs.Asm +# +# Abstract: +# +# AsmReadSs function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadSs ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadSs +_AsmReadSs: + movw %ss,%ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadSs.s b/MdePkg/Library/BaseLib/Ia32/ReadSs.s deleted file mode 100644 index 7db65c1490..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadSs.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadSs.Asm -# -# Abstract: -# -# AsmReadSs function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadSs ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadSs -_AsmReadSs: - movw %ss,%ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTr.S b/MdePkg/Library/BaseLib/Ia32/ReadTr.S new file mode 100644 index 0000000000..8c31e9d9fa --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadTr.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadTr.Asm +# +# Abstract: +# +# AsmReadTr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT16 +# EFIAPI +# AsmReadTr ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadTr +_AsmReadTr: + str %eax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTr.s b/MdePkg/Library/BaseLib/Ia32/ReadTr.s deleted file mode 100644 index 8c31e9d9fa..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadTr.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadTr.Asm -# -# Abstract: -# -# AsmReadTr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT16 -# EFIAPI -# AsmReadTr ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadTr -_AsmReadTr: - str %eax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.S b/MdePkg/Library/BaseLib/Ia32/ReadTsc.S new file mode 100644 index 0000000000..e7981c05b0 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/ReadTsc.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ReadTsc.Asm +# +# Abstract: +# +# AsmReadTsc function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmReadTsc ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmReadTsc +_AsmReadTsc: + rdtsc + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.s b/MdePkg/Library/BaseLib/Ia32/ReadTsc.s deleted file mode 100644 index e7981c05b0..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/ReadTsc.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ReadTsc.Asm -# -# Abstract: -# -# AsmReadTsc function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmReadTsc ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmReadTsc -_AsmReadTsc: - rdtsc - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.S b/MdePkg/Library/BaseLib/Ia32/SetJump.S new file mode 100644 index 0000000000..b1b6a84f63 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/SetJump.S @@ -0,0 +1,40 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetJump.Asm +# +# Abstract: +# +# Implementation of SetJump() on IA-32. +# +#------------------------------------------------------------------------------ + + + + + +.global _SetJump +_SetJump: + popl %ecx + movl (%esp),%edx + movl %ebx,(%edx) + movl %esi,4(%edx) + movl %edi,8(%edx) + movl %ebp,12(%edx) + movl %esp,16(%edx) + movl %ecx,20(%edx) + xorl %eax,%eax + jmp *%ecx + + + diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.s b/MdePkg/Library/BaseLib/Ia32/SetJump.s deleted file mode 100644 index b1b6a84f63..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/SetJump.s +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetJump.Asm -# -# Abstract: -# -# Implementation of SetJump() on IA-32. -# -#------------------------------------------------------------------------------ - - - - - -.global _SetJump -_SetJump: - popl %ecx - movl (%esp),%edx - movl %ebx,(%edx) - movl %esi,4(%edx) - movl %edi,8(%edx) - movl %ebp,12(%edx) - movl %esp,16(%edx) - movl %ecx,20(%edx) - xorl %eax,%eax - jmp *%ecx - - - diff --git a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S new file mode 100644 index 0000000000..01af949afa --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S @@ -0,0 +1,34 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuId.Asm +# +# Abstract: +# +# AsmCpuid function +# +# Notes: +# +#------------------------------------------------------------------------------ + + +.global _InternalMathSwapBytes64 +_InternalMathSwapBytes64: + + movl 8(%esp), %eax + movl 4(%esp), %edx + bswapl %eax + bswapl %edx + ret + + diff --git a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.s b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.s deleted file mode 100644 index 01af949afa..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.s +++ /dev/null @@ -1,34 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CpuId.Asm -# -# Abstract: -# -# AsmCpuid function -# -# Notes: -# -#------------------------------------------------------------------------------ - - -.global _InternalMathSwapBytes64 -_InternalMathSwapBytes64: - - movl 8(%esp), %eax - movl 4(%esp), %edx - bswapl %eax - bswapl %edx - ret - - diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.S b/MdePkg/Library/BaseLib/Ia32/Thunk16.S new file mode 100644 index 0000000000..fa7be9192d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.S @@ -0,0 +1,27 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Thunk.asm +# +# Abstract: +# +# Real mode thunk +# +#------------------------------------------------------------------------------ + + + + + ########## + # FIXME! # + ########## diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.s b/MdePkg/Library/BaseLib/Ia32/Thunk16.s deleted file mode 100644 index fa7be9192d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/Thunk16.s +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# Thunk.asm -# -# Abstract: -# -# Real mode thunk -# -#------------------------------------------------------------------------------ - - - - - ########## - # FIXME! # - ########## diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.S b/MdePkg/Library/BaseLib/Ia32/Wbinvd.S new file mode 100644 index 0000000000..e9f6c0ce6b --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/Wbinvd.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Wbinvd.Asm +# +# Abstract: +# +# AsmWbinvd function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWbinvd ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmWbinvd +_AsmWbinvd: + wbinvd + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.s b/MdePkg/Library/BaseLib/Ia32/Wbinvd.s deleted file mode 100644 index e9f6c0ce6b..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/Wbinvd.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# Wbinvd.Asm -# -# Abstract: -# -# AsmWbinvd function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWbinvd ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmWbinvd -_AsmWbinvd: - wbinvd - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.S b/MdePkg/Library/BaseLib/Ia32/WriteCr0.S new file mode 100644 index 0000000000..6e3ad50765 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteCr0.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteCr0.Asm +# +# Abstract: +# +# AsmWriteCr0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmWriteCr0 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteCr0 +_AsmWriteCr0: + movl 4(%esp),%eax + movl %eax, %cr0 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.s b/MdePkg/Library/BaseLib/Ia32/WriteCr0.s deleted file mode 100644 index 6e3ad50765..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr0.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteCr0.Asm -# -# Abstract: -# -# AsmWriteCr0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmWriteCr0 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteCr0 -_AsmWriteCr0: - movl 4(%esp),%eax - movl %eax, %cr0 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.S b/MdePkg/Library/BaseLib/Ia32/WriteCr2.S new file mode 100644 index 0000000000..cf45e01a24 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteCr2.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteCr2.Asm +# +# Abstract: +# +# AsmWriteCr2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmWriteCr2 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteCr2 +_AsmWriteCr2: + movl 4(%esp),%eax + movl %eax, %cr2 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.s b/MdePkg/Library/BaseLib/Ia32/WriteCr2.s deleted file mode 100644 index cf45e01a24..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr2.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteCr2.Asm -# -# Abstract: -# -# AsmWriteCr2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmWriteCr2 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteCr2 -_AsmWriteCr2: - movl 4(%esp),%eax - movl %eax, %cr2 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.S b/MdePkg/Library/BaseLib/Ia32/WriteCr3.S new file mode 100644 index 0000000000..1c55581905 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteCr3.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteCr3.Asm +# +# Abstract: +# +# AsmWriteCr3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmWriteCr3 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteCr3 +_AsmWriteCr3: + movl 4(%esp),%eax + movl %eax, %cr3 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.s b/MdePkg/Library/BaseLib/Ia32/WriteCr3.s deleted file mode 100644 index 1c55581905..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr3.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteCr3.Asm -# -# Abstract: -# -# AsmWriteCr3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmWriteCr3 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteCr3 -_AsmWriteCr3: - movl 4(%esp),%eax - movl %eax, %cr3 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.S b/MdePkg/Library/BaseLib/Ia32/WriteCr4.S new file mode 100644 index 0000000000..fbe48c1cd0 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteCr4.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteCr4.Asm +# +# Abstract: +# +# AsmWriteCr4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINTN +# EFIAPI +# AsmWriteCr4 ( +# VOID +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteCr4 +_AsmWriteCr4: + movl 4(%esp),%eax + movl %eax, %cr4 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.s b/MdePkg/Library/BaseLib/Ia32/WriteCr4.s deleted file mode 100644 index fbe48c1cd0..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteCr4.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteCr4.Asm -# -# Abstract: -# -# AsmWriteCr4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINTN -# EFIAPI -# AsmWriteCr4 ( -# VOID -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteCr4 -_AsmWriteCr4: - movl 4(%esp),%eax - movl %eax, %cr4 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.S b/MdePkg/Library/BaseLib/Ia32/WriteDr0.S new file mode 100644 index 0000000000..a5a84de6b4 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr0.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr0.Asm +# +# Abstract: +# +# AsmWriteDr0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr0 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr0 +_AsmWriteDr0: + movl 4(%esp),%eax + movl %eax, %dr0 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.s b/MdePkg/Library/BaseLib/Ia32/WriteDr0.s deleted file mode 100644 index a5a84de6b4..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr0.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr0.Asm -# -# Abstract: -# -# AsmWriteDr0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr0 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr0 -_AsmWriteDr0: - movl 4(%esp),%eax - movl %eax, %dr0 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.S b/MdePkg/Library/BaseLib/Ia32/WriteDr1.S new file mode 100644 index 0000000000..66fc2c7cf3 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr1.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr1.Asm +# +# Abstract: +# +# AsmWriteDr1 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr1 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr1 +_AsmWriteDr1: + movl 4(%esp),%eax + movl %eax, %dr1 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.s b/MdePkg/Library/BaseLib/Ia32/WriteDr1.s deleted file mode 100644 index 66fc2c7cf3..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr1.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr1.Asm -# -# Abstract: -# -# AsmWriteDr1 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr1 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr1 -_AsmWriteDr1: - movl 4(%esp),%eax - movl %eax, %dr1 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.S b/MdePkg/Library/BaseLib/Ia32/WriteDr2.S new file mode 100644 index 0000000000..7b3f780510 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr2.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr2.Asm +# +# Abstract: +# +# AsmWriteDr2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr2 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr2 +_AsmWriteDr2: + movl 4(%esp),%eax + movl %eax, %dr2 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.s b/MdePkg/Library/BaseLib/Ia32/WriteDr2.s deleted file mode 100644 index 7b3f780510..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr2.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr2.Asm -# -# Abstract: -# -# AsmWriteDr2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr2 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr2 -_AsmWriteDr2: - movl 4(%esp),%eax - movl %eax, %dr2 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.S b/MdePkg/Library/BaseLib/Ia32/WriteDr3.S new file mode 100644 index 0000000000..34d3e4f0cb --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr3.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr3.Asm +# +# Abstract: +# +# AsmWriteDr3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr3 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr3 +_AsmWriteDr3: + movl 4(%esp),%eax + movl %eax, %dr3 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.s b/MdePkg/Library/BaseLib/Ia32/WriteDr3.s deleted file mode 100644 index 34d3e4f0cb..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr3.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr3.Asm -# -# Abstract: -# -# AsmWriteDr3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr3 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr3 -_AsmWriteDr3: - movl 4(%esp),%eax - movl %eax, %dr3 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.S b/MdePkg/Library/BaseLib/Ia32/WriteDr4.S new file mode 100644 index 0000000000..20ddbd2903 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr4.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr4.Asm +# +# Abstract: +# +# AsmWriteDr4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr4 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr4 +_AsmWriteDr4: + movl 4(%esp),%eax + movl %eax, %dr4 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.s b/MdePkg/Library/BaseLib/Ia32/WriteDr4.s deleted file mode 100644 index 20ddbd2903..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr4.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr4.Asm -# -# Abstract: -# -# AsmWriteDr4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr4 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr4 -_AsmWriteDr4: - movl 4(%esp),%eax - movl %eax, %dr4 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.S b/MdePkg/Library/BaseLib/Ia32/WriteDr5.S new file mode 100644 index 0000000000..057928a327 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr5.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr5.Asm +# +# Abstract: +# +# AsmWriteDr5 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr5 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr5 +_AsmWriteDr5: + movl 4(%esp),%eax + movl %eax, %dr5 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.s b/MdePkg/Library/BaseLib/Ia32/WriteDr5.s deleted file mode 100644 index 057928a327..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr5.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr5.Asm -# -# Abstract: -# -# AsmWriteDr5 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr5 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr5 -_AsmWriteDr5: - movl 4(%esp),%eax - movl %eax, %dr5 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.S b/MdePkg/Library/BaseLib/Ia32/WriteDr6.S new file mode 100644 index 0000000000..7d7726be64 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr6.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr6.Asm +# +# Abstract: +# +# AsmWriteDr6 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr6 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr6 +_AsmWriteDr6: + movl 4(%esp),%eax + movl %eax, %dr6 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.s b/MdePkg/Library/BaseLib/Ia32/WriteDr6.s deleted file mode 100644 index 7d7726be64..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr6.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr6.Asm -# -# Abstract: -# -# AsmWriteDr6 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr6 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr6 -_AsmWriteDr6: - movl 4(%esp),%eax - movl %eax, %dr6 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.S b/MdePkg/Library/BaseLib/Ia32/WriteDr7.S new file mode 100644 index 0000000000..a96f445632 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr7.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteDr7.Asm +# +# Abstract: +# +# AsmWriteDr7 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteDr7 ( +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteDr7 +_AsmWriteDr7: + movl 4(%esp),%eax + movl %eax, %dr7 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.s b/MdePkg/Library/BaseLib/Ia32/WriteDr7.s deleted file mode 100644 index a96f445632..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteDr7.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteDr7.Asm -# -# Abstract: -# -# AsmWriteDr7 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteDr7 ( -# IN UINTN Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteDr7 -_AsmWriteDr7: - movl 4(%esp),%eax - movl %eax, %dr7 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S new file mode 100644 index 0000000000..c3eb63d9e4 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteGdtr.Asm +# +# Abstract: +# +# AsmWriteGdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteGdtr ( +# OUT IA32_DESCRIPTOR *Gdtr +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteGdtr +_AsmWriteGdtr: + movl 4(%esp),%eax + lgdt (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.s b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.s deleted file mode 100644 index c3eb63d9e4..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteGdtr.Asm -# -# Abstract: -# -# AsmWriteGdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteGdtr ( -# OUT IA32_DESCRIPTOR *Gdtr -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteGdtr -_AsmWriteGdtr: - movl 4(%esp),%eax - lgdt (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S new file mode 100644 index 0000000000..f71b696d97 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteIdtr.Asm +# +# Abstract: +# +# AsmWriteIdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteIdtr ( +# OUT IA32_DESCRIPTOR *Idtr +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteIdtr +_AsmWriteIdtr: + movl 4(%esp),%eax + lidt (%eax) + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.s b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.s deleted file mode 100644 index f71b696d97..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteIdtr.Asm -# -# Abstract: -# -# AsmWriteIdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteIdtr ( -# OUT IA32_DESCRIPTOR *Idtr -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteIdtr -_AsmWriteIdtr: - movl 4(%esp),%eax - lidt (%eax) - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S new file mode 100644 index 0000000000..3797bd547d --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteLdtr.Asm +# +# Abstract: +# +# AsmWriteLdtr function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmWriteLdtr ( +# IN UINT16 Ldtr +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteLdtr +_AsmWriteLdtr: + movl 4(%esp),%eax + lldtw %ax + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.s b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.s deleted file mode 100644 index 3797bd547d..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteLdtr.Asm -# -# Abstract: -# -# AsmWriteLdtr function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# VOID -# EFIAPI -# AsmWriteLdtr ( -# IN UINT16 Ldtr -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteLdtr -_AsmWriteLdtr: - movl 4(%esp),%eax - lldtw %ax - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.S b/MdePkg/Library/BaseLib/Ia32/WriteMm0.S new file mode 100644 index 0000000000..c4444219a9 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm0.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm0.Asm +# +# Abstract: +# +# AsmWriteMm0 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm0 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm0 +_AsmWriteMm0: + movq 4(%esp),%mm0 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.s b/MdePkg/Library/BaseLib/Ia32/WriteMm0.s deleted file mode 100644 index c4444219a9..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm0.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm0.Asm -# -# Abstract: -# -# AsmWriteMm0 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm0 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm0 -_AsmWriteMm0: - movq 4(%esp),%mm0 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.S b/MdePkg/Library/BaseLib/Ia32/WriteMm1.S new file mode 100644 index 0000000000..e3a492f9ec --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm1.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm1.Asm +# +# Abstract: +# +# AsmWriteMm1 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm1 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm1 +_AsmWriteMm1: + movq 4(%esp),%mm1 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.s b/MdePkg/Library/BaseLib/Ia32/WriteMm1.s deleted file mode 100644 index e3a492f9ec..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm1.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm1.Asm -# -# Abstract: -# -# AsmWriteMm1 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm1 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm1 -_AsmWriteMm1: - movq 4(%esp),%mm1 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.S b/MdePkg/Library/BaseLib/Ia32/WriteMm2.S new file mode 100644 index 0000000000..eaebb37636 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm2.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm2.Asm +# +# Abstract: +# +# AsmWriteMm2 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm2 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm2 +_AsmWriteMm2: + movq 4(%esp),%mm2 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.s b/MdePkg/Library/BaseLib/Ia32/WriteMm2.s deleted file mode 100644 index eaebb37636..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm2.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm2.Asm -# -# Abstract: -# -# AsmWriteMm2 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm2 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm2 -_AsmWriteMm2: - movq 4(%esp),%mm2 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.S b/MdePkg/Library/BaseLib/Ia32/WriteMm3.S new file mode 100644 index 0000000000..a514091732 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm3.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm3.Asm +# +# Abstract: +# +# AsmWriteMm3 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm3 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm3 +_AsmWriteMm3: + movq 4(%esp),%mm3 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.s b/MdePkg/Library/BaseLib/Ia32/WriteMm3.s deleted file mode 100644 index a514091732..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm3.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm3.Asm -# -# Abstract: -# -# AsmWriteMm3 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm3 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm3 -_AsmWriteMm3: - movq 4(%esp),%mm3 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.S b/MdePkg/Library/BaseLib/Ia32/WriteMm4.S new file mode 100644 index 0000000000..6d4a6cdce1 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm4.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm4.Asm +# +# Abstract: +# +# AsmWriteMm4 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm4 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm4 +_AsmWriteMm4: + movq 4(%esp),%mm4 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.s b/MdePkg/Library/BaseLib/Ia32/WriteMm4.s deleted file mode 100644 index 6d4a6cdce1..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm4.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm4.Asm -# -# Abstract: -# -# AsmWriteMm4 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm4 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm4 -_AsmWriteMm4: - movq 4(%esp),%mm4 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.S b/MdePkg/Library/BaseLib/Ia32/WriteMm5.S new file mode 100644 index 0000000000..15d433271f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm5.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm5.Asm +# +# Abstract: +# +# AsmWriteMm5 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm5 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm5 +_AsmWriteMm5: + movq 4(%esp),%mm5 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.s b/MdePkg/Library/BaseLib/Ia32/WriteMm5.s deleted file mode 100644 index 15d433271f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm5.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm5.Asm -# -# Abstract: -# -# AsmWriteMm5 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm5 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm5 -_AsmWriteMm5: - movq 4(%esp),%mm5 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.S b/MdePkg/Library/BaseLib/Ia32/WriteMm6.S new file mode 100644 index 0000000000..6b1361e7a3 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm6.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm6.Asm +# +# Abstract: +# +# AsmWriteMm6 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm6 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm6 +_AsmWriteMm6: + movq 4(%esp),%mm6 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.s b/MdePkg/Library/BaseLib/Ia32/WriteMm6.s deleted file mode 100644 index 6b1361e7a3..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm6.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm6.Asm -# -# Abstract: -# -# AsmWriteMm6 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm6 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm6 -_AsmWriteMm6: - movq 4(%esp),%mm6 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.S b/MdePkg/Library/BaseLib/Ia32/WriteMm7.S new file mode 100644 index 0000000000..d702fbb242 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMm7.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMm7.Asm +# +# Abstract: +# +# AsmWriteMm7 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMm7 ( +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMm7 +_AsmWriteMm7: + movq 4(%esp),%mm7 + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.s b/MdePkg/Library/BaseLib/Ia32/WriteMm7.s deleted file mode 100644 index d702fbb242..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMm7.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMm7.Asm -# -# Abstract: -# -# AsmWriteMm7 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMm7 ( -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMm7 -_AsmWriteMm7: - movq 4(%esp),%mm7 - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr32.S b/MdePkg/Library/BaseLib/Ia32/WriteMsr32.S new file mode 100644 index 0000000000..450b3b7b9f --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMsr32.S @@ -0,0 +1,45 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMsr32.Asm +# +# Abstract: +# +# AsmWriteMsr32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# AsmWriteMsr32 ( +# IN UINT32 Index, +# IN UINT32 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMsr32 +_AsmWriteMsr32: + movl 8(%esp),%eax + xorl %edx,%edx + movl 4(%esp),%ecx + wrmsr + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr32.s b/MdePkg/Library/BaseLib/Ia32/WriteMsr32.s deleted file mode 100644 index 450b3b7b9f..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMsr32.s +++ /dev/null @@ -1,45 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMsr32.Asm -# -# Abstract: -# -# AsmWriteMsr32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT32 -# EFIAPI -# AsmWriteMsr32 ( -# IN UINT32 Index, -# IN UINT32 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMsr32 -_AsmWriteMsr32: - movl 8(%esp),%eax - xorl %edx,%edx - movl 4(%esp),%ecx - wrmsr - ret - - - diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.S b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.S new file mode 100644 index 0000000000..802aad7803 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.S @@ -0,0 +1,45 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# WriteMsr64.Asm +# +# Abstract: +# +# AsmWriteMsr64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + + + +#------------------------------------------------------------------------------ +# UINT64 +# EFIAPI +# AsmWriteMsr64 ( +# IN UINT32 Index, +# IN UINT64 Value +# ); +#------------------------------------------------------------------------------ +.global _AsmWriteMsr64 +_AsmWriteMsr64: + movl 12(%esp),%edx + movl 8(%esp),%eax + movl 4(%esp),%ecx + wrmsr + ret + + + diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.s b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.s deleted file mode 100644 index 802aad7803..0000000000 --- a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.s +++ /dev/null @@ -1,45 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# WriteMsr64.Asm -# -# Abstract: -# -# AsmWriteMsr64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - - - - -#------------------------------------------------------------------------------ -# UINT64 -# EFIAPI -# AsmWriteMsr64 ( -# IN UINT32 Index, -# IN UINT64 Value -# ); -#------------------------------------------------------------------------------ -.global _AsmWriteMsr64 -_AsmWriteMsr64: - movl 12(%esp),%edx - movl 8(%esp),%eax - movl 4(%esp),%ecx - wrmsr - ret - - - diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S new file mode 100644 index 0000000000..6bce0e1372 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S @@ -0,0 +1,50 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CompareMem.Asm +# +# Abstract: +# +# CompareMem function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemCompareMem +_InternalMemCompareMem: + push %esi + push %edi + movl 12(%esp), %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + repe cmpsb + movzbl -1(%esi), %eax + movzbl -1(%edi), %edx + subl %edx, %eax + subl %edx, %eax + pop %edi + pop %esi + ret + + diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.s deleted file mode 100644 index 6bce0e1372..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.s +++ /dev/null @@ -1,50 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CompareMem.Asm -# -# Abstract: -# -# CompareMem function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemCompareMem -_InternalMemCompareMem: - push %esi - push %edi - movl 12(%esp), %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - repe cmpsb - movzbl -1(%esi), %eax - movzbl -1(%edi), %edx - subl %edx, %eax - subl %edx, %eax - pop %edi - pop %esi - ret - - diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S new file mode 100644 index 0000000000..56788cb981 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S @@ -0,0 +1,90 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CopyMem.asm +# +# Abstract: +# +# CopyMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_CopyMem ( +# IN VOID *Destination, +# IN VOID *Source, +# IN UINTN Count +# ) +#------------------------------------------------------------------------------ +.global _InternalMemCopyMem +_InternalMemCopyMem: + push %esi + push %edi + movl 16(%esp), %esi # esi <- Source + movl 12(%esp), %edi # edi <- Destination + movl 20(%esp), %edx # edx <- Count + leal -1(%edi,%edx,), %eax # eax <- End of Destination + cmpl %edi, %esi + jae L0 + cmpl %esi, %eax # Overlapped? + jae @CopyBackward # Copy backward if overlapped +L0: + xorl %ecx, %ecx + subl %esi, %ecx + andl $7, %ecx # ecx + esi aligns on 8-byte boundary + jz L1 + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx # edx <- remaining bytes to copy + rep + movsb +L1: + movl %edx, %ecx + andl $7, %edx + shrl $3, %ecx # ecx <- # of Qwords to copy + jz @CopyBytes + pushl %eax + pushl %eax + movq %mm0, (%esp) # save mm0 +L2: + movq (%esi), %mm0 + movntq %mm0, (%edi) + addl $8, %esi + addl $8, %edi + loop L2 + mfence + movq (%esp), %mm0 # restore mm0 + popl %ecx # stack cleanup + popl %ecx # stack cleanup + jmp @CopyBytes +@CopyBackward: + movl %eax, %edi # edi <- Last byte in Destination + leal -1(%esi,%edx,), %esi # esi <- Last byte in Source + std +@CopyBytes: + movl %edx, %ecx + rep + movsb + cld + movl 12(%esp), %eax + push %esi + push %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.s deleted file mode 100644 index 56788cb981..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.s +++ /dev/null @@ -1,90 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CopyMem.asm -# -# Abstract: -# -# CopyMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_CopyMem ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINTN Count -# ) -#------------------------------------------------------------------------------ -.global _InternalMemCopyMem -_InternalMemCopyMem: - push %esi - push %edi - movl 16(%esp), %esi # esi <- Source - movl 12(%esp), %edi # edi <- Destination - movl 20(%esp), %edx # edx <- Count - leal -1(%edi,%edx,), %eax # eax <- End of Destination - cmpl %edi, %esi - jae L0 - cmpl %esi, %eax # Overlapped? - jae @CopyBackward # Copy backward if overlapped -L0: - xorl %ecx, %ecx - subl %esi, %ecx - andl $7, %ecx # ecx + esi aligns on 8-byte boundary - jz L1 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx # edx <- remaining bytes to copy - rep - movsb -L1: - movl %edx, %ecx - andl $7, %edx - shrl $3, %ecx # ecx <- # of Qwords to copy - jz @CopyBytes - pushl %eax - pushl %eax - movq %mm0, (%esp) # save mm0 -L2: - movq (%esi), %mm0 - movntq %mm0, (%edi) - addl $8, %esi - addl $8, %edi - loop L2 - mfence - movq (%esp), %mm0 # restore mm0 - popl %ecx # stack cleanup - popl %ecx # stack cleanup - jmp @CopyBytes -@CopyBackward: - movl %eax, %edi # edi <- Last byte in Destination - leal -1(%esi,%edx,), %esi # esi <- Last byte in Source - std -@CopyBytes: - movl %edx, %ecx - rep - movsb - cld - movl 12(%esp), %eax - push %esi - push %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S new file mode 100644 index 0000000000..e23799e773 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem16.Asm +# +# Abstract: +# +# ScanMem16 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem16 +_InternalMemScanMem16: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movl 16(%esp), %eax + repne scasw + leal -2(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret + + diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.s deleted file mode 100644 index e23799e773..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem16.Asm -# -# Abstract: -# -# ScanMem16 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem16 -_InternalMemScanMem16: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repne scasw - leal -2(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret - - diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S new file mode 100644 index 0000000000..6b4a919dde --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem32.Asm +# +# Abstract: +# +# ScanMem32 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem32 +_InternalMemScanMem32: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movl 16(%esp), %eax + repne scasl + leal -4(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.s deleted file mode 100644 index 6b4a919dde..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem32.Asm -# -# Abstract: -# -# ScanMem32 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem32 -_InternalMemScanMem32: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repne scasl - leal -4(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S new file mode 100644 index 0000000000..00f6d74436 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S @@ -0,0 +1,53 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem64.Asm +# +# Abstract: +# +# ScanMem64 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem64 +_InternalMemScanMem64: + push %edi + movl 12(%esp), %ecx + movl 16(%esp), %eax + movl 20(%esp), %edx + movl 8(%esp), %edi +L0: + cmpl (%edi), %eax + leal 8(%edi), %edi + loopne L0 + jne L1 + cmpl -4(%edi), %edx + jecxz L1 + jne L0 +L1: + leal -8(%edi), %eax + cmovne %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.s deleted file mode 100644 index 00f6d74436..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.s +++ /dev/null @@ -1,53 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem64.Asm -# -# Abstract: -# -# ScanMem64 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem64 -_InternalMemScanMem64: - push %edi - movl 12(%esp), %ecx - movl 16(%esp), %eax - movl 20(%esp), %edx - movl 8(%esp), %edi -L0: - cmpl (%edi), %eax - leal 8(%edi), %edi - loopne L0 - jne L1 - cmpl -4(%edi), %edx - jecxz L1 - jne L0 -L1: - leal -8(%edi), %eax - cmovne %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S new file mode 100644 index 0000000000..57640378b4 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem8.Asm +# +# Abstract: +# +# ScanMem8 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem8 +_InternalMemScanMem8: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movb 16(%esp), %al + repne scasb + leal -1(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.s deleted file mode 100644 index 57640378b4..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem8.Asm -# -# Abstract: -# -# ScanMem8 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem8 -_InternalMemScanMem8: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movb 16(%esp), %al - repne scasb - leal -1(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S new file mode 100644 index 0000000000..8a893f893a --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S @@ -0,0 +1,67 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem.asm +# +# Abstract: +# +# SetMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT8 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem +_InternalMemSetMem: + push %edi + movl 12(%esp), %ecx # ecx <- Count + movl 8(%esp), %edi # edi <- Buffer + movl %ecx, %edx + shrl $3, %ecx # # of Qwords to set + movb 16(%esp), %al # al <- Value + jz @SetBytes + movb %al, %ah # ax <- Value | (Value << 8) + pushl %ecx + pushl %ecx + movq %mm0, (%esp) # save mm0 + movd %eax, %mm0 + pshufw $0x0,%mm0,%mm0 +L0: + movntq %mm0, (%edi) + addl $8, %edi + loop L0 + mfence + movq (%esp), %mm0 # restore mm0 + popl %ecx # stack cleanup + popl %ecx +@SetBytes: + andl $7, %edx + movl %edx, %ecx + rep + stosb + movl 8(%esp), %eax # eax <- Buffer as return value + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.s deleted file mode 100644 index 8a893f893a..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.s +++ /dev/null @@ -1,67 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem.asm -# -# Abstract: -# -# SetMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT8 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem -_InternalMemSetMem: - push %edi - movl 12(%esp), %ecx # ecx <- Count - movl 8(%esp), %edi # edi <- Buffer - movl %ecx, %edx - shrl $3, %ecx # # of Qwords to set - movb 16(%esp), %al # al <- Value - jz @SetBytes - movb %al, %ah # ax <- Value | (Value << 8) - pushl %ecx - pushl %ecx - movq %mm0, (%esp) # save mm0 - movd %eax, %mm0 - pshufw $0x0,%mm0,%mm0 -L0: - movntq %mm0, (%edi) - addl $8, %edi - loop L0 - mfence - movq (%esp), %mm0 # restore mm0 - popl %ecx # stack cleanup - popl %ecx -@SetBytes: - andl $7, %edx - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax # eax <- Buffer as return value - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S new file mode 100644 index 0000000000..bcbd49e442 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S @@ -0,0 +1,60 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem16.asm +# +# Abstract: +# +# SetMem16 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem16 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT16 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem16 +_InternalMemSetMem16: + push %edi + movl 12(%esp), %edx + movl 8(%esp), %edi + movl %edx, %ecx + andl $3, %edx + shrl $2, %ecx + movl 16(%esp), %eax + jz @SetWords + movd %eax, %mm0 + pshufw $0, %mm0, %mm0 +L0: + movntq %mm0, (%edi) + addl $8, %edi + loop L0 + mfence +@SetWords: + movl %edx, %ecx + rep + stosw + movl 8(%esp), %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.s deleted file mode 100644 index bcbd49e442..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.s +++ /dev/null @@ -1,60 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem16.asm -# -# Abstract: -# -# SetMem16 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem16 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT16 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem16 -_InternalMemSetMem16: - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - movl %edx, %ecx - andl $3, %edx - shrl $2, %ecx - movl 16(%esp), %eax - jz @SetWords - movd %eax, %mm0 - pshufw $0, %mm0, %mm0 -L0: - movntq %mm0, (%edi) - addl $8, %edi - loop L0 - mfence -@SetWords: - movl %edx, %ecx - rep - stosw - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S new file mode 100644 index 0000000000..a1a0eaf02e --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S @@ -0,0 +1,59 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem32.asm +# +# Abstract: +# +# SetMem32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem32 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT32 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem32 +_InternalMemSetMem32: + push %edi + movl 12(%esp), %edx + movl 8(%esp), %edi + movl %edx, %ecx + shrl %ecx + movd 16(%esp), %mm0 + movl %edi, %eax + jz @SetDwords + pshufw $0x44, %mm0, %mm0 +L0: + movntq %mm0, (%edi) + addl $8, %edi + loopl L0 + mfence +@SetDwords: + testb $1, %dl + jz @F + movd %mm0, (%edi) +L1: + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.s deleted file mode 100644 index a1a0eaf02e..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.s +++ /dev/null @@ -1,59 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem32.asm -# -# Abstract: -# -# SetMem32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem32 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT32 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem32 -_InternalMemSetMem32: - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - movl %edx, %ecx - shrl %ecx - movd 16(%esp), %mm0 - movl %edi, %eax - jz @SetDwords - pshufw $0x44, %mm0, %mm0 -L0: - movntq %mm0, (%edi) - addl $8, %edi - loopl L0 - mfence -@SetDwords: - testb $1, %dl - jz @F - movd %mm0, (%edi) -L1: - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S new file mode 100644 index 0000000000..9699581606 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S @@ -0,0 +1,50 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem64.asm +# +# Abstract: +# +# SetMem64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem64 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT64 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem64 +_InternalMemSetMem64: + push %edi + movq 16(%esp), %mm0 + movl 12(%esp), %ecx + movl 8(%esp), %edi + movl %edi, %eax +L0: + movntq %mm0, (%edi) + addl $8, %edi + loopl L0 + mfence + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.s deleted file mode 100644 index 9699581606..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.s +++ /dev/null @@ -1,50 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem64.asm -# -# Abstract: -# -# SetMem64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem64 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT64 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem64 -_InternalMemSetMem64: - push %edi - movq 16(%esp), %mm0 - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl %edi, %eax -L0: - movntq %mm0, (%edi) - addl $8, %edi - loopl L0 - mfence - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S new file mode 100644 index 0000000000..0bb19c7da2 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ZeroMem.asm +# +# Abstract: +# +# ZeroMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_ZeroMem ( +# IN VOID *Buffer, +# IN UINTN Count +# ) +#------------------------------------------------------------------------------ +.global _InternalMemZeroMem +_InternalMemZeroMem: + push %edi + movl 8(%esp), %edi + movl 12(%esp), %ecx + movl %ecx, %edx + shrl $3, %ecx + jz @ZeroBytes + pxor %mm0, %mm0 +L0: + movntq %mm0, (%edi) + addl $8, %edi + loop L0 + mfence +@ZeroBytes: + andl $7, %edx + xorl %eax, %eax + movl %edx, %ecx + rep + stosb + movl 8(%esp), %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.s b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.s deleted file mode 100644 index 0bb19c7da2..0000000000 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.s +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ZeroMem.asm -# -# Abstract: -# -# ZeroMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_ZeroMem ( -# IN VOID *Buffer, -# IN UINTN Count -# ) -#------------------------------------------------------------------------------ -.global _InternalMemZeroMem -_InternalMemZeroMem: - push %edi - movl 8(%esp), %edi - movl 12(%esp), %ecx - movl %ecx, %edx - shrl $3, %ecx - jz @ZeroBytes - pxor %mm0, %mm0 -L0: - movntq %mm0, (%edi) - addl $8, %edi - loop L0 - mfence -@ZeroBytes: - andl $7, %edx - xorl %eax, %eax - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.S new file mode 100644 index 0000000000..b48b8f0f1c --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.S @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CompareMem.Asm +# +# Abstract: +# +# CompareMem function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMemCompareMem +_InternalMemCompareMem: + push %esi + push %edi + movl 12(%esp),%esi + movl 16(%esp),%edi + movl 20(%esp),%ecx + repe cmpsb + movzbl -1(%esi), %eax + movzbl -1(%edi), %edx + subl %edx,%eax + pop %edi + pop %esi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.s deleted file mode 100644 index b48b8f0f1c..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.s +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CompareMem.Asm -# -# Abstract: -# -# CompareMem function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMemCompareMem -_InternalMemCompareMem: - push %esi - push %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx - repe cmpsb - movzbl -1(%esi), %eax - movzbl -1(%edi), %edx - subl %edx,%eax - pop %edi - pop %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.S new file mode 100644 index 0000000000..cce9836833 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.S @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CopyMem.Asm +# +# Abstract: +# +# CopyMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMemCopyMem +_InternalMemCopyMem: + push %esi + push %edi + movl 16(%esp),%esi # esi <- Source + movl 12(%esp),%edi # edi <- Destination + movl 20(%esp),%edx # edx <- Count + leal -1(%edi,%edx),%eax # eax <- End of Destination + cmpl %edi,%esi + jae L0 + cmpl %esi,%eax + jae @CopyBackward # Copy backward if overlapped +L0: + movl %edx,%ecx + andl $3,%edx + shrl $2,%ecx + rep + movsl # Copy as many Dwords as possible + jmp @CopyBytes +@CopyBackward: + movl %eax,%edi # edi <- End of Destination + leal -1(%esi,%edx),%esi # esi <- End of Source + std +@CopyBytes: + movl %edx,%ecx + rep + movsb # Copy bytes backward + cld + movl 12(%esp),%eax # eax <- Destination as return value + push %edi + push %esi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.s deleted file mode 100644 index cce9836833..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.s +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CopyMem.Asm -# -# Abstract: -# -# CopyMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMemCopyMem -_InternalMemCopyMem: - push %esi - push %edi - movl 16(%esp),%esi # esi <- Source - movl 12(%esp),%edi # edi <- Destination - movl 20(%esp),%edx # edx <- Count - leal -1(%edi,%edx),%eax # eax <- End of Destination - cmpl %edi,%esi - jae L0 - cmpl %esi,%eax - jae @CopyBackward # Copy backward if overlapped -L0: - movl %edx,%ecx - andl $3,%edx - shrl $2,%ecx - rep - movsl # Copy as many Dwords as possible - jmp @CopyBytes -@CopyBackward: - movl %eax,%edi # edi <- End of Destination - leal -1(%esi,%edx),%esi # esi <- End of Source - std -@CopyBytes: - movl %edx,%ecx - rep - movsb # Copy bytes backward - cld - movl 12(%esp),%eax # eax <- Destination as return value - push %edi - push %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.S new file mode 100644 index 0000000000..ec1095a5fb --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem16.Asm +# +# Abstract: +# +# ScanMem16 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMemScanMem16 +_InternalMemScanMem16: + push %edi + movl 12(%esp),%ecx + movl 8(%esp),%edi + movl 16(%esp),%eax + repne scasw + leal -2(%edi),%eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.s deleted file mode 100644 index ec1095a5fb..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem16.Asm -# -# Abstract: -# -# ScanMem16 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMemScanMem16 -_InternalMemScanMem16: - push %edi - movl 12(%esp),%ecx - movl 8(%esp),%edi - movl 16(%esp),%eax - repne scasw - leal -2(%edi),%eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.S new file mode 100644 index 0000000000..b51b4fecdf --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem32.Asm +# +# Abstract: +# +# ScanMem32 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMemScanMem32 +_InternalMemScanMem32: + push %edi + movl 12(%esp),%ecx + movl 8(%esp),%edi + movl 16(%esp),%eax + repne scasl + leal -4(%edi),%eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.s deleted file mode 100644 index b51b4fecdf..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.s +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem32.Asm -# -# Abstract: -# -# ScanMem32 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMemScanMem32 -_InternalMemScanMem32: - push %edi - movl 12(%esp),%ecx - movl 8(%esp),%edi - movl 16(%esp),%eax - repne scasl - leal -4(%edi),%eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.S new file mode 100644 index 0000000000..49e9e07cf7 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.S @@ -0,0 +1,53 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem64.Asm +# +# Abstract: +# +# ScanMem64 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMemScanMem64 +_InternalMemScanMem64: + push %edi + movl 12(%esp),%ecx + movl 16(%esp),%eax + movl 20(%esp),%edx + movl 8(%esp),%edi +L0: + cmpl (%edi),%eax + leal 8(%edi),%edi + loopne L0 + jne L1 + cmpl -4(%edi),%edx + jecxz L1 + jne L0 +L1: + leal -8(%edi),%eax + cmovne %ecx, %eax + pop %edi + ret + diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.s deleted file mode 100644 index 49e9e07cf7..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.s +++ /dev/null @@ -1,53 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem64.Asm -# -# Abstract: -# -# ScanMem64 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMemScanMem64 -_InternalMemScanMem64: - push %edi - movl 12(%esp),%ecx - movl 16(%esp),%eax - movl 20(%esp),%edx - movl 8(%esp),%edi -L0: - cmpl (%edi),%eax - leal 8(%edi),%edi - loopne L0 - jne L1 - cmpl -4(%edi),%edx - jecxz L1 - jne L0 -L1: - leal -8(%edi),%eax - cmovne %ecx, %eax - pop %edi - ret - diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.S new file mode 100644 index 0000000000..f4e3e282a2 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.S @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem8.Asm +# +# Abstract: +# +# ScanMem8 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + .code: + +.global _InternalMemScanMem8 +_InternalMemScanMem8: + push %edi + movl 12(%esp),%ecx + movl 8(%esp),%edi + movb 16(%esp),%al + repne scasb + leal -1(%edi),%eax + cmovnz %ecx, %eax + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.s deleted file mode 100644 index f4e3e282a2..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.s +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem8.Asm -# -# Abstract: -# -# ScanMem8 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - .code: - -.global _InternalMemScanMem8 -_InternalMemScanMem8: - push %edi - movl 12(%esp),%ecx - movl 8(%esp),%edi - movb 16(%esp),%al - repne scasb - leal -1(%edi),%eax - cmovnz %ecx, %eax - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.S new file mode 100644 index 0000000000..92eea21952 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.S @@ -0,0 +1,36 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem.Asm +# +# Abstract: +# +# SetMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMemSetMem +_InternalMemSetMem: + push %edi + movl 16(%esp),%eax + movl 8(%esp),%edi + movl 12(%esp),%ecx + rep + stosb + movl 8(%esp),%eax + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.s deleted file mode 100644 index 92eea21952..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.s +++ /dev/null @@ -1,36 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem.Asm -# -# Abstract: -# -# SetMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMemSetMem -_InternalMemSetMem: - push %edi - movl 16(%esp),%eax - movl 8(%esp),%edi - movl 12(%esp),%ecx - rep - stosb - movl 8(%esp),%eax - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.S new file mode 100644 index 0000000000..3871c5c183 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.S @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem16.Asm +# +# Abstract: +# +# SetMem16 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMemSetMem16 +_InternalMemSetMem16: + push %edi + movl 16(%esp),%eax + movl 8(%esp),%edi + movl 12(%esp),%ecx + rep + stosw + movl 8(%esp),%eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.s deleted file mode 100644 index 3871c5c183..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.s +++ /dev/null @@ -1,37 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem16.Asm -# -# Abstract: -# -# SetMem16 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMemSetMem16 -_InternalMemSetMem16: - push %edi - movl 16(%esp),%eax - movl 8(%esp),%edi - movl 12(%esp),%ecx - rep - stosw - movl 8(%esp),%eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.S new file mode 100644 index 0000000000..d7dd928c85 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.S @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem32.Asm +# +# Abstract: +# +# SetMem32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMemSetMem32 +_InternalMemSetMem32: + push %edi + movl 16(%esp),%eax + movl 8(%esp),%edi + movl 12(%esp),%ecx + rep + stosl + movl 8(%esp),%eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.s deleted file mode 100644 index d7dd928c85..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.s +++ /dev/null @@ -1,37 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem32.Asm -# -# Abstract: -# -# SetMem32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMemSetMem32 -_InternalMemSetMem32: - push %edi - movl 16(%esp),%eax - movl 8(%esp),%edi - movl 12(%esp),%ecx - rep - stosl - movl 8(%esp),%eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.S new file mode 100644 index 0000000000..5172c306b1 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.S @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem64.Asm +# +# Abstract: +# +# SetMem64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + #.MODEL flat,C + .code: + +.global _InternalMemSetMem64 +_InternalMemSetMem64: + push %edi + movl 12(%esp), %ecx + movl 16(%esp), %eax + movl 20(%esp), %edx + movl 8(%esp), %edi +L0: + mov %eax,-8(%edi,%ecx,8) + mov %edx,-4(%edi,%ecx,8) + loop L0 + movl %edi, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.s deleted file mode 100644 index 5172c306b1..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.s +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem64.Asm -# -# Abstract: -# -# SetMem64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - #.MODEL flat,C - .code: - -.global _InternalMemSetMem64 -_InternalMemSetMem64: - push %edi - movl 12(%esp), %ecx - movl 16(%esp), %eax - movl 20(%esp), %edx - movl 8(%esp), %edi -L0: - mov %eax,-8(%edi,%ecx,8) - mov %edx,-4(%edi,%ecx,8) - loop L0 - movl %edi, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.S b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.S new file mode 100644 index 0000000000..c3165bdc7e --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ZeroMem.Asm +# +# Abstract: +# +# ZeroMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .386: + .code: + +.global _InternalMemZeroMem +_InternalMemZeroMem: + push %edi + xorl %eax,%eax + movl 8(%esp),%edi + movl 12(%esp),%ecx + movl %ecx,%edx + shrl $2,%ecx + andl $3,%edx + pushl %edi + rep + stosl + movl %edx,%ecx + rep + stosb + popl %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.s b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.s deleted file mode 100644 index c3165bdc7e..0000000000 --- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ZeroMem.Asm -# -# Abstract: -# -# ZeroMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .386: - .code: - -.global _InternalMemZeroMem -_InternalMemZeroMem: - push %edi - xorl %eax,%eax - movl 8(%esp),%edi - movl 12(%esp),%ecx - movl %ecx,%edx - shrl $2,%ecx - andl $3,%edx - pushl %edi - rep - stosl - movl %edx,%ecx - rep - stosb - popl %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S new file mode 100644 index 0000000000..c01b0c1358 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S @@ -0,0 +1,48 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CompareMem.Asm +# +# Abstract: +# +# CompareMem function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemCompareMem +_InternalMemCompareMem: + push %esi + push %edi + movl 12(%esp), %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + repe cmpsb + movzbl -1(%esi), %eax + movzbl -1(%edi), %edx + subl %edx, %eax + subl %edx, %eax + pop %edi + pop %esi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.s deleted file mode 100644 index c01b0c1358..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.s +++ /dev/null @@ -1,48 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CompareMem.Asm -# -# Abstract: -# -# CompareMem function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemCompareMem -_InternalMemCompareMem: - push %esi - push %edi - movl 12(%esp), %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - repe cmpsb - movzbl -1(%esi), %eax - movzbl -1(%edi), %edx - subl %edx, %eax - subl %edx, %eax - pop %edi - pop %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S new file mode 100644 index 0000000000..deb9860339 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S @@ -0,0 +1,88 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CopyMem.asm +# +# Abstract: +# +# CopyMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_CopyMem ( +# IN VOID *Destination, +# IN VOID *Source, +# IN UINTN Count +# ) +#------------------------------------------------------------------------------ +.global _InternalMemCopyMem +_InternalMemCopyMem: + push %esi + push %edi + movl 16(%esp), %esi # esi <- Source + movl 12(%esp), %edi # edi <- Destination + movl 20(%esp), %edx # edx <- Count + leal -1(%edi,%edx,), %eax # eax <- End of Destination + cmpl %edi, %esi + jae L0 + cmpl %esi, %eax # Overlapped? + jae @CopyBackward # Copy backward if overlapped +L0: + xorl %ecx, %ecx + subl %edi, %ecx + andl $15, %ecx # ecx + edi aligns on 16-byte boundary + jz L1 + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx # edx <- remaining bytes to copy + rep + movsb +L1: + movl %edx, %ecx + andl $15, %edx + shrl $4, %ecx # ecx <- # of DQwords to copy + jz @CopyBytes + addl $-16, %esp + movdqu %xmm0, (%esp) +L2: + movdqu (%esi), %xmm0 + movntdq %xmm0, (%edi) + addl $16, %esi + addl $16, %edi + loop L2 + mfence + movdqu (%esp),%xmm0 + addl $16, %esp # stack cleanup + jmp @CopyBytes +@CopyBackward: + movl %eax, %edi # edi <- Last byte in Destination + leal -1(%esi,%edx,), %esi # esi <- Last byte in Source + std +@CopyBytes: + movl %edx, %ecx + rep + movsb + cld + movl 12(%esp), %eax # eax <- Destination as return value + pop %edi + pop %esi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.s deleted file mode 100644 index deb9860339..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.s +++ /dev/null @@ -1,88 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# CopyMem.asm -# -# Abstract: -# -# CopyMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_CopyMem ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINTN Count -# ) -#------------------------------------------------------------------------------ -.global _InternalMemCopyMem -_InternalMemCopyMem: - push %esi - push %edi - movl 16(%esp), %esi # esi <- Source - movl 12(%esp), %edi # edi <- Destination - movl 20(%esp), %edx # edx <- Count - leal -1(%edi,%edx,), %eax # eax <- End of Destination - cmpl %edi, %esi - jae L0 - cmpl %esi, %eax # Overlapped? - jae @CopyBackward # Copy backward if overlapped -L0: - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - jz L1 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx # edx <- remaining bytes to copy - rep - movsb -L1: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx # ecx <- # of DQwords to copy - jz @CopyBytes - addl $-16, %esp - movdqu %xmm0, (%esp) -L2: - movdqu (%esi), %xmm0 - movntdq %xmm0, (%edi) - addl $16, %esi - addl $16, %edi - loop L2 - mfence - movdqu (%esp),%xmm0 - addl $16, %esp # stack cleanup - jmp @CopyBytes -@CopyBackward: - movl %eax, %edi # edi <- Last byte in Destination - leal -1(%esi,%edx,), %esi # esi <- Last byte in Source - std -@CopyBytes: - movl %edx, %ecx - rep - movsb - cld - movl 12(%esp), %eax # eax <- Destination as return value - pop %edi - pop %esi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S new file mode 100644 index 0000000000..c433a28b72 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem16.Asm +# +# Abstract: +# +# ScanMem16 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem16 +_InternalMemScanMem16: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movl 16(%esp), %eax + repne scasw + leal -2(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.s deleted file mode 100644 index c433a28b72..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem16.Asm -# -# Abstract: -# -# ScanMem16 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem16 -_InternalMemScanMem16: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repne scasw - leal -2(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S new file mode 100644 index 0000000000..1de283c788 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem32.Asm +# +# Abstract: +# +# ScanMem32 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem32 +_InternalMemScanMem32: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movl 16(%esp), %eax + repnz scasl + leal -4(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.s deleted file mode 100644 index 1de283c788..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem32.Asm -# -# Abstract: -# -# ScanMem32 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem32 -_InternalMemScanMem32: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movl 16(%esp), %eax - repnz scasl - leal -4(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S new file mode 100644 index 0000000000..00f6d74436 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S @@ -0,0 +1,53 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem64.Asm +# +# Abstract: +# +# ScanMem64 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem64 +_InternalMemScanMem64: + push %edi + movl 12(%esp), %ecx + movl 16(%esp), %eax + movl 20(%esp), %edx + movl 8(%esp), %edi +L0: + cmpl (%edi), %eax + leal 8(%edi), %edi + loopne L0 + jne L1 + cmpl -4(%edi), %edx + jecxz L1 + jne L0 +L1: + leal -8(%edi), %eax + cmovne %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.s deleted file mode 100644 index 00f6d74436..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.s +++ /dev/null @@ -1,53 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem64.Asm -# -# Abstract: -# -# ScanMem64 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem64 -_InternalMemScanMem64: - push %edi - movl 12(%esp), %ecx - movl 16(%esp), %eax - movl 20(%esp), %edx - movl 8(%esp), %edi -L0: - cmpl (%edi), %eax - leal 8(%edi), %edi - loopne L0 - jne L1 - cmpl -4(%edi), %edx - jecxz L1 - jne L0 -L1: - leal -8(%edi), %eax - cmovne %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S new file mode 100644 index 0000000000..57640378b4 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ScanMem8.Asm +# +# Abstract: +# +# ScanMem8 function +# +# Notes: +# +# The following BaseMemoryLib instances share the same version of this file: +# +# BaseMemoryLibRepStr +# BaseMemoryLibMmx +# BaseMemoryLibSse2 +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .code: + +.global _InternalMemScanMem8 +_InternalMemScanMem8: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + movb 16(%esp), %al + repne scasb + leal -1(%edi), %eax + cmovnz %ecx, %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.s deleted file mode 100644 index 57640378b4..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.s +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ScanMem8.Asm -# -# Abstract: -# -# ScanMem8 function -# -# Notes: -# -# The following BaseMemoryLib instances share the same version of this file: -# -# BaseMemoryLibRepStr -# BaseMemoryLibMmx -# BaseMemoryLibSse2 -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .code: - -.global _InternalMemScanMem8 -_InternalMemScanMem8: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - movb 16(%esp), %al - repne scasb - leal -1(%edi), %eax - cmovnz %ecx, %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S new file mode 100644 index 0000000000..e778cd8b86 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S @@ -0,0 +1,76 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem.asm +# +# Abstract: +# +# SetMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT8 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem +_InternalMemSetMem: + push %edi + movl 12(%esp), %edx # edx <- Count + movl 8(%esp), %edi # edi <- Buffer + movb 16(%esp), %al # al <- Value + xorl %ecx, %ecx + subl %edi, %ecx + andl $15, %ecx # ecx + edi aligns on 16-byte boundary + jz L0 + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx + rep + stosb +L0: + movl %edx, %ecx + andl $15, %edx + shrl $4, %ecx # ecx <- # of DQwords to set + jz @SetBytes + movb %al, %ah # ax <- Value | (Value << 8) + addl $-16, %esp + movdqu %xmm0, (%esp) + movd %eax, %xmm0 + pshuflw $0, %xmm0, %xmm0 + movlhps %xmm0, %xmm0 +L1: + movntdq %xmm0, (%edi) + addl $16, %edi + loop L1 + mfence + movdqu (%esp), %xmm0 + addl $16, %esp # stack cleanup +@SetBytes: + movl %edx, %ecx + rep + stosb + movl 8(%esp), %eax # eax <- Buffer as return value + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.s deleted file mode 100644 index e778cd8b86..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.s +++ /dev/null @@ -1,76 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem.asm -# -# Abstract: -# -# SetMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT8 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem -_InternalMemSetMem: - push %edi - movl 12(%esp), %edx # edx <- Count - movl 8(%esp), %edi # edi <- Buffer - movb 16(%esp), %al # al <- Value - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - jz L0 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosb -L0: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx # ecx <- # of DQwords to set - jz @SetBytes - movb %al, %ah # ax <- Value | (Value << 8) - addl $-16, %esp - movdqu %xmm0, (%esp) - movd %eax, %xmm0 - pshuflw $0, %xmm0, %xmm0 - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence - movdqu (%esp), %xmm0 - addl $16, %esp # stack cleanup -@SetBytes: - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax # eax <- Buffer as return value - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S new file mode 100644 index 0000000000..27110b32d3 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S @@ -0,0 +1,72 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem16.asm +# +# Abstract: +# +# SetMem16 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem16 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT16 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem16 +_InternalMemSetMem16: + push %edi + movl 12(%esp), %edx + movl 8(%esp), %edi + xorl %ecx, %ecx + subl %edi, %ecx + andl $15, %ecx # ecx + edi aligns on 16-byte boundary + movl 16(%esp), %eax + jz L0 + shrl %ecx + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx + rep + stosw +L0: + movl %edx, %ecx + andl $7, %edx + shrl $3, %ecx + jz @SetWords + movd %eax, %xmm0 + pshuflw $0, %xmm0, %xmm0 + movlhps %xmm0, %xmm0 +L1: + movntdq %xmm0, (%edi) + addl $16, %edi + loop L1 + mfence +@SetWords: + movl %edx, %ecx + rep + stosw + movl 8(%esp), %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.s deleted file mode 100644 index 27110b32d3..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.s +++ /dev/null @@ -1,72 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem16.asm -# -# Abstract: -# -# SetMem16 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem16 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT16 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem16 -_InternalMemSetMem16: - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - movl 16(%esp), %eax - jz L0 - shrl %ecx - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosw -L0: - movl %edx, %ecx - andl $7, %edx - shrl $3, %ecx - jz @SetWords - movd %eax, %xmm0 - pshuflw $0, %xmm0, %xmm0 - movlhps %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -@SetWords: - movl %edx, %ecx - rep - stosw - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S new file mode 100644 index 0000000000..a1a6317115 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S @@ -0,0 +1,71 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem32.asm +# +# Abstract: +# +# SetMem32 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem32 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT32 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem32 +_InternalMemSetMem32: + push %edi + movl 12(%esp), %edx + movl 8(%esp), %edi + xorl %ecx, %ecx + subl %edi, %ecx + andl $15, %ecx # ecx + edi aligns on 16-byte boundary + movl 16(%esp), %eax + jz L0 + shrl $2, %ecx + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx + rep + stosl +L0: + movl %edx, %ecx + andl $3, %edx + shrl $2, %ecx + jz @SetDwords + movd %eax, %xmm0 + pshufd $0, %xmm0, %xmm0 +L1: + movntdq %xmm0, (%edi) + addl $16, %edi + loop L1 + mfence +@SetDwords: + movl %edx, %ecx + rep + stosl + movl 8(%esp), %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.s deleted file mode 100644 index a1a6317115..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.s +++ /dev/null @@ -1,71 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem32.asm -# -# Abstract: -# -# SetMem32 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem32 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT32 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem32 -_InternalMemSetMem32: - push %edi - movl 12(%esp), %edx - movl 8(%esp), %edi - xorl %ecx, %ecx - subl %edi, %ecx - andl $15, %ecx # ecx + edi aligns on 16-byte boundary - movl 16(%esp), %eax - jz L0 - shrl $2, %ecx - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosl -L0: - movl %edx, %ecx - andl $3, %edx - shrl $2, %ecx - jz @SetDwords - movd %eax, %xmm0 - pshufd $0, %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -@SetDwords: - movl %edx, %ecx - rep - stosl - movl 8(%esp), %eax - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S new file mode 100644 index 0000000000..2535a61aca --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S @@ -0,0 +1,63 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetMem64.asm +# +# Abstract: +# +# SetMem64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_SetMem64 ( +# IN VOID *Buffer, +# IN UINTN Count, +# IN UINT64 Value +# ) +#------------------------------------------------------------------------------ +.global _InternalMemSetMem64 +_InternalMemSetMem64: + push %edi + movl 12(%esp), %ecx + movl 8(%esp), %edi + testl $8, %edi + movddup 16(%esp), %xmm0 + jz L0 + movq %xmm0, (%edi) + addl $8, %edi + decl %ecx +L0: + movl %ecx, %edx + shrl %ecx + jz @SetQwords +L1: + movntdq %xmm0, (%edi) + addl $16, %edi + loop L1 + mfence +@SetQwords: + testb $1, %dl + jz L2 + movq %xmm0, (%edi) +L2: + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.s deleted file mode 100644 index 2535a61aca..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.s +++ /dev/null @@ -1,63 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# SetMem64.asm -# -# Abstract: -# -# SetMem64 function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_SetMem64 ( -# IN VOID *Buffer, -# IN UINTN Count, -# IN UINT64 Value -# ) -#------------------------------------------------------------------------------ -.global _InternalMemSetMem64 -_InternalMemSetMem64: - push %edi - movl 12(%esp), %ecx - movl 8(%esp), %edi - testl $8, %edi - movddup 16(%esp), %xmm0 - jz L0 - movq %xmm0, (%edi) - addl $8, %edi - decl %ecx -L0: - movl %ecx, %edx - shrl %ecx - jz @SetQwords -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -@SetQwords: - testb $1, %dl - jz L2 - movq %xmm0, (%edi) -L2: - pop %edi - ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S new file mode 100644 index 0000000000..f927f9128f --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S @@ -0,0 +1,68 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# ZeroMem.asm +# +# Abstract: +# +# ZeroMem function +# +# Notes: +# +#------------------------------------------------------------------------------ + + .686: + #.MODEL flat,C + .xmm: + .code: + +#------------------------------------------------------------------------------ +# VOID * +# _mem_ZeroMem ( +# IN VOID *Buffer, +# IN UINTN Count +# ) +#------------------------------------------------------------------------------ +.global _InternalMemZeroMem +_InternalMemZeroMem: + push %edi + movl 8(%esp), %edi + movl 12(%esp), %edx + xorl %ecx, %ecx + subl %edi, %ecx + xorl %eax, %eax + andl $15, %ecx + jz L0 + cmpl %edx, %ecx + cmova %edx, %ecx + subl %ecx, %edx + rep + stosb +L0: + movl %edx, %ecx + andl $15, %edx + shrl $4, %ecx + jz @ZeroBytes + pxor %xmm0, %xmm0 +L1: + movntdq %xmm0, (%edi) + addl $16, %edi + loop L1 + mfence +@ZeroBytes: + movl %edx, %ecx + rep + stosb + movl 8(%esp), %eax + pop %edi + ret diff --git a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.s b/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.s deleted file mode 100644 index f927f9128f..0000000000 --- a/MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.s +++ /dev/null @@ -1,68 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# ZeroMem.asm -# -# Abstract: -# -# ZeroMem function -# -# Notes: -# -#------------------------------------------------------------------------------ - - .686: - #.MODEL flat,C - .xmm: - .code: - -#------------------------------------------------------------------------------ -# VOID * -# _mem_ZeroMem ( -# IN VOID *Buffer, -# IN UINTN Count -# ) -#------------------------------------------------------------------------------ -.global _InternalMemZeroMem -_InternalMemZeroMem: - push %edi - movl 8(%esp), %edi - movl 12(%esp), %edx - xorl %ecx, %ecx - subl %edi, %ecx - xorl %eax, %eax - andl $15, %ecx - jz L0 - cmpl %edx, %ecx - cmova %edx, %ecx - subl %ecx, %edx - rep - stosb -L0: - movl %edx, %ecx - andl $15, %edx - shrl $4, %ecx - jz @ZeroBytes - pxor %xmm0, %xmm0 -L1: - movntdq %xmm0, (%edi) - addl $16, %edi - loop L1 - mfence -@ZeroBytes: - movl %edx, %ecx - rep - stosb - movl 8(%esp), %eax - pop %edi - ret diff --git a/Tools/Conf/BuildMacro.xml b/Tools/Conf/BuildMacro.xml index 4446d59847..7790c4cffe 100644 --- a/Tools/Conf/BuildMacro.xml +++ b/Tools/Conf/BuildMacro.xml @@ -376,7 +376,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - +