]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/SwapBytes16.c
MdePkg/BaseLib: Use PcdSpeculationBarrierType
[mirror_edk2.git] / MdePkg / Library / BaseLib / SwapBytes16.c
CommitLineData
e1f414b6 1/** @file\r
2 Math worker functions.\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
12#include "BaseLibInternals.h"\r
13\r
14/**\r
15 Switches the endianess of a 16-bit integer.\r
16\r
17 This function swaps the bytes in a 16-bit unsigned value to switch the value\r
18 from little endian to big endian or vice versa. The byte swapped value is\r
19 returned.\r
20\r
2fc60b70 21 @param Value A 16-bit unsigned value.\r
e1f414b6 22\r
efb23117 23 @return The byte swapped Value.\r
e1f414b6 24\r
25**/\r
26UINT16\r
27EFIAPI\r
28SwapBytes16 (\r
2fc60b70 29 IN UINT16 Value\r
e1f414b6 30 )\r
31{\r
2fc60b70 32 return (UINT16) ((Value<< 8) | (Value>> 8));\r
e1f414b6 33}\r