]>
Commit | Line | Data |
---|---|---|
c7f33ca4 | 1 | /*++\r |
2 | \r | |
4ea9375a HT |
3 | Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
c7f33ca4 | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | EfiZeroMemRep4.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | This is the code that uses rep stosd ZeroMem service\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #include "Tiano.h"\r | |
23 | \r | |
24 | VOID\r | |
25 | EfiCommonLibZeroMem (\r | |
26 | IN VOID *Buffer,\r | |
27 | IN UINTN Count\r | |
28 | )\r | |
29 | /*++\r | |
30 | \r | |
31 | Input: VOID *Buffer - Pointer to buffer to clear\r | |
32 | UINTN Count - Number of bytes to clear\r | |
33 | \r | |
34 | Output: None.\r | |
35 | \r | |
36 | Saves:\r | |
37 | \r | |
38 | Modifies:\r | |
39 | \r | |
40 | Description: This function uses rep stosd to zero memory.\r | |
41 | \r | |
42 | --*/\r | |
43 | {\r | |
44 | __asm {\r | |
45 | mov ecx, Count\r | |
46 | test ecx, ecx\r | |
47 | je Exit\r | |
48 | xor eax, eax\r | |
49 | mov edi, Buffer\r | |
50 | mov edx, ecx\r | |
51 | shr ecx, 2\r | |
52 | and edx, 3\r | |
53 | rep stosd\r | |
54 | mov ecx, edx\r | |
55 | rep stosb\r | |
56 | Exit:\r | |
57 | }\r | |
58 | }\r | |
59 | \r |