]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/SwapBytes32.c
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "BaseLibInternals.h"
12 Switches the endianess of a 32-bit integer.
14 This function swaps the bytes in a 32-bit unsigned value to switch the value
15 from little endian to big endian or vice versa. The byte swapped value is
18 @param Value A 32-bit unsigned value.
20 @return The byte swapped Value.
32 LowerBytes
= (UINT32
)SwapBytes16 ((UINT16
)Value
);
33 HigherBytes
= (UINT32
)SwapBytes16 ((UINT16
)(Value
>> 16));
35 return (LowerBytes
<< 16 | HigherBytes
);