\r
[Sources.Ia32]\r
Ia32/ScanMem64.nasm\r
- Ia32/ScanMem64.S\r
Ia32/ScanMem32.nasm\r
- Ia32/ScanMem32.S\r
Ia32/ScanMem16.nasm\r
- Ia32/ScanMem16.S\r
Ia32/ScanMem8.nasm\r
- Ia32/ScanMem8.S\r
Ia32/CompareMem.nasm\r
- Ia32/CompareMem.S\r
Ia32/ZeroMem.nasm\r
- Ia32/ZeroMem.S\r
Ia32/SetMem64.nasm\r
- Ia32/SetMem64.S\r
Ia32/SetMem32.nasm\r
- Ia32/SetMem32.S\r
Ia32/SetMem16.nasm\r
- Ia32/SetMem16.S\r
Ia32/SetMem.nasm\r
- Ia32/SetMem.S\r
Ia32/CopyMem.nasm\r
- Ia32/CopyMem.S\r
Ia32/ScanMem64.nasm\r
Ia32/ScanMem32.nasm\r
Ia32/ScanMem16.nasm\r
\r
[Sources.X64]\r
X64/ScanMem64.nasm\r
- X64/ScanMem64.S\r
X64/ScanMem32.nasm\r
- X64/ScanMem32.S\r
X64/ScanMem16.nasm\r
- X64/ScanMem16.S\r
X64/ScanMem8.nasm\r
- X64/ScanMem8.S\r
X64/CompareMem.nasm\r
- X64/CompareMem.S\r
X64/ZeroMem.nasm\r
- X64/ZeroMem.S\r
X64/SetMem64.nasm\r
- X64/SetMem64.S\r
X64/SetMem32.nasm\r
- X64/SetMem32.S\r
X64/SetMem16.nasm\r
- X64/SetMem16.S\r
X64/SetMem.nasm\r
- X64/SetMem.S\r
X64/CopyMem.nasm\r
- X64/CopyMem.S\r
X64/IsZeroBuffer.nasm\r
MemLibGuid.c\r
\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CompareMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CompareMem function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-# IN CONST VOID *DestinationBuffer,\r
-# IN CONST VOID *SourceBuffer,\r
-# IN UINTN Length\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemCompareMem):\r
- push %esi\r
- push %edi\r
- movl 12(%esp), %esi\r
- movl 16(%esp), %edi\r
- movl 20(%esp), %ecx\r
- repe cmpsb\r
- movzbl -1(%esi), %eax\r
- movzbl -1(%edi), %edx\r
- subl %edx, %eax\r
- pop %edi\r
- pop %esi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CopyMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemCopyMem (\r
-# IN VOID *Destination,\r
-# IN VOID *Source,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemCopyMem):\r
- push %esi\r
- push %edi\r
- movl 16(%esp), %esi # esi <- Source\r
- movl 12(%esp), %edi # edi <- Destination\r
- movl 20(%esp), %edx # edx <- Count\r
- leal -1(%esi,%edx,), %eax # eax <- End of Source\r
- cmpl %edi, %esi\r
- jae L0\r
- cmpl %edi, %eax # Overlapped?\r
- jae L_CopyBackward # Copy backward if overlapped\r
-L0:\r
- xorl %ecx, %ecx\r
- subl %edi, %ecx\r
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary\r
- jz L1\r
- cmpl %edx, %ecx\r
- cmova %edx, %ecx\r
- subl %ecx, %edx # edx <- remaining bytes to copy\r
- rep\r
- movsb\r
-L1:\r
- movl %edx, %ecx\r
- andl $15, %edx\r
- shrl $4, %ecx # ecx <- # of DQwords to copy\r
- jz L_CopyBytes\r
- addl $-16, %esp\r
- movdqu %xmm0, (%esp)\r
-L2:\r
- movdqu (%esi), %xmm0\r
- movntdq %xmm0, (%edi)\r
- addl $16, %esi\r
- addl $16, %edi\r
- loop L2\r
- mfence\r
- movdqu (%esp),%xmm0\r
- addl $16, %esp # stack cleanup\r
- jmp L_CopyBytes\r
-L_CopyBackward:\r
- movl %eax, %esi # esi <- Last byte in Source\r
- leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination\r
- std\r
-L_CopyBytes:\r
- movl %edx, %ecx\r
- rep\r
- movsb\r
- cld\r
- movl 12(%esp), %eax # eax <- Destination as return value\r
- pop %edi\r
- pop %esi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem16.Asm\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT16 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem16):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movl 16(%esp), %eax\r
- repne scasw\r
- leal -2(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem32):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movl 16(%esp), %eax\r
- repne scasl\r
- leal -4(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT64 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem64):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 16(%esp), %eax\r
- movl 20(%esp), %edx\r
- movl 8(%esp), %edi\r
-L0:\r
- cmpl (%edi), %eax\r
- leal 8(%edi), %edi\r
- loopne L0\r
- jne L1\r
- cmpl -4(%edi), %edx\r
- jecxz L1\r
- jne L0\r
-L1:\r
- leal -8(%edi), %eax\r
- cmovne %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem8.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT8 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemScanMem8):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 8(%esp), %edi\r
- movb 16(%esp), %al\r
- repne scasb\r
- leal -1(%edi), %eax\r
- cmovnz %ecx, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT8 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem):\r
- push %edi\r
- movl 12(%esp),%ecx\r
- movb 16(%esp),%al\r
- movb %al, %ah\r
- shrd $16, %eax, %edx\r
- shld $16, %edx, %eax\r
- movl %ecx, %edx\r
- movl 8(%esp),%edi\r
- shr $2, %ecx\r
- rep stosl\r
- movl %edx, %ecx\r
- andl $3, %ecx\r
- rep stosb\r
- movl 8(%esp),%eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem16.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem16 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT16 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem16):\r
- push %edi\r
- movl 16(%esp), %eax\r
- movl 8(%esp), %edi\r
- movl 12(%esp), %ecx\r
- rep\r
- stosw\r
- movl 8(%esp), %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem32 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT32 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem32):\r
- push %edi\r
- movl 16(%esp),%eax\r
- movl 8(%esp),%edi\r
- movl 12(%esp),%ecx\r
- rep\r
- stosl\r
- movl 8(%esp),%eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem64 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT64 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemSetMem64):\r
- push %edi\r
- movl 12(%esp), %ecx\r
- movl 16(%esp), %eax\r
- movl 20(%esp), %edx\r
- movl 8(%esp), %edi\r
-L0:\r
- mov %eax, -8(%edi, %ecx, 8)\r
- mov %edx, -4(%edi, %ecx, 8)\r
- loop L0\r
- movl %edi, %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ZeroMem.S\r
-#\r
-# Abstract:\r
-#\r
-# ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemZeroMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMemZeroMem):\r
- push %edi\r
- xorl %eax,%eax\r
- movl 8(%esp),%edi\r
- movl 12(%esp),%ecx\r
- movl %ecx,%edx\r
- shrl $2,%ecx\r
- andl $3,%edx\r
- pushl %edi\r
- rep\r
- stosl\r
- movl %edx,%ecx\r
- rep\r
- stosb\r
- popl %eax\r
- pop %edi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from CompareMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CompareMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CompareMem function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-# IN CONST VOID *DestinationBuffer,\r
-# IN CONST VOID *SourceBuffer,\r
-# IN UINTN Length\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)\r
-ASM_PFX(InternalMemCompareMem):\r
- pushq %rsi\r
- pushq %rdi\r
- movq %rcx, %rsi\r
- movq %rdx, %rdi\r
- movq %r8, %rcx\r
- repe cmpsb\r
- movzbq -1(%rsi) , %rax\r
- movzbq -1(%rdi) , %rdx\r
- sub %dl, %al\r
- popq %rdi\r
- popq %rsi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from CopyMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# CopyMem.S\r
-#\r
-# Abstract:\r
-#\r
-# CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemCopyMem (\r
-# IN VOID *Destination,\r
-# IN VOID *Source,\r
-# IN UINTN Count\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)\r
-ASM_PFX(InternalMemCopyMem):\r
- pushq %rsi\r
- pushq %rdi\r
- movq %rdx, %rsi # rsi <- Source\r
- movq %rcx, %rdi # rdi <- Destination\r
- leaq -1(%rsi,%r8,), %r9 # r9 <- Last byte of Source\r
- cmpq %rdi, %rsi\r
- movq %rdi, %rax # rax <- Destination as return value\r
- jae L0 # Copy forward if Source > Destination\r
- cmpq %rdi, %r9 # Overlapped?\r
- jae L_CopyBackward # Copy backward if overlapped\r
-L0:\r
- xorq %rcx, %rcx\r
- subq %rdi, %rcx # rcx <- -rdi\r
- andq $15, %rcx # rcx + rsi should be 16 bytes aligned\r
- jz L1 # skip if rcx == 0\r
- cmpq %r8, %rcx\r
- cmova %r8, %rcx\r
- subq %rcx, %r8\r
- rep movsb\r
-L1:\r
- movq %r8, %rcx\r
- andq $15, %r8\r
- shrq $4, %rcx # rcx <- # of DQwords to copy\r
- jz L_CopyBytes\r
- movdqu %xmm0, 0x18(%rsp) # save xmm0 on stack\r
-L2:\r
- movdqu (%rsi), %xmm0 # rsi may not be 16-byte aligned\r
- movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned\r
- addq $16, %rsi\r
- addq $16, %rdi\r
- loop L2\r
- mfence\r
- movdqa 0x18(%rsp), %xmm0 # restore xmm0\r
- jmp L_CopyBytes # copy remaining bytes\r
-L_CopyBackward:\r
- movq %r9, %rsi # rsi <- Last byte of Source\r
- leaq -1(%rdi, %r8,), %rdi # rdi <- Last byte of Destination\r
- std\r
-L_CopyBytes:\r
- movq %r8, %rcx\r
- rep movsb\r
- cld\r
- popq %rdi\r
- popq %rsi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem16.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem16.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT16 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)\r
-ASM_PFX(InternalMemScanMem16):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasw\r
- leaq -2(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem32.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)\r
-ASM_PFX(InternalMemScanMem32):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasl\r
- leaq -4(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem64.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT64 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)\r
-ASM_PFX(InternalMemScanMem64):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- movq %rdx, %rcx\r
- repne scasq\r
- leaq -8(%rdi), %rax\r
- cmovnz %rcx, %rax\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ScanMem8.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ScanMem8.S\r
-#\r
-# Abstract:\r
-#\r
-# ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-# The following BaseMemoryLib instances contain the same copy of this file:\r
-#\r
-# BaseMemoryLibRepStr\r
-# BaseMemoryLibMmx\r
-# BaseMemoryLibSse2\r
-# BaseMemoryLibOptDxe\r
-# BaseMemoryLibOptPei\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-# IN CONST VOID *Buffer,\r
-# IN UINTN Length,\r
-# IN UINT8 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)\r
-ASM_PFX(InternalMemScanMem8):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- movq %r8, %rax\r
- repne scasb\r
- leaq -1(%rdi), %rax\r
- cmovnz %rcx, %rax # set rax to 0 if not found\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT8 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
-ASM_PFX(InternalMemSetMem):\r
- pushq %rdi\r
- pushq %rbx\r
- pushq %rcx # push Buffer\r
- movq %r8, %rax # rax = Value\r
- andq $0xff, %rax # rax = lower 8 bits of r8, upper 56 bits are 0\r
- movb %al, %ah # ah = al\r
- movw %ax, %bx # bx = ax\r
- shlq $0x10, %rax # rax = ax << 16\r
- movw %bx, %ax # ax = bx\r
- movq %rax, %rbx # ebx = eax\r
- shlq $0x20, %rax # rax = rax << 32\r
- orq %rbx, %rax # eax = ebx\r
- movq %rcx, %rdi # rdi = Buffer\r
- movq %rdx, %rcx # rcx = Count\r
- shrq $3, %rcx # rcx = rcx / 8\r
- cld\r
- rep stosq\r
- movq %rdx, %rcx # rcx = rdx\r
- andq $7, %rcx # rcx = rcx & 7\r
- rep stosb\r
- popq %rax # rax = Buffer\r
- popq %rbx\r
- popq %rdi\r
- ret\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem16.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem16.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem16 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT16 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)\r
-ASM_PFX(InternalMemSetMem16):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- xchg %rdx, %rcx\r
- rep stosw\r
- movq %rdx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem32.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem32.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# EFIAPI\r
-# InternalMemSetMem32 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT32 Value\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)\r
-ASM_PFX(InternalMemSetMem32):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- xchgq %rdx, %rcx\r
- rep stosl\r
- movq %rdx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from SetMem64.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# SetMem64.S\r
-#\r
-# Abstract:\r
-#\r
-# SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemSetMem64 (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count,\r
-# IN UINT64 Value\r
-# )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)\r
-ASM_PFX(InternalMemSetMem64):\r
- pushq %rdi\r
- movq %rcx, %rdi\r
- movq %r8, %rax\r
- xchg %rdx, %rcx\r
- rep stosq\r
- movq %rdx, %rax\r
- popq %rdi\r
- ret\r
-\r
+++ /dev/null
-#\r
-# ConvertAsm.py: Automatically generated from ZeroMem.asm\r
-#\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-# ZeroMem.S\r
-#\r
-# Abstract:\r
-#\r
-# ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID *\r
-# InternalMemZeroMem (\r
-# IN VOID *Buffer,\r
-# IN UINTN Count\r
-# );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)\r
-ASM_PFX(InternalMemZeroMem):\r
- pushq %rdi\r
- pushq %rcx\r
- xorq %rax, %rax\r
- movq %rcx, %rdi\r
- movq %rdx, %rcx\r
- shrq $3, %rcx\r
- andq $7, %rdx\r
- cld\r
- rep stosq\r
- movq %rdx, %rcx\r
- rep stosb\r
- popq %rax\r
- popq %rdi\r
- ret\r
-\r