[go: up one dir, main page]

File: endian.h

package info (click to toggle)
s390-tools 1.16.0-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,332 kB
  • sloc: ansic: 46,620; sh: 8,560; cpp: 8,185; asm: 5,503; perl: 3,014; makefile: 886
file content (23 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * FCP adapter trace utility
 *
 * Endianess conversion functions
 *
 * Copyright IBM Corp. 2008
 * Author(s): Martin Peschke <mp3@de.ibm.com>
 *            Stefan Raspl <raspl@linux.vnet.ibm.com>
 */

#include <byteswap.h>
#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cpu_to_be64(x) (x = __bswap_64(x))
#define cpu_to_be32(x) (x = __bswap_32(x))
#define cpu_to_be16(x) (x = __bswap_16(x))
#else
#define cpu_to_be64(x) (x = x)
#define cpu_to_be32(x) (x = x)
#define cpu_to_be16(x) (x = x)
#endif