]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / ZeroMem.S
CommitLineData
e1f414b6 1//\r
2// Include common header file for this module.\r
3//\r
4#include "CommonHeader.h"\r
5\r
6#------------------------------------------------------------------------------\r
7#\r
8# Copyright (c) 2006, Intel Corporation\r
9# All rights reserved. This program and the accompanying materials\r
10# are licensed and made available under the terms and conditions of the BSD License\r
11# which accompanies this distribution. The full text of the license may be found at\r
12# http://opensource.org/licenses/bsd-license.php\r
13#\r
14# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16#\r
17# Module Name:\r
18#\r
19# ZeroMem.asm\r
20#\r
21# Abstract:\r
22#\r
23# ZeroMem function\r
24#\r
25# Notes:\r
26#\r
27#------------------------------------------------------------------------------\r
28\r
29.globl _InternalMemZeroMem\r
30\r
31#------------------------------------------------------------------------------\r
32# VOID *\r
33# EFIAPI\r
34# InternalMemZeroMem (\r
35# IN VOID *Buffer,\r
36# IN UINTN Count\r
37# );\r
38#------------------------------------------------------------------------------\r
39_InternalMemZeroMem:\r
40 push %edi\r
41 movl 8(%esp), %edi\r
42 movl 12(%esp), %edx\r
43 xorl %ecx, %ecx\r
44 subl %edi, %ecx\r
45 xorl %eax, %eax\r
46 andl $15, %ecx\r
47 jz L0\r
48 cmpl %edx, %ecx\r
49 cmova %edx, %ecx\r
50 subl %ecx, %edx\r
51 rep\r
52 stosb\r
53L0:\r
54 movl %edx, %ecx\r
55 andl $15, %edx\r
56 shrl $4, %ecx\r
57 jz L_ZeroBytes\r
58 pxor %xmm0, %xmm0\r
59L1:\r
60 movntdq %xmm0, (%edi)\r
61 addl $16, %edi\r
62 loop L1\r
63 mfence\r
64L_ZeroBytes:\r
65 movl %edx, %ecx\r
66 rep\r
67 stosb\r
68 movl 8(%esp), %eax\r
69 pop %edi\r
70 ret\r