]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/sys/bswap.h
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / Include / sys / bswap.h
diff --git a/StdLib/Include/sys/bswap.h b/StdLib/Include/sys/bswap.h
deleted file mode 100644 (file)
index a9284eb..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*      $NetBSD: bswap.h,v 1.12 2006/05/22 16:28:27 drochner Exp $      */\r
-\r
-/* Written by Manuel Bouyer. Public domain */\r
-\r
-#ifndef _SYS_BSWAP_H_\r
-#define _SYS_BSWAP_H_\r
-\r
-#ifndef _LOCORE\r
-#include  <sys/EfiCdefs.h>\r
-#include  <sys/types.h>\r
-\r
-#include  <machine/bswap.h>\r
-\r
-__BEGIN_DECLS\r
-/* Always declare the functions in case their address is taken (etc) */\r
-#if !defined(__BSWAP_RENAME)\r
-uint16_t bswap16(uint16_t) __attribute__((__const__));\r
-uint32_t bswap32(uint32_t) __attribute__((__const__));\r
-#else\r
-uint16_t bswap16(uint16_t) __RENAME(__bswap16) __attribute__((__const__));\r
-uint32_t bswap32(uint32_t) __RENAME(__bswap32) __attribute__((__const__));\r
-#endif\r
-uint64_t bswap64(uint64_t) __attribute__((__const__));\r
-__END_DECLS\r
-\r
-#if defined(__GNUC__) && defined(__OPTIMIZE__)\r
-\r
-/* machine/byte_swap.h might have defined inline versions */\r
-#ifndef __BYTE_SWAP_U64_VARIABLE\r
-#define __BYTE_SWAP_U64_VARIABLE bswap64\r
-#endif\r
-\r
-#ifndef __BYTE_SWAP_U32_VARIABLE\r
-#define __BYTE_SWAP_U32_VARIABLE bswap32\r
-#endif\r
-\r
-#ifndef __BYTE_SWAP_U16_VARIABLE\r
-#define __BYTE_SWAP_U16_VARIABLE bswap16\r
-#endif\r
-\r
-#define __byte_swap_u64_constant(x) \\r
-  ((uint64_t) \\r
-   ((((x) & 0xff00000000000000ull) >> 56) | \\r
-    (((x) & 0x00ff000000000000ull) >> 40) | \\r
-    (((x) & 0x0000ff0000000000ull) >> 24) | \\r
-    (((x) & 0x000000ff00000000ull) >>  8) | \\r
-    (((x) & 0x00000000ff000000ull) <<  8) | \\r
-    (((x) & 0x0000000000ff0000ull) << 24) | \\r
-    (((x) & 0x000000000000ff00ull) << 40) | \\r
-    (((x) & 0x00000000000000ffull) << 56)))\r
-\r
-#define __byte_swap_u32_constant(x) \\r
-  ((((x) & 0xff000000) >> 24) | \\r
-   (((x) & 0x00ff0000) >>  8) | \\r
-   (((x) & 0x0000ff00) <<  8) | \\r
-   (((x) & 0x000000ff) << 24))\r
-\r
-#define __byte_swap_u16_constant(x) \\r
-  ((((x) & 0xff00) >> 8) | \\r
-   (((x) & 0x00ff) << 8))\r
-\r
-#define bswap64(x) \\r
-  (__builtin_constant_p((x)) ? \\r
-   __byte_swap_u64_constant(x) : __BYTE_SWAP_U64_VARIABLE(x))\r
-\r
-#define bswap32(x) \\r
-  (__builtin_constant_p((x)) ? \\r
-   __byte_swap_u32_constant(x) : __BYTE_SWAP_U32_VARIABLE(x))\r
-\r
-#define bswap16(x) \\r
-  (__builtin_constant_p((x)) ? \\r
-   __byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))\r
-\r
-#endif /* __GNUC__ && __OPTIMIZE__ */\r
-#endif /* !_LOCORE */\r
-\r
-#endif /* !_SYS_BSWAP_H_ */\r