]> rtime.felk.cvut.cz Git - mf6xx.git/blob - src/hudaqlib/hudaq_internal.h
QEMU mf624.c formatted to make QEMU checkpatch.pl mostly happy.
[mf6xx.git] / src / hudaqlib / hudaq_internal.h
1 /****************************************************************/\r
2 /**@file hudaq_internal.h:\r
3  * Description: Internal hudaq header with private information. *\r
4  * Dependency: Only for Linux                                   *\r
5  *                Copyright 2006-2010 Jaroslav Fojtik           *\r
6  ****************************************************************/\r
7 \r
8 #ifndef HUDAQ_INTERNAL_H__\r
9 #define HUDAQ_INTERNAL_H__\r
10 \r
11 #include "types.h"\r
12 \r
13 #define __int8 char\r
14 #define __int16 short int\r
15 #define __int32 int\r
16 \r
17 #ifndef max\r
18         #define max(x,y) (((x) > (y)) ? (x) : (y))\r
19 #endif\r
20 #ifndef min\r
21         #define min(x,y) (((x) > (y)) ? (x) : (y))\r
22 #endif\r
23 \r
24 \r
25 /**\r
26  * Resource information structure obtained from low level kernel driver.\r
27  */\r
28 typedef struct\r
29 {\r
30         size_t                  Size;                        ///< Size of this structure.\r
31         int                     NumPhysMemResources;         ///< Amount of memory-mapped ranges in particular device.\r
32         HudaqResourceRange      PhysMemResources[8];         ///< Memory resources available for user access.\r
33         HudaqResourceInfo       Resources;                   ///< External structure for users\r
34         size_t                  DriverDataSize;              ///< Size of shared memory among all applications.\r
35         void*                   DriverData;                  ///< Internal data for one device shared across all applications.\r
36         unsigned int            UioDevNum;                   ///< Which UIO device handles our card\r
37         // TODO: these two items are planned to be filled from kernel driver\r
38 } DriverRecord;\r
39 \r
40 \r
41 typedef struct CallTable;\r
42 \r
43 /** Device record that contains common information about general device resources. */\r
44 typedef struct\r
45 {\r
46         //HANDLE SysHandle;             ///< System handle assigned from kernel driver\r
47         char Name[256];               ///< Device name in ASCII\r
48         int Order;                    ///< Order of device\r
49         DriverRecord DrvRes;          ///< Kernel resource info\r
50 \r
51         const struct CallTable *pCT;  ///< Interface functions\r
52 } DeviceRecord;\r
53 \r
54 \r
55 #include "hudaq_int_common.h"\r
56 \r
57 \r
58 #if __GNUC__ == 3 && __GNUC_MINOR__ >= 3\r
59 #ifdef HUDAQAPI\r
60 #undef HUDAQAPI\r
61 #define HUDAQAPI __attribute__ ((visibility("default")))\r
62 #pragma visibility(hidden)\r
63 #endif\r
64 #endif\r
65 \r
66 int timeGetTime(void);\r
67 \r
68 #endif\r