• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _ASM_X86_BYTEORDER_H
20 #define _ASM_X86_BYTEORDER_H
21 #include <asm/types.h>
22 #include <linux/compiler.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #ifdef __GNUC__
___arch__swab32(__u32 x)25 static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
26 {
27  __asm__("xchgb %b0,%h0\n\t"
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29  "rorl $16,%0\n\t"
30  "xchgb %b0,%h0"
31  :"=q" (x)
32  : "0" (x));
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  return x;
35 }
___arch__swab64(__u64 val)36 static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
37 {
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  union {
40  struct { __u32 a,b; } s;
41  __u64 u;
42  } v;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  v.u = val;
45  v.s.a = ___arch__swab32(v.s.a);
46  v.s.b = ___arch__swab32(v.s.b);
47  __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  return v.u;
50 }
51 #define __arch__swab64(x) ___arch__swab64(x)
52 #define __arch__swab32(x) ___arch__swab32(x)
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 #define __BYTEORDER_HAS_U64__
55 #endif
56 #include <linux/byteorder/little_endian.h>
57 #endif
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59