From 8672ccb305fb50a5a51af98c58da7983db8e4447 Mon Sep 17 00:00:00 2001 From: xli24 Date: Thu, 30 Apr 2009 02:59:35 +0000 Subject: [PATCH] Fix the bug that SetMem.S of BaseMemoryLibOptDxe is incorrect. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8207 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/BaseMemoryLibOptDxe/Ia32/SetMem.S | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S index 441f347c2f..726ccd76fb 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S @@ -21,9 +21,6 @@ # #------------------------------------------------------------------------------ - .386: - .code: - .globl ASM_PFX(InternalMemSetMem) #------------------------------------------------------------------------------ @@ -38,18 +35,16 @@ ASM_PFX(InternalMemSetMem): push %edi movl 12(%esp),%ecx movb 16(%esp),%al - movb %ah, %al + movb %al, %ah shrd $16, %eax, %edx shld $16, %edx, %eax - movl %edx, %ecx - movl 8(%esp),%edi - shrd $2, %ecx, %ecx - rep - stosl movl %ecx, %edx + movl 8(%esp),%edi + shr $2, %ecx + rep stosl + movl %edx, %ecx andl $3, %ecx - rep - stosb + rep stosb movl 8(%esp),%eax pop %edi ret