]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.S
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EfiCommonLib / Ia32 / EfiSetMem.S
index 206563438b60a6b54853efefd8c34b468664f1ed..b0759589ffcba0313e69b9943e37b4e368dc8533 100644 (file)
-#/*++
-#
-#Copyright (c) 2006, 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        
-#http://opensource.org/licenses/bsd-license.php                                            
-#                                                                                          
-#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-#
-#Module Name:
-#
-#  EfiSetMem.asm
-#
-#Abstract:
-#
-#  This is the code that supports IA32-optimized SetMem service
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
-    .686: 
-    #.MODEL flat,C
-    .mmx: 
-    .code: 
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(EfiCommonLibSetMem)
-
-#VOID
-#EfiCommonLibSetMem (
-#  IN VOID   *Buffer,
-#  IN UINTN  Count,
-#  IN UINT8  Value
-#  )
-#/*++
-#
-#Input:  VOID   *Buffer - Pointer to buffer to write
-#        UINTN  Count   - Number of bytes to write
-#        UINT8  Value   - Value to write
-#
-#Output: None.
-#
-#Saves:
-#
-#Modifies:
-#
-#Description:  This function is an optimized set-memory function.
-#
-#Notes:  This function tries to set memory 8 bytes at a time. As a result, 
-#        it first picks up any misaligned bytes, then words, before getting 
-#        in the main loop that does the 8-byte clears.
-#
-#--*/
-ASM_PFX(EfiCommonLibSetMem):
-
-    pushl  %ebp
-    movl   %esp, %ebp
-    subl   $0x10, %esp # Reserve space for local variable UINT64 QWordValue @[ebp - 10H] & UINT64 MmxSave @[ebp - 18H]
-    pushl  %ebx
-    pushl  %edi
-
-    movl 0xC(%ebp), %edx # Count
-    testl %edx, %edx
-    je _SetMemDone
-
-    pushl %ebx
-
-    movl 8(%ebp), %eax  # Buffer
-    movb 0x10(%ebp), %bl # Value
-    movl %eax, %edi
-    movb %bl, %bh
-
-    cmpl $256, %edx
-    jb _SetRemindingByte
-
-    andb $0x7, %al
-    testb %al, %al
-    je _SetBlock
-
-    movl %edi, %eax
-    shrl $3, %eax
-    incl %eax
-    shll $3, %eax
-    subl %edi, %eax
-    cmpl %edx, %eax
-    jnb _SetRemindingByte
-
-    subl %eax, %edx
-    movl %eax, %ecx
-
-    movb %bl, %al
-    rep
-    stosb
-
-_SetBlock: 
-    movl %edx, %eax
-    shrl $6, %eax
-    testl %eax, %eax
-    je _SetRemindingByte
-
-    shll $6, %eax
-    subl %eax, %edx
-    shrl $6, %eax
-
-    movw %bx, -0x10(%ebp)            # QWordValue[0]
-    movw %bx, -0x10+2(%ebp)          # QWordValue[2]
-    movw %bx, -0x10+4(%ebp)          # QWordValue[4]
-    movw %bx, -0x10+6(%ebp)          # QWordValue[6]
-
-
-    movq  %mm0, -8(%ebp) # Save mm0 to MmxSave
-    movq  -0x10(%ebp), %mm0 # Load QWordValue to mm0
-
-_B: 
-    movq  %mm0, %ds:(%edi)
-    movq  %mm0, %ds:8(%edi)
-    movq  %mm0, %ds:16(%edi)
-    movq  %mm0, %ds:24(%edi)
-    movq  %mm0, %ds:32(%edi)
-    movq  %mm0, %ds:40(%edi)
-    movq  %mm0, %ds:48(%edi)
-    movq  %mm0, %ds:56(%edi)
-    addl $64, %edi
-    decl %eax
-    jnz _B
-
-# Restore mm0
-    movq  -8(%ebp), %mm0 # Restore MmxSave to mm0
-    emms                                 # Exit MMX Instruction
-
-_SetRemindingByte: 
-    movl %edx, %ecx
-
-    movl %ebx, %eax
-    shll $16, %eax
-    movw %bx, %ax
-    shrl $2, %ecx
-    rep
-    stosl
-
-    movl %edx, %ecx
-    andl $3, %ecx
-    rep
-    stosb
-
-    popl %ebx
-
-_SetMemDone: 
-
-    popl %edi
-    popl %ebx
-    leave
-    ret
-
-#EfiCommonLibSetMem ENDP
-
+#/*++\r
+#\r
+#Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+#This program and the accompanying materials                          \r
+#are licensed and made available under the terms and conditions of the BSD License         \r
+#which accompanies this distribution.  The full text of the license may be found at        \r
+#http://opensource.org/licenses/bsd-license.php                                            \r
+#                                                                                          \r
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+#\r
+#Module Name:\r
+#\r
+#  EfiSetMem.asm\r
+#\r
+#Abstract:\r
+#\r
+#  This is the code that supports IA32-optimized SetMem service\r
+#\r
+#--*/\r
+#include "EfiBind.h"\r
+#---------------------------------------------------------------------------\r
+    .686: \r
+    #.MODEL flat,C\r
+    .mmx: \r
+    .code: \r
+\r
+#---------------------------------------------------------------------------\r
+.globl ASM_PFX(EfiCommonLibSetMem)\r
+\r
+#VOID\r
+#EfiCommonLibSetMem (\r
+#  IN VOID   *Buffer,\r
+#  IN UINTN  Count,\r
+#  IN UINT8  Value\r
+#  )\r
+#/*++\r
+#\r
+#Input:  VOID   *Buffer - Pointer to buffer to write\r
+#        UINTN  Count   - Number of bytes to write\r
+#        UINT8  Value   - Value to write\r
+#\r
+#Output: None.\r
+#\r
+#Saves:\r
+#\r
+#Modifies:\r
+#\r
+#Description:  This function is an optimized set-memory function.\r
+#\r
+#Notes:  This function tries to set memory 8 bytes at a time. As a result, \r
+#        it first picks up any misaligned bytes, then words, before getting \r
+#        in the main loop that does the 8-byte clears.\r
+#\r
+#--*/\r
+ASM_PFX(EfiCommonLibSetMem):\r
+\r
+    pushl  %ebp\r
+    movl   %esp, %ebp\r
+    subl   $0x10, %esp # Reserve space for local variable UINT64 QWordValue @[ebp - 10H] & UINT64 MmxSave @[ebp - 18H]\r
+    pushl  %ebx\r
+    pushl  %edi\r
+\r
+    movl 0xC(%ebp), %edx # Count\r
+    testl %edx, %edx\r
+    je _SetMemDone\r
+\r
+    pushl %ebx\r
+\r
+    movl 8(%ebp), %eax  # Buffer\r
+    movb 0x10(%ebp), %bl # Value\r
+    movl %eax, %edi\r
+    movb %bl, %bh\r
+\r
+    cmpl $256, %edx\r
+    jb _SetRemindingByte\r
+\r
+    andb $0x7, %al\r
+    testb %al, %al\r
+    je _SetBlock\r
+\r
+    movl %edi, %eax\r
+    shrl $3, %eax\r
+    incl %eax\r
+    shll $3, %eax\r
+    subl %edi, %eax\r
+    cmpl %edx, %eax\r
+    jnb _SetRemindingByte\r
+\r
+    subl %eax, %edx\r
+    movl %eax, %ecx\r
+\r
+    movb %bl, %al\r
+    rep\r
+    stosb\r
+\r
+_SetBlock: \r
+    movl %edx, %eax\r
+    shrl $6, %eax\r
+    testl %eax, %eax\r
+    je _SetRemindingByte\r
+\r
+    shll $6, %eax\r
+    subl %eax, %edx\r
+    shrl $6, %eax\r
+\r
+    movw %bx, -0x10(%ebp)            # QWordValue[0]\r
+    movw %bx, -0x10+2(%ebp)          # QWordValue[2]\r
+    movw %bx, -0x10+4(%ebp)          # QWordValue[4]\r
+    movw %bx, -0x10+6(%ebp)          # QWordValue[6]\r
+\r
+\r
+    movq  %mm0, -8(%ebp) # Save mm0 to MmxSave\r
+    movq  -0x10(%ebp), %mm0 # Load QWordValue to mm0\r
+\r
+_B: \r
+    movq  %mm0, %ds:(%edi)\r
+    movq  %mm0, %ds:8(%edi)\r
+    movq  %mm0, %ds:16(%edi)\r
+    movq  %mm0, %ds:24(%edi)\r
+    movq  %mm0, %ds:32(%edi)\r
+    movq  %mm0, %ds:40(%edi)\r
+    movq  %mm0, %ds:48(%edi)\r
+    movq  %mm0, %ds:56(%edi)\r
+    addl $64, %edi\r
+    decl %eax\r
+    jnz _B\r
+\r
+# Restore mm0\r
+    movq  -8(%ebp), %mm0 # Restore MmxSave to mm0\r
+    emms                                 # Exit MMX Instruction\r
+\r
+_SetRemindingByte: \r
+    movl %edx, %ecx\r
+\r
+    movl %ebx, %eax\r
+    shll $16, %eax\r
+    movw %bx, %ax\r
+    shrl $2, %ecx\r
+    rep\r
+    stosl\r
+\r
+    movl %edx, %ecx\r
+    andl $3, %ecx\r
+    rep\r
+    stosb\r
+\r
+    popl %ebx\r
+\r
+_SetMemDone: \r
+\r
+    popl %edi\r
+    popl %ebx\r
+    leave\r
+    ret\r
+\r
+#EfiCommonLibSetMem ENDP\r
+\r