1/*
2 * dspbridge/mpu_api/inc/dbtype.h
3 *
4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5 *
6 * Copyright (C) 2007 Texas Instruments, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published
10 * by the Free Software Foundation version 2.1 of the License.
11 *
12 * This program is distributed .as is. WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 */
17
18
19/*
20 *  ======== dbtype.h ========
21 *  Description:
22 *      This header defines data types for DSP/BIOS Bridge APIs and device
23 *      driver modules. It also defines the Hungarian
24 *      prefix to use for each base type.
25 *
26 *
27 *! Revision History:
28 *! =================
29 *! 23-Nov-2002 gp: Purpose -> Description in file header.
30 *! 13-Feb-2001 kc: Name changed from ddsptype.h dbtype.h.
31 *! 09-Oct-2000 jeh Added CHARACTER.
32 *! 14-Sep-2000 jeh Moved PSTRING from dspdefs.h to dbtype.h. Define
33 *!                 DEF_WINCE_ so PSTRING gets defined.
34 *! 11-Aug-2000 ag: Added 'typedef void VOID'.
35 *! 08-Apr-2000 ww: Cloned.
36 */
37
38#ifndef DBTYPE_
39#define DBTYPE_
40
41#ifndef DEF_LINUX_
42#define DEF_LINUX_
43#endif
44
45#ifdef DEAD_CODE
46/* Stifle compiler warnings: */
47#ifndef UNUSED_PARAMETER
48#define UNUSED_PARAMETER(P)   (P)
49#endif
50#endif
51
52/*============================================================================*/
53/*  Argument specification syntax                                             */
54/*============================================================================*/
55
56#ifndef IN
57#define IN			/* Following parameter is for input. */
58#endif
59
60#ifndef OUT
61#define OUT			/* Following parameter is for output. */
62#endif
63
64#ifndef OPTIONAL
65#define OPTIONAL		/* Function may optionally use previous parameter. */
66#endif
67
68#ifndef CONST
69#define CONST   const
70#endif
71
72/*============================================================================*/
73/*  Boolean constants                                                         */
74/*============================================================================*/
75
76#ifndef FALSE
77#define FALSE   0
78#endif
79#ifndef TRUE
80#define TRUE    1
81#endif
82
83/*============================================================================*/
84/*  NULL    (Definition is language specific)                                 */
85/*============================================================================*/
86
87#ifndef NULL
88#ifdef __cplusplus
89#define NULL    0
90#else
91#define NULL    ((void *)0)	/* Null pointer. */
92#endif
93#endif
94
95/*============================================================================*/
96/*  NULL character   (normally used for string termination)                   */
97/*============================================================================*/
98
99#ifndef NULL_CHAR
100#define NULL_CHAR    '\0'	/* Null character. */
101#endif
102
103/*============================================================================*/
104/*  Basic Type definitions (with Prefixes for Hungarian notation)             */
105/*============================================================================*/
106typedef unsigned char BYTE;	/* b    */
107
108typedef unsigned short WORD;	/* w    */
109typedef unsigned long DWORD;	/* dw   */
110
111typedef char CHAR;		/* ch   */
112typedef short SHORT;		/* s    */
113typedef int INT;		/* n    */
114typedef long LONG;		/* l    */
115
116typedef unsigned short USHORT;	/* us   */
117typedef unsigned int UINT;	/* u    */
118typedef unsigned long ULONG;	/* ul   */
119
120typedef double DOUBLE;		/* dbl  */
121
122typedef CHAR SZ[];		/* sz   */
123typedef CHAR *PSTR;		/* pstr */
124
125#ifndef OMAPBRIDGE_TYPES
126#define OMAPBRIDGE_TYPES
127
128typedef unsigned char UCHAR;	/* uch  */
129typedef float FLOAT;		/* flt  */
130typedef int BOOL;		/* f    */
131
132typedef volatile unsigned short REG_UWORD16;
133
134#endif
135
136#ifndef VOID
137#define VOID void
138#endif
139
140typedef VOID *PVOID;		/* p    */
141typedef PVOID HANDLE;		/* h    */
142
143#ifdef DEF_WINCE_
144/*------------------------------ WINCE ---------------------------------------*/
145
146typedef unsigned short WCHAR;	/* wch  */
147
148#if defined(UNICODE)
149typedef WCHAR TCHAR;
150#else
151typedef CHAR TCHAR;
152#endif
153
154typedef WCHAR *PWCHAR;
155typedef TCHAR *PSTRING;		/* Generic character string type */
156typedef TCHAR CHARACTER;
157
158#ifdef ERROR			/* Definition of ERROR in wingdi.h clashes with gt.h  */
159#undef ERROR
160#endif
161
162/*------------------------------ WINCE ---------------------------------------*/
163#endif				/* ifdef DEF_WINCE_ */
164
165#ifdef DEF_EPOC_
166/*------------------------------ EPOC ----------------------------------------*/
167
168/*------------------------------ EPOC ----------------------------------------*/
169#endif				/* ifdef DEF_EPOC_ */
170
171#ifdef DEF_LINUX_
172/*------------------------------ LINUX -------------------------------------*/
173
174typedef unsigned short WCHAR;	/* wch  */
175
176#if defined(UNICODE)
177typedef WCHAR TCHAR;
178#else
179typedef CHAR TCHAR;
180#endif
181
182typedef WCHAR *PWCHAR;
183typedef TCHAR *PSTRING;		/* Generic character string type */
184typedef TCHAR CHARACTER;
185
186typedef BYTE *PBYTE;		/* p    */
187
188typedef DWORD *PDWORD;		/* dw   */
189
190typedef VOID *LPVOID;		/*lp   */
191typedef VOID *LPCVOID;		/*lpcvoid    */
192
193typedef long long LARGE_INTEGER;
194#define TEXT(x) x
195
196#ifdef ERROR			/* Definition of ERROR in wingdi.h clashes with gt.h  */
197#undef ERROR
198#endif
199
200/*------------------------------ LINUX -------------------------------------*/
201#endif				/* ifdef DEF_LINUX_ */
202
203#ifdef DEAD_CODE
204/*============================================================================*/
205/*  Standard calling conventions                                              */
206/*============================================================================*/
207
208#define STATIC          static
209#define EXTERN          extern
210#endif
211
212#ifdef DEF_WINCE_
213/*------------------------------ WINCE ---------------------------------------*/
214
215#ifndef CDECL
216#define CDECL           _cdecl
217#endif
218
219#ifndef WINAPI
220#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
221#define WINAPI          __stdcall
222#else
223#define WINAPI
224#endif
225#endif
226
227#define STDCALL         WINAPI
228
229#define DLLIMPORT       __declspec(dllexport)
230#define DLLEXPORT       __declspec(dllexport)
231
232/*------------------------------ WINCE ---------------------------------------*/
233#endif				/* ifdef DEF_WINCE_ */
234
235#ifdef DEF_EPOC_
236/*------------------------------ EPOC ----------------------------------------*/
237
238#define CDECL           __cdecl
239
240#define STDCALL
241
242#ifdef __VC32__
243#define DLLIMPORT       __declspec(dllexport)
244#define DLLEXPORT       __declspec(dllexport)
245#endif
246
247#ifdef __GCC32__
248#define DLLIMPORT
249#define DLLEXPORT       __declspec(dllexport)
250#endif
251
252/*------------------------------ EPOC ----------------------------------------*/
253#endif				/* ifdef DEF_EPOC_ */
254
255#ifdef DEF_LINUX_
256/*------------------------------ LINUX -------------------------------------*/
257
258#define CDECL
259
260#define WINAPI
261
262#define STDCALL
263
264#define DLLIMPORT
265#define DLLEXPORT
266
267/* Define DSPAPIDLL correctly in dspapi.h */
268#define _DSPSYSDLL32_
269
270/*------------------------------ LINUX -------------------------------------*/
271#endif				/* ifdef DEF_LINUX_ */
272
273#ifdef DEAD_CODE
274/*============================================================================*/
275/*  Derived calling conventions                                               */
276/*============================================================================*/
277
278#define DSPNORMALAPI    STDCALL
279#define DSPKERNELAPI    CDECL
280#define DSPEXPORTAPI    DLLEXPORT
281#endif
282
283#endif				/* DBTYPE_ */
284