]>
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 | |
1efcc4ae | 9 | \r |
f734a10a | 10 | \r |
e1f414b6 | 11 | \r |
42eedea9 | 12 | /**\r |
13 | Switches the endianess of a 64-bit integer.\r | |
14 | \r | |
15 | This function swaps the bytes in a 64-bit unsigned value to switch the value\r | |
16 | from little endian to big endian or vice versa. The byte swapped value is\r | |
17 | returned.\r | |
18 | \r | |
19 | @param Operand A 64-bit unsigned value.\r | |
20 | \r | |
21 | @return The byte swaped Operand.\r | |
22 | \r | |
23 | **/\r | |
e1f414b6 | 24 | UINT64\r |
25 | EFIAPI\r | |
26 | InternalMathSwapBytes64 (\r | |
27 | IN UINT64 Operand\r | |
28 | )\r | |
29 | {\r | |
30 | _asm {\r | |
31 | mov eax, dword ptr [Operand + 4]\r | |
32 | mov edx, dword ptr [Operand + 0]\r | |
33 | bswap eax\r | |
34 | bswap edx\r | |
35 | }\r | |
36 | }\r | |
37 | \r |