VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/SwapBytes32.c

Last change on this file was 99404, checked in by vboxsync, 23 months ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 757 bytes
Line 
1/** @file
2 Math worker functions.
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include "BaseLibInternals.h"
10
11/**
12 Switches the endianess of a 32-bit integer.
13
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
16 returned.
17
18 @param Value A 32-bit unsigned value.
19
20 @return The byte swapped Value.
21
22**/
23UINT32
24EFIAPI
25SwapBytes32 (
26 IN UINT32 Value
27 )
28{
29 UINT32 LowerBytes;
30 UINT32 HigherBytes;
31
32 LowerBytes = (UINT32)SwapBytes16 ((UINT16)Value);
33 HigherBytes = (UINT32)SwapBytes16 ((UINT16)(Value >> 16));
34
35 return (LowerBytes << 16 | HigherBytes);
36}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette