]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibRepStr / X64 / ZeroMem.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; ZeroMem.Asm
9 ;
10 ; Abstract:
11 ;
12 ; ZeroMem function
13 ;
14 ; Notes:
15 ;
16 ;------------------------------------------------------------------------------
17
18 DEFAULT REL
19 SECTION .text
20
21 ;------------------------------------------------------------------------------
22 ; VOID *
23 ; InternalMemZeroMem (
24 ; IN VOID *Buffer,
25 ; IN UINTN Count
26 ; );
27 ;------------------------------------------------------------------------------
28 global ASM_PFX(InternalMemZeroMem)
29 ASM_PFX(InternalMemZeroMem):
30 push rdi
31 push rcx
32 xor rax, rax
33 mov rdi, rcx
34 mov rcx, rdx
35 shr rcx, 3
36 and rdx, 7
37 rep stosq
38 mov ecx, edx
39 rep stosb
40 pop rax
41 pop rdi
42 ret
43