1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
6 #ifndef __PVRUSB2_UTIL_H
7 #define __PVRUSB2_UTIL_H
9 #define PVR2_DECOMPOSE_LE(t,i,d) \
12 (t)[i+1] = ((d) >> 8) & 0xff;\
13 (t)[i+2] = ((d) >> 16) & 0xff;\
14 (t)[i+3] = ((d) >> 24) & 0xff;\
17 #define PVR2_DECOMPOSE_BE(t,i,d) \
19 (t)[i+3] = (d) & 0xff;\
20 (t)[i+2] = ((d) >> 8) & 0xff;\
21 (t)[i+1] = ((d) >> 16) & 0xff;\
22 (t)[i] = ((d) >> 24) & 0xff;\
25 #define PVR2_COMPOSE_LE(t,i) \
26 ((((u32)((t)[i+3])) << 24) | \
27 (((u32)((t)[i+2])) << 16) | \
28 (((u32)((t)[i+1])) << 8) | \
31 #define PVR2_COMPOSE_BE(t,i) \
32 ((((u32)((t)[i])) << 24) | \
33 (((u32)((t)[i+1])) << 16) | \
34 (((u32)((t)[i+2])) << 8) | \
38 #endif /* __PVRUSB2_UTIL_H */