summaryrefslogtreecommitdiff
path: root/drivers/staging/tidspbridge/include/dspbridge/std.h
blob: 7e09fec18ee26f50d28d4fd1f5d3139083bf9313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * std.h
 *
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2008 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef STD_
#define STD_

#include <linux/types.h>

/*
 *  ======== _TI_ ========
 *  _TI_ is defined for all TI targets
 */
#if defined(_29_) || defined(_30_) || defined(_40_) || defined(_50_) || \
    defined(_54_) || defined(_55_) || defined(_6x_) || defined(_80_) || \
    defined(_28_) || defined(_24_)
#define _TI_	1
#endif

/*
 *  ======== _FLOAT_ ========
 *  _FLOAT_ is defined for all targets that natively support floating point
 */
#if defined(_SUN_) || defined(_30_) || defined(_40_) || defined(_67_) || \
    defined(_80_)
#define _FLOAT_	1
#endif

/*
 *  ======== _FIXED_ ========
 *  _FIXED_ is defined for all fixed point target architectures
 */
#if defined(_29_) || defined(_50_) || defined(_54_) || defined(_55_) || \
    defined(_62_) || defined(_64_) || defined(_28_)
#define _FIXED_	1
#endif

/*
 *  ======== _TARGET_ ========
 *  _TARGET_ is defined for all target architectures (as opposed to
 *  host-side software)
 */
#if defined(_FIXED_) || defined(_FLOAT_)
#define _TARGET_ 1
#endif

/*
 *  8, 16, 32-bit type definitions
 *
 *  Sm*	- 8-bit type
 *  Md* - 16-bit type
 *  Lg* - 32-bit type
 *
 *  *s32 - signed type
 *  *u32 - unsigned type
 *  *Bits - unsigned type (bit-maps)
 */

/*
 *  Aliases for standard C types
 */

typedef s32(*fxn) (void);	/* generic function type */

#ifndef NULL
#define NULL 0
#endif

/*
 * These macros are used to cast 'Arg' types to 's32' or 'Ptr'.
 * These macros were added for the 55x since Arg is not the same
 * size as s32 and Ptr in 55x large model.
 */
#if defined(_28l_) || defined(_55l_)
#define ARG_TO_INT(A)	((s32)((long)(A) & 0xffff))
#define ARG_TO_PTR(A)	((Ptr)(A))
#else
#define ARG_TO_INT(A)	((s32)(A))
#define ARG_TO_PTR(A)	((Ptr)(A))
#endif

#endif /* STD_ */