X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FPxeBcDxe%2FHton.h;h=1da5624900e1d866c51b725a97720c0b139ab19b;hp=c4ace49e7875bd68fdaf7d5462e501449e2fa193;hb=83cbd279b64f3081af5c06d50fa26e15a99fc066;hpb=5bca971e545e01271c6ae5b1b66ee9f281123bf2 diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Hton.h b/MdeModulePkg/Universal/Network/PxeBcDxe/Hton.h index c4ace49e78..1da5624900 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Hton.h +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Hton.h @@ -1,43 +1,43 @@ -/** @file - -Copyright (c) 2004, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module name: - hton.h - -Abstract: - Byte swapping macros. - - -**/ - -#ifndef _HTON_H_ -#define _HTON_H_ - -// -// Only Intel order functions are defined at this time. -// -#define HTONS(v) (UINT16) ((((v) << 8) & 0xff00) + (((v) >> 8) & 0x00ff)) - -#define HTONL(v) \ - (UINT32) ((((v) << 24) & 0xff000000) + (((v) << 8) & 0x00ff0000) + (((v) >> 8) & 0x0000ff00) + (((v) >> 24) & 0x000000ff)) - -#define HTONLL(v) swap64 (v) - -#define U8PTR(na) ((UINT8 *) &(na)) - -#define NTOHS(ns) ((UINT16) (((*U8PTR (ns)) << 8) +*(U8PTR (ns) + 1))) - -#define NTOHL(ns) \ - ((UINT32) (((*U8PTR (ns)) << 24) + ((*(U8PTR (ns) + 1)) << 16) + ((*(U8PTR (ns) + 2)) << 8) +*(U8PTR (ns) + 3))) - -#endif /* _HTON_H_ */ - -/* EOF - hton.h */ +/** @file + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module name: + hton.h + +Abstract: + Byte swapping macros. + + +**/ + +#ifndef _HTON_H_ +#define _HTON_H_ + +// +// Only Intel order functions are defined at this time. +// +#define HTONS(v) (UINT16) ((((v) << 8) & 0xff00) + (((v) >> 8) & 0x00ff)) + +#define HTONL(v) \ + (UINT32) ((((v) << 24) & 0xff000000) + (((v) << 8) & 0x00ff0000) + (((v) >> 8) & 0x0000ff00) + (((v) >> 24) & 0x000000ff)) + +#define HTONLL(v) swap64 (v) + +#define U8PTR(na) ((UINT8 *) &(na)) + +#define NTOHS(ns) ((UINT16) (((*U8PTR (ns)) << 8) +*(U8PTR (ns) + 1))) + +#define NTOHL(ns) \ + ((UINT32) (((*U8PTR (ns)) << 24) + ((*(U8PTR (ns) + 1)) << 16) + ((*(U8PTR (ns) + 2)) << 8) +*(U8PTR (ns) + 3))) + +#endif /* _HTON_H_ */ + +/* EOF - hton.h */