]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptPei / Ia32 / ScanMem64.nasm
CommitLineData
e8273934
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
e8273934
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 SECTION .text\r
27\r
28;------------------------------------------------------------------------------\r
29; CONST VOID *\r
30; EFIAPI\r
31; InternalMemScanMem64 (\r
32; IN CONST VOID *Buffer,\r
33; IN UINTN Length,\r
34; IN UINT64 Value\r
35; );\r
36;------------------------------------------------------------------------------\r
37global ASM_PFX(InternalMemScanMem64)\r
38ASM_PFX(InternalMemScanMem64):\r
39 push edi\r
40 mov ecx, [esp + 12]\r
41 mov eax, [esp + 16]\r
42 mov edx, [esp + 20]\r
43 mov edi, [esp + 8]\r
44.0:\r
45 cmp eax, [edi]\r
46 lea edi, [edi + 8]\r
47 loopne .0\r
48 jne .1\r
49 cmp edx, [edi - 4]\r
50 jecxz .1\r
51 jne .0\r
52.1:\r
53 lea eax, [edi - 8]\r
54 cmovne eax, ecx\r
55 pop edi\r
56 ret\r
57\r