]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibOptPei/X64/CopyMem.S
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptPei / X64 / CopyMem.S
CommitLineData
b1ff428c 1#\r
2# ConvertAsm.py: Automatically generated from CopyMem.asm\r
3#\r
4#------------------------------------------------------------------------------\r
5#\r
84b5877f
HT
6# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
7# This program and the accompanying materials\r
b1ff428c 8# are licensed and made available under the terms and conditions of the BSD License\r
9# which accompanies this distribution. The full text of the license may be found at\r
10# http://opensource.org/licenses/bsd-license.php\r
11#\r
12# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14#\r
15# Module Name:\r
16#\r
17# CopyMem.S\r
18#\r
19# Abstract:\r
20#\r
21# CopyMem function\r
22#\r
23# Notes:\r
24#\r
25#------------------------------------------------------------------------------\r
26\r
27\r
28#------------------------------------------------------------------------------\r
29# VOID *\r
30# EFIAPI\r
31# InternalMemCopyMem (\r
32# IN VOID *Destination,\r
33# IN VOID *Source,\r
34# IN UINTN Count\r
35# )\r
36#------------------------------------------------------------------------------\r
132f41f0 37ASM_GLOBAL ASM_PFX(InternalMemCopyMem)\r
b1ff428c 38ASM_PFX(InternalMemCopyMem):\r
1fef058f 39 pushq %rsi\r
40 pushq %rdi\r
41 movq %rdx, %rsi # rsi <- Source\r
42 movq %rcx, %rdi # rdi <- Destination\r
43 leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source\r
44 cmpq %rdi, %rsi\r
45 movq %rdi, %rax # rax <- Destination as return value\r
b1ff428c 46 jae _InternalMemCopyMem_al_0000\r
1fef058f 47 cmpq %rdi, %r9\r
b1ff428c 48 jae _atSym_CopyBackward # Copy backward if overlapped\r
49_InternalMemCopyMem_al_0000:\r
1fef058f 50 movq %r8, %rcx\r
51 andq $7, %r8\r
52 shrq $3, %rcx\r
b1ff428c 53 rep movsq # Copy as many Qwords as possible\r
54 jmp _atSym_CopyBytes\r
55_atSym_CopyBackward:\r
1fef058f 56 movq %r9, %rsi # rsi <- End of Source\r
57 leaq -1(%rdi, %r8), %rdi # rdi <- End of Destination\r
b1ff428c 58 std # set direction flag\r
59_atSym_CopyBytes:\r
1fef058f 60 movq %r8, %rcx\r
b1ff428c 61 rep movsb # Copy bytes backward\r
62 cld\r
1fef058f 63 popq %rdi\r
64 popq %rsi\r
b1ff428c 65 ret\r
66\r