X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseMemoryLibOptPei%2FX64%2FScanMem32.S;h=f863cfe4bb560bdf86f50282062082ed536df593;hb=1fef058f4b8fefc455bb171e4908c3e835b1b492;hp=9420725d5ea740d1174a2c68a84031b120392e5d;hpb=ba19956ac3c600eaeff1c90556457105032218d8;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S index 9420725d5e..f863cfe4bb 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S +++ b/MdePkg/Library/BaseMemoryLibOptPei/X64/ScanMem32.S @@ -3,7 +3,7 @@ # #------------------------------------------------------------------------------ # -# Copyright (c) 2006 - 2008, Intel Corporation +# Copyright (c) 2006 - 2009, 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 @@ -42,16 +42,15 @@ # IN UINT32 Value # ); #------------------------------------------------------------------------------ -.intel_syntax noprefix ASM_GLOBAL ASM_PFX(InternalMemScanMem32) ASM_PFX(InternalMemScanMem32): - push rdi - mov rdi, rcx - mov rax, r8 - mov rcx, rdx - repne scasd - lea rax, [rdi - 4] - cmovnz rax, rcx - pop rdi + pushq %rdi + movq %rcx, %rdi + movq %rdx, %rcx + movq %r8, %rax + repne scasl + leaq -4(%rdi), %rax + cmovnz %rcx, %rax # set rax to 0 if not found + popq %rdi ret