Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing builds. Also updated the SPD and FPD files UiNames
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2616 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) 2006, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# CompareMem.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# CompareMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# INTN
|
||||
# EFIAPI
|
||||
# InternalMemCompareMem (
|
||||
# IN CONST VOID *DestinationBuffer,
|
||||
# IN CONST VOID *SourceBuffer,
|
||||
# IN UINTN Length
|
||||
# );
|
||||
#------------------------------------------------------------------------------
|
||||
.global _InternalMemCompareMem;
|
||||
_InternalMemCompareMem:
|
||||
push %rsi
|
||||
push %rdi
|
||||
mov %rcx, %rsi
|
||||
mov %rdx, %rdi
|
||||
mov %r8, %rcx
|
||||
repe cmpsb
|
||||
movzbq -1(%rsi), %rax
|
||||
movzbq -1(%rdi), %rdx
|
||||
sub %rdx, %rax
|
||||
pop %rdi
|
||||
pop %rsi
|
||||
ret
|
@@ -1,52 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CompareMem.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CompareMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
; The following BaseMemoryLib instances share the same version of this file:
|
||||
;
|
||||
; BaseMemoryLibRepStr
|
||||
; BaseMemoryLibMmx
|
||||
; BaseMemoryLibSse2
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
mov rcx, r8
|
||||
repe cmpsb
|
||||
movzx rax, byte ptr [rsi - 1]
|
||||
movzx rdx, byte ptr [rdi - 1]
|
||||
sub rax, rdx
|
||||
ret
|
||||
InternalMemCompareMem ENDP
|
||||
|
||||
END
|
@@ -1,72 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) 2006, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# CopyMem.asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# CopyMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# VOID *
|
||||
# EFIAPI
|
||||
# InternalMemCopyMem (
|
||||
# OUT VOID *DestinationBuffer,
|
||||
# IN CONST VOID *SourceBuffer,
|
||||
# IN UINTN Length
|
||||
# );
|
||||
#------------------------------------------------------------------------------
|
||||
.global _InternalMemCopyMem;
|
||||
_InternalMemCopyMem:
|
||||
push %rsi
|
||||
push %rdi
|
||||
mov %rdi, %rsi
|
||||
mov %rcx, %rdi
|
||||
lea -1(%r8,%rsi,1),%r9
|
||||
cmp %rdi, %rsi
|
||||
mov %rdi, %rax
|
||||
jae L1
|
||||
cmp %rdi, %r9
|
||||
jae LCopyBackward # Copy backward if overlapped
|
||||
L1:
|
||||
mov %r8, %rcx
|
||||
and $7, %r8
|
||||
shr $3, %rcx
|
||||
jz LCopyBytes
|
||||
movd %mm0, %r10 # (Save mm0 in r10)
|
||||
L2:
|
||||
movd (%rsi), %mm0
|
||||
movntq %mm0, (%rdi)
|
||||
add $8, %rsi
|
||||
add $8, %rdi
|
||||
loop L2
|
||||
mfence
|
||||
movd %r10, %mm0 #(Restore mm0)
|
||||
jmp LCopyBytes
|
||||
LCopyBackward:
|
||||
mov %r9, %rsi
|
||||
lea -1(%r8,%rdi,1),%rdi
|
||||
std # set direction flag
|
||||
LCopyBytes:
|
||||
mov %r8, %rcx
|
||||
rep
|
||||
movsb # Copy bytes backward
|
||||
cld
|
||||
pop %rdi
|
||||
pop %rsi
|
||||
ret
|
@@ -1,70 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CopyMem.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CopyMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; EFIAPI
|
||||
; InternalMemCopyMem (
|
||||
; OUT VOID *DestinationBuffer,
|
||||
; IN CONST VOID *SourceBuffer,
|
||||
; IN UINTN Length
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemCopyMem PROC USES rsi 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
|
||||
jae @F
|
||||
cmp r9, rdi
|
||||
jae @CopyBackward ; Copy backward if overlapped
|
||||
@@:
|
||||
mov rcx, r8
|
||||
and r8, 7
|
||||
shr rcx, 3 ; rcx <- # of Qwords to copy
|
||||
jz @CopyBytes
|
||||
DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10)
|
||||
@@:
|
||||
DB 0fh, 6fh, 06h ; movd mm0, [rsi]
|
||||
DB 0fh, 0e7h, 07h ; movntq [rdi], mm0
|
||||
add rsi, 8
|
||||
add rdi, 8
|
||||
loop @B
|
||||
mfence
|
||||
DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0)
|
||||
jmp @CopyBytes
|
||||
@CopyBackward:
|
||||
mov rsi, r9 ; rsi <- End of Source
|
||||
lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination
|
||||
std ; set direction flag
|
||||
@CopyBytes:
|
||||
mov rcx, r8
|
||||
rep movsb ; Copy bytes backward
|
||||
cld
|
||||
ret
|
||||
InternalMemCopyMem ENDP
|
||||
|
||||
END
|
@@ -1,51 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ScanMem16.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ScanMem16 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
; The following BaseMemoryLib instances share the same version of this file:
|
||||
;
|
||||
; BaseMemoryLibRepStr
|
||||
; BaseMemoryLibMmx
|
||||
; BaseMemoryLibSse2
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
mov rcx, rdx
|
||||
repne scasw
|
||||
lea rax, [rdi - 2]
|
||||
cmovnz rax, rcx
|
||||
ret
|
||||
InternalMemScanMem16 ENDP
|
||||
|
||||
END
|
@@ -1,51 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ScanMem32.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ScanMem32 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
; The following BaseMemoryLib instances share the same version of this file:
|
||||
;
|
||||
; BaseMemoryLibRepStr
|
||||
; BaseMemoryLibMmx
|
||||
; BaseMemoryLibSse2
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
mov rcx, rdx
|
||||
repne scasd
|
||||
lea rax, [rdi - 4]
|
||||
cmovnz rax, rcx
|
||||
ret
|
||||
InternalMemScanMem32 ENDP
|
||||
|
||||
END
|
@@ -1,51 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ScanMem64.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ScanMem64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
; The following BaseMemoryLib instances share the same version of this file:
|
||||
;
|
||||
; BaseMemoryLibRepStr
|
||||
; BaseMemoryLibMmx
|
||||
; BaseMemoryLibSse2
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
mov rcx, rdx
|
||||
repne scasq
|
||||
lea rax, [rdi - 8]
|
||||
cmovnz rax, rcx
|
||||
ret
|
||||
InternalMemScanMem64 ENDP
|
||||
|
||||
END
|
@@ -1,51 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ScanMem8.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ScanMem8 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
; The following BaseMemoryLib instances share the same version of this file:
|
||||
;
|
||||
; BaseMemoryLibRepStr
|
||||
; BaseMemoryLibMmx
|
||||
; BaseMemoryLibSse2
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
mov rax, r8
|
||||
repne scasb
|
||||
lea rax, [rdi - 1]
|
||||
cmovnz rax, rcx ; set rax to 0 if not found
|
||||
ret
|
||||
InternalMemScanMem8 ENDP
|
||||
|
||||
END
|
@@ -1,58 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SetMem.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; SetMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; EFIAPI
|
||||
; InternalMemSetMem (
|
||||
; OUT VOID *Buffer,
|
||||
; IN UINTN Length,
|
||||
; IN UINT8 Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemSetMem PROC USES rdi
|
||||
mov rax, r8
|
||||
mov ah, al
|
||||
DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax
|
||||
mov r8, rcx
|
||||
mov rdi, r8 ; rdi <- Buffer
|
||||
mov rcx, rdx
|
||||
and edx, 7
|
||||
shr rcx, 3
|
||||
jz @SetBytes
|
||||
DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h
|
||||
@@:
|
||||
DB 0fh, 0e7h, 07h ; movntq [rdi], mm0
|
||||
add rdi, 8
|
||||
loop @B
|
||||
mfence
|
||||
@SetBytes:
|
||||
mov ecx, edx
|
||||
rep stosb
|
||||
mov rax, r8
|
||||
ret
|
||||
InternalMemSetMem ENDP
|
||||
|
||||
END
|
@@ -1,57 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SetMem16.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; SetMem16 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; EFIAPI
|
||||
; InternalMemSetMem16 (
|
||||
; OUT VOID *Buffer,
|
||||
; IN UINTN Length,
|
||||
; IN UINT16 Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemSetMem16 PROC USES rdi
|
||||
mov rax, r8
|
||||
DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax
|
||||
mov r8, rcx
|
||||
mov rdi, r8
|
||||
mov rcx, rdx
|
||||
and edx, 3
|
||||
shr rcx, 2
|
||||
jz @SetWords
|
||||
DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h
|
||||
@@:
|
||||
DB 0fh, 0e7h, 07h ; movntq [rdi], mm0
|
||||
add rdi, 8
|
||||
loop @B
|
||||
mfence
|
||||
@SetWords:
|
||||
mov ecx, edx
|
||||
rep stosw
|
||||
mov rax, r8
|
||||
ret
|
||||
InternalMemSetMem16 ENDP
|
||||
|
||||
END
|
@@ -1,53 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SetMem32.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; SetMem32 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; InternalMemSetMem32 (
|
||||
; IN VOID *Buffer,
|
||||
; IN UINTN Count,
|
||||
; IN UINT32 Value
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemSetMem32 PROC
|
||||
DB 49h, 0fh, 6eh, 0c0h ; movd mm0, r8 (Value)
|
||||
mov rax, rcx ; rax <- Buffer
|
||||
xchg rcx, rdx ; rcx <- Count rdx <- Buffer
|
||||
shr rcx, 1 ; rcx <- # of qwords to set
|
||||
jz @SetDwords
|
||||
DB 0fh, 70h, 0C0h, 44h ; pshufw mm0, mm0, 44h
|
||||
@@:
|
||||
DB 0fh, 0e7h, 02h ; movntq [rdx], mm0
|
||||
lea rdx, [rdx + 8] ; use "lea" to avoid flag changes
|
||||
loop @B
|
||||
mfence
|
||||
@SetDwords:
|
||||
jnc @F
|
||||
DB 0fh, 7eh, 02h ; movd [rdx], mm0
|
||||
@@:
|
||||
ret
|
||||
InternalMemSetMem32 ENDP
|
||||
|
||||
END
|
@@ -1,46 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SetMem64.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; SetMem64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; InternalMemSetMem64 (
|
||||
; IN VOID *Buffer,
|
||||
; IN UINTN Count,
|
||||
; IN UINT64 Value
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemSetMem64 PROC
|
||||
DB 49h, 0fh, 6eh, 0c0h ; movd mm0, r8 (Value)
|
||||
mov rax, rcx ; rax <- Buffer
|
||||
xchg rcx, rdx ; rcx <- Count
|
||||
@@:
|
||||
DB 0fh, 0e7h, 02h ; movntq [rdx], mm0
|
||||
add rdx, 8
|
||||
loop @B
|
||||
mfence
|
||||
ret
|
||||
InternalMemSetMem64 ENDP
|
||||
|
||||
END
|
@@ -1,54 +0,0 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ZeroMem.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; ZeroMem function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID *
|
||||
; InternalMemZeroMem (
|
||||
; IN VOID *Buffer,
|
||||
; IN UINTN Count
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalMemZeroMem PROC USES rdi
|
||||
mov rdi, rcx
|
||||
mov rcx, rdx
|
||||
mov r8, rdi
|
||||
and edx, 7
|
||||
shr rcx, 3
|
||||
jz @ZeroBytes
|
||||
DB 0fh, 0efh, 0c0h ; pxor mm0, mm0
|
||||
@@:
|
||||
DB 0fh, 0e7h, 7 ; movntq [rdi], mm0
|
||||
add rdi, 8
|
||||
loop @B
|
||||
DB 0fh, 0aeh, 0f0h ; mfence
|
||||
@ZeroBytes:
|
||||
xor eax, eax
|
||||
mov ecx, edx
|
||||
rep stosb
|
||||
mov rax, r8
|
||||
ret
|
||||
InternalMemZeroMem ENDP
|
||||
|
||||
END
|
Reference in New Issue
Block a user