summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibRepStr/x64
diff options
context:
space:
mode:
authorbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 07:28:19 +0000
committerbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 07:28:19 +0000
commiteb227e96bd06a5b0f2f933187a679e7fb3382cd9 (patch)
treeb16e46f494d8d9d8552d8d0e882ad78019934071 /MdePkg/Library/BaseMemoryLibRepStr/x64
parent27169a56e67556796ab0410c8917436dc9aa2abf (diff)
downloadedk2-platforms-eb227e96bd06a5b0f2f933187a679e7fb3382cd9.tar.xz
1. Updated function headers for all assembly function
2. Optimized register usage in SetMemXX functions in all lib instances 3. Fixed a logical error in CopyMem for all lib instances git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1139 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibRepStr/x64')
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm15
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm9
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm8
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm7
11 files changed, 99 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm
index b8e289bb27..554bc07c64 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm
@@ -29,6 +29,15 @@
.code
+;------------------------------------------------------------------------------
+; INTN
+; EFIAPI
+; InternalMemCompareMem (
+; IN CONST VOID *DestinationBuffer,
+; IN CONST VOID *SourceBuffer,
+; IN UINTN Length
+; );
+;------------------------------------------------------------------------------
InternalMemCompareMem PROC USES rsi rdi
mov rsi, rcx
mov rdi, rdx
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm
index 43630715cb..a2e04056fd 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm
@@ -23,10 +23,19 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; EFIAPI
+; InternalMemCopyMem (
+; IN VOID *Destination,
+; IN VOID *Source,
+; IN UINTN Count
+; )
+;------------------------------------------------------------------------------
InternalMemCopyMem PROC USES rsi rdi
mov rsi, rdx ; rsi <- Source
mov rdi, rcx ; rdi <- Destination
- lea r9, [rdi + r8 - 1] ; r9 <- End of Destination
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source
cmp rsi, rdi
mov rax, rdi ; rax <- Destination as return value
jae @F
@@ -39,8 +48,8 @@ InternalMemCopyMem PROC USES rsi rdi
rep movsq ; Copy as many Qwords as possible
jmp @CopyBytes
@CopyBackward:
- mov rdi, r9 ; rdi <- End of Destination
- lea rsi, [rsi + r8 - 1] ; esi <- End of Source
+ mov rsi, r9 ; rsi <- End of Source
+ lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
std ; set direction flag
@CopyBytes:
mov rcx, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm
index 6af88fae5b..a2538c2cca 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm
@@ -29,6 +29,15 @@
.code
+;------------------------------------------------------------------------------
+; CONST VOID *
+; EFIAPI
+; InternalMemScanMem16 (
+; IN CONST VOID *Buffer,
+; IN UINTN Length,
+; IN UINT16 Value
+; );
+;------------------------------------------------------------------------------
InternalMemScanMem16 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm
index f9c9feb00e..e0523d8547 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm
@@ -29,6 +29,15 @@
.code
+;------------------------------------------------------------------------------
+; CONST VOID *
+; EFIAPI
+; InternalMemScanMem32 (
+; IN CONST VOID *Buffer,
+; IN UINTN Length,
+; IN UINT32 Value
+; );
+;------------------------------------------------------------------------------
InternalMemScanMem32 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm
index 2f286c9e2f..0e7e9c782f 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm
@@ -29,6 +29,15 @@
.code
+;------------------------------------------------------------------------------
+; CONST VOID *
+; EFIAPI
+; InternalMemScanMem64 (
+; IN CONST VOID *Buffer,
+; IN UINTN Length,
+; IN UINT64 Value
+; );
+;------------------------------------------------------------------------------
InternalMemScanMem64 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm
index 4027ece768..879273f960 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm
@@ -29,6 +29,15 @@
.code
+;------------------------------------------------------------------------------
+; CONST VOID *
+; EFIAPI
+; InternalMemScanMem8 (
+; IN CONST VOID *Buffer,
+; IN UINTN Length,
+; IN UINT8 Value
+; );
+;------------------------------------------------------------------------------
InternalMemScanMem8 PROC USES rdi
mov rdi, rcx
mov rcx, rdx
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm
index b9108c750e..5306520169 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm
@@ -23,6 +23,15 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; EFIAPI
+; InternalMemSetMem (
+; IN VOID *Buffer,
+; IN UINTN Count,
+; IN UINT8 Value
+; )
+;------------------------------------------------------------------------------
InternalMemSetMem PROC USES rdi
mov rax, r8
mov rdi, rcx
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm
index 3a9fd47fc3..fce9ed7ed5 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm
@@ -23,6 +23,15 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; EFIAPI
+; InternalMemSetMem16 (
+; IN VOID *Buffer,
+; IN UINTN Count,
+; IN UINT16 Value
+; )
+;------------------------------------------------------------------------------
InternalMemSetMem16 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm
index 2020d19065..ce9e54da85 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm
@@ -23,6 +23,15 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; EFIAPI
+; InternalMemSetMem32 (
+; IN VOID *Buffer,
+; IN UINTN Count,
+; IN UINT32 Value
+; );
+;------------------------------------------------------------------------------
InternalMemSetMem32 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm
index 70ca4fb75a..97884a36fe 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm
@@ -23,6 +23,14 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; InternalMemSetMem64 (
+; IN VOID *Buffer,
+; IN UINTN Count,
+; IN UINT64 Value
+; )
+;------------------------------------------------------------------------------
InternalMemSetMem64 PROC USES rdi
mov rdi, rcx
mov rax, r8
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm
index c18a2e27c1..c01af8e6e4 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm
@@ -23,6 +23,13 @@
.code
+;------------------------------------------------------------------------------
+; VOID *
+; InternalMemZeroMem (
+; IN VOID *Buffer,
+; IN UINTN Count
+; );
+;------------------------------------------------------------------------------
InternalMemZeroMem PROC USES rdi
push rcx
xor rax, rax