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