From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- .../Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 roms/edk2/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm (limited to 'roms/edk2/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm') diff --git a/roms/edk2/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm b/roms/edk2/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm new file mode 100644 index 000000000..16fd931c0 --- /dev/null +++ b/roms/edk2/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem8.nasm @@ -0,0 +1,49 @@ +;------------------------------------------------------------------------------ +; +; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +; Module Name: +; +; ScanMem8.Asm +; +; Abstract: +; +; ScanMem8 function +; +; Notes: +; +; The following BaseMemoryLib instances contain the same copy of this file: +; +; BaseMemoryLibRepStr +; BaseMemoryLibMmx +; BaseMemoryLibSse2 +; BaseMemoryLibOptDxe +; BaseMemoryLibOptPei +; +;------------------------------------------------------------------------------ + + DEFAULT REL + SECTION .text + +;------------------------------------------------------------------------------ +; CONST VOID * +; EFIAPI +; InternalMemScanMem8 ( +; IN CONST VOID *Buffer, +; IN UINTN Length, +; IN UINT8 Value +; ); +;------------------------------------------------------------------------------ +global ASM_PFX(InternalMemScanMem8) +ASM_PFX(InternalMemScanMem8): + push 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 + pop rdi + ret + -- cgit 1.2.3-korg