]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm
add a error macro to prevent this file from included for now #error "UEFI 2.1 HII...
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / ZeroMem.asm
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 .686\r
30 .model flat,C\r
31 .xmm\r
32 .code\r
33\r
34;------------------------------------------------------------------------------\r
35; VOID *\r
36; EFIAPI\r
37; InternalMemZeroMem (\r
38; IN VOID *Buffer,\r
39; IN UINTN Count\r
40; );\r
41;------------------------------------------------------------------------------\r
42InternalMemZeroMem PROC USES edi\r
43 mov edi, [esp + 8]\r
44 mov edx, [esp + 12]\r
45 xor ecx, ecx\r
46 sub ecx, edi\r
47 xor eax, eax\r
48 and ecx, 15\r
49 jz @F\r
50 cmp ecx, edx\r
51 cmova ecx, edx\r
52 sub edx, ecx\r
53 rep stosb\r
54@@:\r
55 mov ecx, edx\r
56 and edx, 15\r
57 shr ecx, 4\r
58 jz @ZeroBytes\r
59 pxor xmm0, xmm0\r
60@@:\r
61 movntdq [edi], xmm0\r
62 add edi, 16\r
63 loop @B\r
64 mfence\r
65@ZeroBytes:\r
66 mov ecx, edx\r
67 rep stosb\r
68 mov eax, [esp + 8]\r
69 ret\r
70InternalMemZeroMem ENDP\r
71\r
72 END\r