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