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