]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
Removed MdePkg usage of ModuleName: in file headers
[mirror_edk2.git] / MdePkg / Library / PeiMemoryLib / SetMemWrapper.c
1 /** @file
2 SetMem() implementation.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 The following BaseMemoryLib instances share the same version of this file:
14
15 BaseMemoryLib
16 BaseMemoryLibMmx
17 BaseMemoryLibSse2
18 BaseMemoryLibRepStr
19 PeiMemoryLib
20 DxeMemoryLib
21
22 **/
23
24 #include "MemLibInternals.h"
25
26 /**
27 Fills a target buffer with a byte value, and returns the target buffer.
28
29 This function fills Length bytes of Buffer with Value, and returns Buffer.
30 If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
31
32 @param Buffer Memory to set.
33 @param Length Number of bytes to set.
34 @param Value Value of the set operation.
35
36 @return Buffer.
37
38 **/
39 VOID *
40 EFIAPI
41 SetMem (
42 OUT VOID *Buffer,
43 IN UINTN Length,
44 IN UINT8 Value
45 )
46 {
47 if (Length == 0) {
48 return Buffer;
49 }
50
51 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
52
53 return InternalMemSetMem (Buffer, Length, Value);
54 }