X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FUnaligned.c;h=a419cb85e53c42275d181d3e6d1ea04c42231a92;hp=a54a99e7e60d4c177d7a54b2ce0f72082e583599;hb=9344f0921518309295da89c221d10cbead8531aa;hpb=1dc408f8910b1ddca89cff2ebdbf8e712df583d8 diff --git a/MdePkg/Library/BaseLib/Unaligned.c b/MdePkg/Library/BaseLib/Unaligned.c index a54a99e7e6..a419cb85e5 100644 --- a/MdePkg/Library/BaseLib/Unaligned.c +++ b/MdePkg/Library/BaseLib/Unaligned.c @@ -1,18 +1,14 @@ /** @file Unaligned access functions of BaseLib. - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ - Module Name: Unaligned.c -**/ +#include "BaseLibInternals.h" + /** Reads a 16-bit value from memory that may be unaligned. @@ -22,15 +18,15 @@ If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 16-bit value that may be unaligned. + @param Buffer A pointer to a 16-bit value that may be unaligned. - @return *Uint16 + @return The 16-bit value read from Buffer. **/ UINT16 EFIAPI ReadUnaligned16 ( - IN CONST UINT16 *Buffer + IN CONST UINT16 *Buffer ) { ASSERT (Buffer != NULL); @@ -47,17 +43,17 @@ ReadUnaligned16 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 16-bit value that may be unaligned. + @param Buffer A pointer to a 16-bit value that may be unaligned. @param Value 16-bit value to write to Buffer. - @return Value + @return The 16-bit value to write to Buffer. **/ UINT16 EFIAPI WriteUnaligned16 ( - OUT UINT16 *Buffer, - IN UINT16 Value + OUT UINT16 *Buffer, + IN UINT16 Value ) { ASSERT (Buffer != NULL); @@ -73,15 +69,15 @@ WriteUnaligned16 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 24-bit value that may be unaligned. + @param Buffer A pointer to a 24-bit value that may be unaligned. - @return The value read. + @return The 24-bit value read from Buffer. **/ UINT32 EFIAPI ReadUnaligned24 ( - IN CONST UINT32 *Buffer + IN CONST UINT32 *Buffer ) { ASSERT (Buffer != NULL); @@ -98,22 +94,23 @@ ReadUnaligned24 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 24-bit value that may be unaligned. + @param Buffer A pointer to a 24-bit value that may be unaligned. @param Value 24-bit value to write to Buffer. - @return The value written. + @return The 24-bit value to write to Buffer. **/ UINT32 EFIAPI WriteUnaligned24 ( - OUT UINT32 *Buffer, - IN UINT32 Value + OUT UINT32 *Buffer, + IN UINT32 Value ) { ASSERT (Buffer != NULL); - return *Buffer = BitFieldWrite32 (*Buffer, 0, 23, Value); + *Buffer = BitFieldWrite32 (*Buffer, 0, 23, Value); + return Value; } /** @@ -124,15 +121,15 @@ WriteUnaligned24 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 32-bit value that may be unaligned. + @param Buffer A pointer to a 32-bit value that may be unaligned. - @return *Uint32 + @return The 32-bit value read from Buffer. **/ UINT32 EFIAPI ReadUnaligned32 ( - IN CONST UINT32 *Buffer + IN CONST UINT32 *Buffer ) { ASSERT (Buffer != NULL); @@ -149,17 +146,17 @@ ReadUnaligned32 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 32-bit value that may be unaligned. - @param Value 32-bit value to write to Buffer. + @param Buffer A pointer to a 32-bit value that may be unaligned. + @param Value The 32-bit value to write to Buffer. - @return Value + @return The 32-bit value to write to Buffer. **/ UINT32 EFIAPI WriteUnaligned32 ( - OUT UINT32 *Buffer, - IN UINT32 Value + OUT UINT32 *Buffer, + IN UINT32 Value ) { ASSERT (Buffer != NULL); @@ -175,15 +172,15 @@ WriteUnaligned32 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 64-bit value that may be unaligned. + @param Buffer A pointer to a 64-bit value that may be unaligned. - @return *Uint64 + @return The 64-bit value read from Buffer. **/ UINT64 EFIAPI ReadUnaligned64 ( - IN CONST UINT64 *Buffer + IN CONST UINT64 *Buffer ) { ASSERT (Buffer != NULL); @@ -200,17 +197,17 @@ ReadUnaligned64 ( If the Buffer is NULL, then ASSERT(). - @param Buffer Pointer to a 64-bit value that may be unaligned. - @param Value 64-bit value to write to Buffer. + @param Buffer A pointer to a 64-bit value that may be unaligned. + @param Value The 64-bit value to write to Buffer. - @return Value + @return The 64-bit value to write to Buffer. **/ UINT64 EFIAPI WriteUnaligned64 ( - OUT UINT64 *Buffer, - IN UINT64 Value + OUT UINT64 *Buffer, + IN UINT64 Value ) { ASSERT (Buffer != NULL);