• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;/*++
2;
3;Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4;This program and the accompanying materials
5;are licensed and made available under the terms and conditions of the BSD License
6;which accompanies this distribution.  The full text of the license may be found at
7;http://opensource.org/licenses/bsd-license.php
8;
9;THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10;WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11;
12;Module Name:
13;
14  ;EfiZeroMemRep4.asm
15;
16;Abstract:
17;
18  ;This is the code that uses rep stosd ZeroMem service
19;
20;--*/
21;
22;---------------------------------------------------------------------------
23    .686
24    .model  flat,C
25    .code
26
27;---------------------------------------------------------------------------
28;#include "Tiano.h"
29;
30;VOID
31;EfiCommonLibZeroMem (
32  ;IN VOID   *Buffer,
33  ;IN UINTN  Count
34  ;)
35;/*++
36;
37;Input:  VOID   *Buffer - Pointer to buffer to clear
38        ;UINTN  Count  - Number of bytes to clear
39;
40;Output: None.
41;
42;Saves:
43;
44;Modifies:
45;
46;Description:  This function uses rep stosd to zero memory.
47;
48;--*/
49EfiCommonLibZeroMem PROC
50    push        ebp
51    mov         ebp,esp
52    push        edi
53    mov         ecx,dword ptr [ebp+0Ch]
54    test        ecx, ecx
55    je          Exit
56    xor         eax, eax
57    mov         edi,dword ptr [ebp+8]
58    mov         edx, ecx
59    shr         ecx, 2
60    and         edx, 3
61    rep         stosd
62    mov         ecx, edx
63    rep         stosb
64Exit:
65    pop         edi
66    pop         ebp
67    ret
68
69EfiCommonLibZeroMem ENDP
70	END
71