]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptDxe / X64 / SetMem.S
index 345343192662024d79a588a0af6752fcf56d2f53..9f7d1b651e58bbdb0de8a1518c667b7aada70c02 100644 (file)
@@ -1,65 +1,57 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation\r
-; All rights reserved. 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
-;   SetMem.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID *\r
-;  EFIAPI\r
-;  InternalMemSetMem (\r
-;    IN VOID   *Buffer,\r
-;    IN UINTN  Count,\r
-;    IN UINT8  Value\r
-;    )\r
-;------------------------------------------------------------------------------\r
-.intel_syntax noprefix\r
-.globl ASM_PFX(InternalMemSetMem)\r
-ASM_PFX(InternalMemZeroMem):\r
-InternalMemSetMem   PROC    USES    rdi rbx\r
-    push    rdi\r
-    push    rbx\r
-    push    rcx       ; push Buffer\r
-    mov     rax, r8   ; rax = Value\r
-    and     rax, 0ffh ; rax = lower 8 bits of r8, upper 56 bits are 0\r
-    mov     ah,  al   ; ah  = al\r
-    mov     bx,  ax   ; bx  = ax\r
-    shl     rax, 10h  ; rax = ax << 16\r
-    mov     ax,  bx   ; ax  = bx\r
-    mov     rbx, rax  ; ebx = eax\r
-    shl     rax, 20h  ; rax = rax << 32\r
-    or      rax, rbx  ; eax = ebx\r
-    mov     rdi, rcx  ; rdi = Buffer\r
-    mov     rcx, rdx  ; rcx = Count\r
-    shr     rcx, 3    ; rcx = rcx / 8\r
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2009, 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
+#   SetMem.S\r
+#\r
+# Abstract:\r
+#\r
+#   SetMem function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+#------------------------------------------------------------------------------\r
+#  VOID *\r
+#  EFIAPI\r
+#  InternalMemSetMem (\r
+#    IN VOID   *Buffer,\r
+#    IN UINTN  Count,\r
+#    IN UINT8  Value\r
+#    )\r
+#------------------------------------------------------------------------------\r
+ASM_GLOBAL ASM_PFX(InternalMemSetMem)\r
+ASM_PFX(InternalMemSetMem):\r
+    pushq   %rdi\r
+    pushq   %rbx\r
+    pushq   %rcx        # push Buffer\r
+    movq    %r8, %rax   # rax = Value\r
+    andq    $0xff, %rax # rax = lower 8 bits of r8, upper 56 bits are 0\r
+    movb    %al, %ah    # ah  = al\r
+    movw    %ax, %bx    # bx  = ax\r
+    shlq    $0x10, %rax # rax = ax << 16\r
+    movw    %bx,  %ax   # ax  = bx\r
+    movq    %rax, %rbx  # ebx = eax\r
+    shlq    $0x20, %rax # rax = rax << 32\r
+    orq     %rbx, %rax  # eax = ebx\r
+    movq    %rcx, %rdi  # rdi = Buffer\r
+    movq    %rdx, %rcx  # rcx = Count\r
+    shrq    $3, %rcx    # rcx = rcx / 8\r
     cld\r
-    rep     stosq      \r
-    mov     rcx, rdx  ; rcx = rdx\r
-    and     rcx, 7    ; rcx = rcx & 7\r
-    rep     stosb      \r
-    pop     rax       ; rax = Buffer\r
-    pop     rbx\r
-    pop     rdi\r
+    rep     stosq \r
+    movq    %rdx, %rcx  # rcx = rdx\r
+    andq    $7, %rcx    # rcx = rcx & 7\r
+    rep     stosb \r
+    popq    %rax        # rax = Buffer\r
+    popq    %rbx\r
+    popq    %rdi\r
     ret\r
-InternalMemSetMem   ENDP\r
-\r
-    END\r