0N/A/** @file
0N/A SetMem32() implementation.
0N/A
0N/A The following BaseMemoryLib instances contain the same copy of this file:
0N/A BaseMemoryLib
0N/A BaseMemoryLibMmx
0N/A BaseMemoryLibSse2
0N/A BaseMemoryLibRepStr
0N/A BaseMemoryLibOptDxe
0N/A BaseMemoryLibOptPei
0N/A PeiMemoryLib
0N/A UefiMemoryLib
0N/A
0N/A Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
0N/A This program and the accompanying materials
0N/A are licensed and made available under the terms and conditions of the BSD License
0N/A which accompanies this distribution. The full text of the license may be found at
0N/A http://opensource.org/licenses/bsd-license.php.
0N/A
0N/A THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
0N/A WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
0N/A
0N/A**/
0N/A
0N/A#include "MemLibInternals.h"
0N/A
0N/A/**
0N/A Fills a target buffer with a 32-bit value, and returns the target buffer.
0N/A
0N/A This function fills Length bytes of Buffer with the 32-bit value specified by
0N/A Value, and returns Buffer. Value is repeated every 32-bits in for Length
0N/A bytes of Buffer.
0N/A
0N/A If Length > 0 and Buffer is NULL, then ASSERT().
0N/A If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
0N/A If Buffer is not aligned on a 32-bit boundary, then ASSERT().
0N/A If Length is not aligned on a 32-bit boundary, then ASSERT().
0N/A
0N/A @param Buffer The pointer to the target buffer to fill.
0N/A @param Length The number of bytes in Buffer to fill.
0N/A @param Value The value with which to fill Length bytes of Buffer.
0N/A
0N/A @return Buffer.
0N/A
0N/A**/
0N/AVOID *
0N/AEFIAPI
0N/ASetMem32 (
0N/A OUT VOID *Buffer,
0N/A IN UINTN Length,
0N/A IN UINT32 Value
0N/A )
0N/A{
0N/A if (Length == 0) {
0N/A return Buffer;
0N/A }
0N/A
0N/A ASSERT (Buffer != NULL);
0N/A ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
0N/A ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
0N/A ASSERT ((Length & (sizeof (Value) - 1)) == 0);
0N/A
0N/A return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
0N/A}
0N/A