Initial import.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
45
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm
Normal file
45
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm
Normal file
@@ -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:
|
||||
;
|
||||
; 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
|
||||
|
||||
InternalMemCompareMem PROC USES esi edi
|
||||
mov esi, [esp + 12]
|
||||
mov edi, [esp + 16]
|
||||
mov ecx, [esp + 20]
|
||||
repe cmpsb
|
||||
movzx eax, byte ptr [esi - 1]
|
||||
movzx edx, byte ptr [edi - 1]
|
||||
sub eax, edx
|
||||
ret
|
||||
InternalMemCompareMem ENDP
|
||||
|
||||
END
|
55
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
Normal file
55
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
Normal file
@@ -0,0 +1,55 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM 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
|
||||
.model flat,C
|
||||
.code
|
||||
|
||||
InternalMemCopyMem PROC USES esi edi
|
||||
mov esi, [esp + 16] ; esi <- Source
|
||||
mov edi, [esp + 12] ; edi <- Destination
|
||||
mov edx, [esp + 20] ; edx <- Count
|
||||
lea eax, [edi + edx - 1] ; eax <- End of Destination
|
||||
cmp esi, edi
|
||||
jae @F
|
||||
cmp eax, esi
|
||||
jae @CopyBackward ; Copy backward if overlapped
|
||||
@@:
|
||||
mov ecx, edx
|
||||
and edx, 3
|
||||
shr ecx, 2
|
||||
rep movsd ; Copy as many Dwords as possible
|
||||
jmp @CopyBytes
|
||||
@CopyBackward:
|
||||
mov edi, eax ; edi <- End of Destination
|
||||
lea esi, [esi + edx - 1] ; esi <- End of Source
|
||||
std
|
||||
@CopyBytes:
|
||||
mov ecx, edx
|
||||
rep movsb ; Copy bytes backward
|
||||
cld
|
||||
mov eax, [esp + 12] ; eax <- Destination as return value
|
||||
ret
|
||||
InternalMemCopyMem ENDP
|
||||
|
||||
END
|
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm
Normal file
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm
Normal file
@@ -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
|
||||
|
||||
InternalMemScanMem16 PROC USES edi
|
||||
mov ecx, [esp + 12]
|
||||
mov edi, [esp + 8]
|
||||
mov eax, [esp + 16]
|
||||
repne scasw
|
||||
lea eax, [edi - 2]
|
||||
cmovnz eax, ecx
|
||||
ret
|
||||
InternalMemScanMem16 ENDP
|
||||
|
||||
END
|
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm
Normal file
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm
Normal file
@@ -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
|
||||
|
||||
InternalMemScanMem32 PROC USES edi
|
||||
mov ecx, [esp + 12]
|
||||
mov edi, [esp + 8]
|
||||
mov eax, [esp + 16]
|
||||
repne scasd
|
||||
lea eax, [edi - 4]
|
||||
cmovnz eax, ecx
|
||||
ret
|
||||
InternalMemScanMem32 ENDP
|
||||
|
||||
END
|
53
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm
Normal file
53
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm
Normal file
@@ -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
|
||||
|
||||
InternalMemScanMem64 PROC USES edi
|
||||
mov ecx, [esp + 12]
|
||||
mov eax, [esp + 16]
|
||||
mov edx, [esp + 20]
|
||||
mov edi, [esp + 8]
|
||||
@@:
|
||||
cmp eax, [edi]
|
||||
lea edi, [edi + 8]
|
||||
loopne @B
|
||||
jne @F
|
||||
cmp edx, [edi - 4]
|
||||
jecxz @F
|
||||
jne @B
|
||||
@@:
|
||||
lea eax, [edi - 8]
|
||||
cmovne eax, ecx
|
||||
ret
|
||||
InternalMemScanMem64 ENDP
|
||||
|
||||
END
|
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm
Normal file
44
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm
Normal file
@@ -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
|
||||
|
||||
InternalMemScanMem8 PROC USES edi
|
||||
mov ecx, [esp + 12]
|
||||
mov edi, [esp + 8]
|
||||
mov al, [esp + 16]
|
||||
repne scasb
|
||||
lea eax, [edi - 1]
|
||||
cmovnz eax, ecx
|
||||
ret
|
||||
InternalMemScanMem8 ENDP
|
||||
|
||||
END
|
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm
Normal file
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm
Normal file
@@ -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:
|
||||
;
|
||||
; SetMem.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; SetMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.386
|
||||
.model flat,C
|
||||
.code
|
||||
|
||||
InternalMemSetMem PROC USES edi
|
||||
mov eax, [esp + 16]
|
||||
mov edi, [esp + 8]
|
||||
mov ecx, [esp + 12]
|
||||
rep stosb
|
||||
mov eax, [esp + 8]
|
||||
ret
|
||||
InternalMemSetMem ENDP
|
||||
|
||||
END
|
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm
Normal file
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm
Normal file
@@ -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
|
||||
.model flat,C
|
||||
.code
|
||||
|
||||
InternalMemSetMem16 PROC USES edi
|
||||
mov eax, [esp + 16]
|
||||
mov edi, [esp + 8]
|
||||
mov ecx, [esp + 12]
|
||||
rep stosw
|
||||
mov eax, [esp + 8]
|
||||
ret
|
||||
InternalMemSetMem16 ENDP
|
||||
|
||||
END
|
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm
Normal file
37
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm
Normal file
@@ -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
|
||||
.model flat,C
|
||||
.code
|
||||
|
||||
InternalMemSetMem32 PROC USES edi
|
||||
mov eax, [esp + 16]
|
||||
mov edi, [esp + 8]
|
||||
mov ecx, [esp + 12]
|
||||
rep stosd
|
||||
mov eax, [esp + 8]
|
||||
ret
|
||||
InternalMemSetMem32 ENDP
|
||||
|
||||
END
|
41
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm
Normal file
41
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm
Normal file
@@ -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
|
||||
|
||||
InternalMemSetMem64 PROC USES edi
|
||||
mov ecx, [esp + 12]
|
||||
mov eax, [esp + 16]
|
||||
mov edx, [esp + 20]
|
||||
mov edi, [esp + 8]
|
||||
@@:
|
||||
mov [edi + ecx*4 - 8], eax
|
||||
mov [edi + ecx*4 - 4], edx
|
||||
loop @B
|
||||
mov eax, edi
|
||||
ret
|
||||
InternalMemSetMem64 ENDP
|
||||
|
||||
END
|
43
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm
Normal file
43
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm
Normal file
@@ -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:
|
||||
;
|
||||
; ZeroMem.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ZeroMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.386
|
||||
.model flat,C
|
||||
.code
|
||||
|
||||
InternalMemZeroMem PROC USES edi
|
||||
xor eax, eax
|
||||
mov edi, [esp + 8]
|
||||
mov ecx, [esp + 12]
|
||||
mov edx, ecx
|
||||
shr ecx, 2
|
||||
and edx, 3
|
||||
push edi
|
||||
rep stosd
|
||||
mov ecx, edx
|
||||
rep stosb
|
||||
pop eax
|
||||
ret
|
||||
InternalMemZeroMem ENDP
|
||||
|
||||
END
|
Reference in New Issue
Block a user