diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/media/video/pvrusb2/pvrusb2-util.h | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-util.h')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-util.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-util.h b/drivers/media/video/pvrusb2/pvrusb2-util.h new file mode 100644 index 00000000000..92b75544ee2 --- /dev/null +++ b/drivers/media/video/pvrusb2/pvrusb2-util.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * | ||
3 | * | ||
4 | * Copyright (C) 2005 Mike Isely <isely@pobox.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | * | ||
19 | */ | ||
20 | #ifndef __PVRUSB2_UTIL_H | ||
21 | #define __PVRUSB2_UTIL_H | ||
22 | |||
23 | #define PVR2_DECOMPOSE_LE(t,i,d) \ | ||
24 | do { \ | ||
25 | (t)[i] = (d) & 0xff;\ | ||
26 | (t)[i+1] = ((d) >> 8) & 0xff;\ | ||
27 | (t)[i+2] = ((d) >> 16) & 0xff;\ | ||
28 | (t)[i+3] = ((d) >> 24) & 0xff;\ | ||
29 | } while(0) | ||
30 | |||
31 | #define PVR2_DECOMPOSE_BE(t,i,d) \ | ||
32 | do { \ | ||
33 | (t)[i+3] = (d) & 0xff;\ | ||
34 | (t)[i+2] = ((d) >> 8) & 0xff;\ | ||
35 | (t)[i+1] = ((d) >> 16) & 0xff;\ | ||
36 | (t)[i] = ((d) >> 24) & 0xff;\ | ||
37 | } while(0) | ||
38 | |||
39 | #define PVR2_COMPOSE_LE(t,i) \ | ||
40 | ((((u32)((t)[i+3])) << 24) | \ | ||
41 | (((u32)((t)[i+2])) << 16) | \ | ||
42 | (((u32)((t)[i+1])) << 8) | \ | ||
43 | ((u32)((t)[i]))) | ||
44 | |||
45 | #define PVR2_COMPOSE_BE(t,i) \ | ||
46 | ((((u32)((t)[i])) << 24) | \ | ||
47 | (((u32)((t)[i+1])) << 16) | \ | ||
48 | (((u32)((t)[i+2])) << 8) | \ | ||
49 | ((u32)((t)[i+3]))) | ||
50 | |||
51 | |||
52 | #endif /* __PVRUSB2_UTIL_H */ | ||
53 | |||
54 | /* | ||
55 | Stuff for Emacs to see, in order to encourage consistent editing style: | ||
56 | *** Local Variables: *** | ||
57 | *** mode: c *** | ||
58 | *** fill-column: 75 *** | ||
59 | *** tab-width: 8 *** | ||
60 | *** c-basic-offset: 8 *** | ||
61 | *** End: *** | ||
62 | */ | ||