]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / SwapBytes64.c
1 /** @file
2 Implementation of 64-bit swap bytes
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Switches the endianess of a 64-bit integer.
11
12 This function swaps the bytes in a 64-bit unsigned value to switch the value
13 from little endian to big endian or vice versa. The byte swapped value is
14 returned.
15
16 @param Operand A 64-bit unsigned value.
17
18 @return The byte swaped Operand.
19
20 **/
21 UINT64
22 EFIAPI
23 InternalMathSwapBytes64 (
24 IN UINT64 Operand
25 )
26 {
27 _asm {
28 mov eax, dword ptr [Operand + 4]
29 mov edx, dword ptr [Operand + 0]
30 bswap eax
31 bswap edx
32 }
33 }