summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibOptPei
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibOptPei')
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c5
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h29
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/SetMem16Wrapper.c22
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/SetMem32Wrapper.c22
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/SetMem64Wrapper.c22
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.S23
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S35
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.S17
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S19
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.S17
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.S17
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.S15
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.S15
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.S17
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.S15
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.S23
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c5
24 files changed, 159 insertions, 187 deletions
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
index 6922177a02..278ef3369e 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
@@ -2,7 +2,6 @@
CompareMem() implementation.
The following BaseMemoryLib instances contain the same copy of this file:
-
BaseMemoryLib
BaseMemoryLibMmx
BaseMemoryLibSse2
@@ -10,9 +9,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
index 831e491b50..5077820be0 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
index b14abbc75a..b315ff5322 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h b/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h
index 5861244c16..f40299b9ca 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h
+++ b/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h
@@ -8,10 +8,8 @@
BaseMemoryLibRepStr
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
- PeiMemoryLib
- DxeMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -30,13 +28,12 @@
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
-
/**
Copy Length bytes from Source to Destination.
@param DestinationBuffer Target of copy
- @param SourceBuffer Place to copy from
- @param Length Number of bytes to copy
+ @param SourceBuffer Place to copy from
+ @param Length Number of bytes to copy
@return Destination
@@ -52,9 +49,9 @@ InternalMemCopyMem (
/**
Set Buffer to Value for Size bytes.
- @param Buffer Memory to set.
- @param Length Number of bytes to set
- @param Value Value of the set operation.
+ @param Buffer Memory to set.
+ @param Length Number of bytes to set
+ @param Value Value of the set operation.
@return Buffer
@@ -71,7 +68,7 @@ InternalMemSetMem (
Fills a target buffer with a 16-bit value, and returns the target buffer.
@param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
+ @param Length Count of 16-bit value to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
@@ -89,7 +86,7 @@ InternalMemSetMem16 (
Fills a target buffer with a 32-bit value, and returns the target buffer.
@param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
+ @param Length Count of 32-bit value to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
@@ -107,7 +104,7 @@ InternalMemSetMem32 (
Fills a target buffer with a 64-bit value, and returns the target buffer.
@param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
+ @param Length Count of 64-bit value to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
@@ -163,7 +160,7 @@ InternalMemCompareMem (
matching 8-bit value in the target buffer.
@param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
+ @param Length Count of 8-bit value to scan. Must be non-zero.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@@ -182,7 +179,7 @@ InternalMemScanMem8 (
matching 16-bit value in the target buffer.
@param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
+ @param Length Count of 16-bit value to scan. Must be non-zero.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@@ -201,7 +198,7 @@ InternalMemScanMem16 (
matching 32-bit value in the target buffer.
@param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
+ @param Length Count of 32-bit value to scan. Must be non-zero.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@@ -220,7 +217,7 @@ InternalMemScanMem32 (
matching 64-bit value in the target buffer.
@param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
+ @param Length Count of 64-bit value to scan. Must be non-zero.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
index e7128e90d4..f8b3ab9763 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c
index 7683910e80..d31b13f4d4 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c
@@ -9,9 +9,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c
index e3b2688681..6d7acf3f7b 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c
index d17b3a7943..2add7849cd 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/SetMem16Wrapper.c
index 3388eda8e5..d74b80f053 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/SetMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/SetMem16Wrapper.c
@@ -1,17 +1,7 @@
/** @file
SetMem16() implementation.
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
The following BaseMemoryLib instances contain the same copy of this file:
-
BaseMemoryLib
BaseMemoryLibMmx
BaseMemoryLibSse2
@@ -19,12 +9,18 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
-
-**/
+ UefiMemoryLib
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
#include "MemLibInternals.h"
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/SetMem32Wrapper.c
index 0a0ce82706..dc84d2093a 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/SetMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/SetMem32Wrapper.c
@@ -1,17 +1,7 @@
/** @file
SetMem32() implementation.
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
The following BaseMemoryLib instances contain the same copy of this file:
-
BaseMemoryLib
BaseMemoryLibMmx
BaseMemoryLibSse2
@@ -19,12 +9,18 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
-
-**/
+ UefiMemoryLib
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
#include "MemLibInternals.h"
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/SetMem64Wrapper.c
index 10ef682764..05dc453c3a 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/SetMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/SetMem64Wrapper.c
@@ -1,17 +1,7 @@
/** @file
SetMem64() implementation.
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
The following BaseMemoryLib instances contain the same copy of this file:
-
BaseMemoryLib
BaseMemoryLibMmx
BaseMemoryLibSse2
@@ -19,12 +9,18 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
-
-**/
+ UefiMemoryLib
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
#include "MemLibInternals.h"
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
index 18fbcdc18a..b6bc1f4387 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.S
index c207db7dda..bdae174140 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -42,19 +42,18 @@
# IN UINTN Length
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
ASM_PFX(InternalMemCompareMem):
- push rsi
- push rdi
- mov rsi, rcx
- mov rdi, rdx
- mov rcx, r8
+ pushq %rsi
+ pushq %rdi
+ movq %rcx, %rsi
+ movq %rdx, %rdi
+ movq %r8, %rcx
repe cmpsb
- movzx rax, byte ptr [rsi - 1]
- movzx rdx, byte ptr [rdi - 1]
- sub rax, rdx
- pop rdi
- pop rsi
+ movzbq -1(%rsi) , %rax
+ movzbq -1(%rdi) , %rdx
+ subq %rdx, %rax
+ popq %rdi
+ popq %rsi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S
index 2ab574621e..82f74116b2 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -34,34 +34,33 @@
# IN UINTN Count
# )
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
ASM_PFX(InternalMemCopyMem):
- push rsi
- push rdi
- mov rsi, rdx # rsi <- Source
- mov rdi, rcx # rdi <- Destination
- lea r9, [rsi + r8 - 1] # r9 <- End of Source
- cmp rsi, rdi
- mov rax, rdi # rax <- Destination as return value
+ pushq %rsi
+ pushq %rdi
+ movq %rdx, %rsi # rsi <- Source
+ movq %rcx, %rdi # rdi <- Destination
+ leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source
+ cmpq %rdi, %rsi
+ movq %rdi, %rax # rax <- Destination as return value
jae _InternalMemCopyMem_al_0000
- cmp r9, rdi
+ cmpq %rdi, %r9
jae _atSym_CopyBackward # Copy backward if overlapped
_InternalMemCopyMem_al_0000:
- mov rcx, r8
- and r8, 7
- shr rcx, 3
+ movq %r8, %rcx
+ andq $7, %r8
+ shrq $3, %rcx
rep movsq # Copy as many Qwords as possible
jmp _atSym_CopyBytes
_atSym_CopyBackward:
- mov rsi, r9 # rsi <- End of Source
- lea rdi, [rdi + r8 - 1] # esi <- End of Destination
+ movq %r9, %rsi # rsi <- End of Source
+ leaq -1(%rdi, %r8), %rdi # rdi <- End of Destination
std # set direction flag
_atSym_CopyBytes:
- mov rcx, r8
+ movq %r8, %rcx
rep movsb # Copy bytes backward
cld
- pop rdi
- pop rsi
+ popq %rdi
+ popq %rsi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.S
index 140b0a40e5..c60998b38c 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem16.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -42,16 +42,15 @@
# IN UINT16 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
ASM_PFX(InternalMemScanMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ movq %r8, %rax
repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- pop rdi
+ leaq -2(%rdi), %rax
+ cmovnz %rcx, %rax # set rax to 0 if not found
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S
index 9420725d5e..f863cfe4bb 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -42,16 +42,15 @@
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
ASM_PFX(InternalMemScanMem32):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasd
- lea rax, [rdi - 4]
- cmovnz rax, rcx
- pop rdi
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ movq %r8, %rax
+ repne scasl
+ leaq -4(%rdi), %rax
+ cmovnz %rcx, %rax # set rax to 0 if not found
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.S
index 917c37c3c5..9bc02b06b2 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem64.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -42,16 +42,15 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
ASM_PFX(InternalMemScanMem64):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ movq %r8, %rax
repne scasq
- lea rax, [rdi - 8]
- cmovnz rax, rcx
- pop rdi
+ leaq -8(%rdi), %rax
+ cmovnz %rcx, %rax # set rax to 0 if not found
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.S
index 74667a6200..ded53c37b8 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -42,16 +42,15 @@
# IN UINT8 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
ASM_PFX(InternalMemScanMem8):
- push rdi
- mov rdi, rcx
- mov rcx, rdx
- mov rax, r8
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ movq %r8, %rax
repne scasb
- lea rax, [rdi - 1]
- cmovnz rax, rcx # set rax to 0 if not found
- pop rdi
+ leaq -1(%rdi), %rax
+ cmovnz %rcx, %rax # set rax to 0 if not found
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.S
index cae41c3cab..695802a8f4 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -34,15 +34,14 @@
# IN UINT8 Value
# )
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemSetMem)
ASM_PFX(InternalMemSetMem):
- push rdi
- mov rax, r8 # rax = Value
- mov rdi, rcx # rdi = Buffer
- xchg rcx, rdx # rcx = Count, rdx = Buffer
+ pushq %rdi
+ movq %r8, %rax # rax = Value
+ movq %rcx, %rdi # rdi = Buffer
+ xchgq %rdx, %rcx # rcx = Count, rdx = Buffer
rep stosb
- mov rax, rdx # rax = Buffer
- pop rdi
+ movq %rdx, %rax # rax = Buffer
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.S
index c091131a75..35486df8cf 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem16.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -34,15 +34,14 @@
# IN UINT16 Value
# )
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
ASM_PFX(InternalMemSetMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %r8, %rax
+ xchgq %rdx, %rcx
rep stosw
- mov rax, rdx
- pop rdi
+ movq %rdx, %rax
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.S
index 9fbcdafcb4..93d705c674 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem32.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -34,15 +34,14 @@
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
ASM_PFX(InternalMemSetMem32):
- push rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosd
- mov rax, rdx
- pop rdi
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %r8, %rax
+ xchgq %rdx, %rcx
+ rep stosl
+ movq %rdx, %rax
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.S
index c4f0b4685d..5b2f088c96 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/SetMem64.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -33,15 +33,14 @@
# IN UINT64 Value
# )
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
ASM_PFX(InternalMemSetMem64):
- push rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
+ pushq %rdi
+ movq %rcx, %rdi
+ movq %r8, %rax
+ xchgq %rdx, %rcx
rep stosq
- mov rax, rdx
- pop rdi
+ movw %rdx, %rax
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.S
index 73bb786943..2fd6249249 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ZeroMem.S
@@ -3,7 +3,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2008, Intel Corporation
+# Copyright (c) 2006 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -32,20 +32,19 @@
# IN UINTN Count
# );
#------------------------------------------------------------------------------
-.intel_syntax noprefix
ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
ASM_PFX(InternalMemZeroMem):
- push rdi
- push rcx
- xor rax, rax
- mov rdi, rcx
- mov rcx, rdx
- shr rcx, 3
- and rdx, 7
+ pushq %rdi
+ pushq %rcx
+ xorq %rax, %rax
+ movq %rcx, %rdi
+ movq %rdx, %rcx
+ shrq $3, %rcx
+ andq $7, %rdx
rep stosq
- mov ecx, edx
+ movl %edx, %ecx
rep stosb
- pop rax
- pop rdi
+ popq %rax
+ popq %rdi
ret
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
index 11187ba13a..2923356f13 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
@@ -10,9 +10,9 @@
BaseMemoryLibOptDxe
BaseMemoryLibOptPei
PeiMemoryLib
- DxeMemoryLib
+ UefiMemoryLib
- Copyright (c) 2006 - 2008 , Intel Corporation<BR>
+ Copyright (c) 2006 - 2009 , Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -48,6 +48,5 @@ ZeroMem (
{
ASSERT (!(Buffer == NULL && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
-
return InternalMemZeroMem (Buffer, Length);
}