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