]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / X64 / ScanMem64.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; ScanMem64.Asm
9 ;
10 ; Abstract:
11 ;
12 ; ScanMem64 function
13 ;
14 ; Notes:
15 ;
16 ; The following BaseMemoryLib instances contain the same copy of this file:
17 ;
18 ; BaseMemoryLibRepStr
19 ; BaseMemoryLibMmx
20 ; BaseMemoryLibSse2
21 ; BaseMemoryLibOptDxe
22 ; BaseMemoryLibOptPei
23 ;
24 ;------------------------------------------------------------------------------
25
26 DEFAULT REL
27 SECTION .text
28
29 ;------------------------------------------------------------------------------
30 ; CONST VOID *
31 ; EFIAPI
32 ; InternalMemScanMem64 (
33 ; IN CONST VOID *Buffer,
34 ; IN UINTN Length,
35 ; IN UINT64 Value
36 ; );
37 ;------------------------------------------------------------------------------
38 global ASM_PFX(InternalMemScanMem64)
39 ASM_PFX(InternalMemScanMem64):
40 push rdi
41 mov rdi, rcx
42 mov rax, r8
43 mov rcx, rdx
44 repne scasq
45 lea rax, [rdi - 8]
46 cmovnz rax, rcx
47 pop rdi
48 ret
49