]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
2 SetMem() and SetMemN() implementation.
4 The following BaseMemoryLib instances contain the same copy of this file:
15 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
16 SPDX-License-Identifier: BSD-2-Clause-Patent
20 #include "MemLibInternals.h"
23 Fills a target buffer with a byte value, and returns the target buffer.
25 This function fills Length bytes of Buffer with Value, and returns Buffer.
27 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
29 @param Buffer The memory to set.
30 @param Length The number of bytes to set.
31 @param Value The value with which to fill Length bytes of Buffer.
48 ASSERT ((Length
- 1) <= (MAX_ADDRESS
- (UINTN
)Buffer
));
50 return InternalMemSetMem (Buffer
, Length
, Value
);
54 Fills a target buffer with a value that is size UINTN, and returns the target buffer.
56 This function fills Length bytes of Buffer with the UINTN sized value specified by
57 Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
60 If Length > 0 and Buffer is NULL, then ASSERT().
61 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
62 If Buffer is not aligned on a UINTN boundary, then ASSERT().
63 If Length is not aligned on a UINTN boundary, then ASSERT().
65 @param Buffer The pointer to the target buffer to fill.
66 @param Length The number of bytes in Buffer to fill.
67 @param Value The value with which to fill Length bytes of Buffer.
80 if (sizeof (UINTN
) == sizeof (UINT64
)) {
81 return SetMem64 (Buffer
, Length
, (UINT64
)Value
);
83 return SetMem32 (Buffer
, Length
, (UINT32
)Value
);