+++ /dev/null
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2018, 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
- 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