staging: tidspbridge: no need for custom NULL
[pandora-kernel.git] / drivers / staging / tidspbridge / include / dspbridge / std.h
1 /*
2  * std.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * Copyright (C) 2008 Texas Instruments, Inc.
7  *
8  * This package is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15  */
16
17 #ifndef STD_
18 #define STD_
19
20 #include <linux/types.h>
21
22 /*
23  *  ======== _TI_ ========
24  *  _TI_ is defined for all TI targets
25  */
26 #if defined(_29_) || defined(_30_) || defined(_40_) || defined(_50_) || \
27     defined(_54_) || defined(_55_) || defined(_6x_) || defined(_80_) || \
28     defined(_28_) || defined(_24_)
29 #define _TI_    1
30 #endif
31
32 /*
33  *  ======== _FLOAT_ ========
34  *  _FLOAT_ is defined for all targets that natively support floating point
35  */
36 #if defined(_SUN_) || defined(_30_) || defined(_40_) || defined(_67_) || \
37     defined(_80_)
38 #define _FLOAT_ 1
39 #endif
40
41 /*
42  *  ======== _FIXED_ ========
43  *  _FIXED_ is defined for all fixed point target architectures
44  */
45 #if defined(_29_) || defined(_50_) || defined(_54_) || defined(_55_) || \
46     defined(_62_) || defined(_64_) || defined(_28_)
47 #define _FIXED_ 1
48 #endif
49
50 /*
51  *  ======== _TARGET_ ========
52  *  _TARGET_ is defined for all target architectures (as opposed to
53  *  host-side software)
54  */
55 #if defined(_FIXED_) || defined(_FLOAT_)
56 #define _TARGET_ 1
57 #endif
58
59 /*
60  *  8, 16, 32-bit type definitions
61  *
62  *  Sm* - 8-bit type
63  *  Md* - 16-bit type
64  *  Lg* - 32-bit type
65  *
66  *  *s32 - signed type
67  *  *u32 - unsigned type
68  *  *Bits - unsigned type (bit-maps)
69  */
70
71 /*
72  *  Aliases for standard C types
73  */
74
75 typedef s32(*fxn) (void);       /* generic function type */
76
77 /*
78  * These macros are used to cast 'Arg' types to 's32' or 'Ptr'.
79  * These macros were added for the 55x since Arg is not the same
80  * size as s32 and Ptr in 55x large model.
81  */
82 #if defined(_28l_) || defined(_55l_)
83 #define ARG_TO_INT(A)   ((s32)((long)(A) & 0xffff))
84 #define ARG_TO_PTR(A)   ((Ptr)(A))
85 #else
86 #define ARG_TO_INT(A)   ((s32)(A))
87 #define ARG_TO_PTR(A)   ((Ptr)(A))
88 #endif
89
90 #endif /* STD_ */