/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_SH_SWAB_H #define __ASM_SH_SWAB_H /* * Copyright (C) 1999 Niibe Yutaka * Copyright (C) 2000, 2001 Paolo Alberelli */ #include <linux/compiler.h> #include <linux/types.h> #include <asm-generic/swab.h> static inline __attribute_const__ __u32 __arch_swab32(__u32 x) { __asm__( #ifdef __SH5__ "byterev %1, %0\n\t" "shari %0, 32, %0" #else "swap.b %1, %0\n\t" "swap.w %0, %0\n\t" "swap.b %0, %0" #endif : "=r" (x) : "r" (x)); return x; } #define __arch_swab32 __arch_swab32 static inline __attribute_const__ __u16 __arch_swab16(__u16 x) { __asm__( #ifdef __SH5__ "byterev %1, %0\n\t" "shari %0, 32, %0" #else "swap.b %1, %0" #endif : "=r" (x) : "r" (x)); return x; } #define __arch_swab16 __arch_swab16 static inline __u64 __arch_swab64(__u64 val) { union { struct { __u32 a,b; } s; __u64 u; } v, w; v.u = val; w.s.b = __arch_swab32(v.s.a); w.s.a = __arch_swab32(v.s.b); return w.u; } #define __arch_swab64 __arch_swab64 #endif /* __ASM_SH_SWAB_H */
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Kbuild | File | 526 B | 0644 |
|
auxvec.h | File | 1.08 KB | 0644 |
|
byteorder.h | File | 278 B | 0644 |
|
cachectl.h | File | 648 B | 0644 |
|
cpu-features.h | File | 1.13 KB | 0644 |
|
hw_breakpoint.h | File | 167 B | 0644 |
|
ioctls.h | File | 4.8 KB | 0644 |
|
posix_types.h | File | 205 B | 0644 |
|
posix_types_32.h | File | 801 B | 0644 |
|
posix_types_64.h | File | 1.01 KB | 0644 |
|
ptrace.h | File | 960 B | 0644 |
|
ptrace_32.h | File | 1.58 KB | 0644 |
|
ptrace_64.h | File | 352 B | 0644 |
|
setup.h | File | 31 B | 0644 |
|
sigcontext.h | File | 859 B | 0644 |
|
signal.h | File | 369 B | 0644 |
|
sockios.h | File | 536 B | 0644 |
|
stat.h | File | 3.01 KB | 0644 |
|
swab.h | File | 1.05 KB | 0644 |
|
types.h | File | 31 B | 0644 |
|
unistd.h | File | 178 B | 0644 |
|
unistd_32.h | File | 11.03 KB | 0644 |
|
unistd_64.h | File | 11.67 KB | 0644 |
|