Modules/UDI - Implimenting UDI support, can load udi_dpt from udiref
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / include / udi.h
1 /**
2  * \file udi.h
3  */
4 #ifndef _UDI_H_
5 #define _UDI_H_
6
7 // Use the core acess file to use the specific size types (plus va_arg)
8 #include <acess.h>
9
10 #include "udi/arch/x86.h"
11
12 /**
13  * \name Values and Flags for udi_status_t
14  * \{
15  */
16 #define UDI_STATUS_CODE_MASK            0x0000FFFF
17 #define UDI_STAT_META_SPECIFIC          0x00008000
18 #define UDI_SPECIFIC_STATUS_MASK        0x00007FFF
19 #define UDI_CORRELATE_OFFSET            16
20 #define UDI_CORRELATE_MASK                      0xFFFF0000
21 /* Common Status Values */
22 #define UDI_OK                                          0
23 #define UDI_STAT_NOT_SUPPORTED          1
24 #define UDI_STAT_NOT_UNDERSTOOD         2
25 #define UDI_STAT_INVALID_STATE          3
26 #define UDI_STAT_MISTAKEN_IDENTITY      4
27 #define UDI_STAT_ABORTED                        5
28 #define UDI_STAT_TIMEOUT                        6
29 #define UDI_STAT_BUSY                           7
30 #define UDI_STAT_RESOURCE_UNAVAIL       8
31 #define UDI_STAT_HW_PROBLEM                     9
32 #define UDI_STAT_NOT_RESPONDING         10
33 #define UDI_STAT_DATA_UNDERRUN          11
34 #define UDI_STAT_DATA_OVERRUN           12
35 #define UDI_STAT_DATA_ERROR                     13
36 #define UDI_STAT_PARENT_DRV_ERROR       14
37 #define UDI_STAT_CANNOT_BIND            15
38 #define UDI_STAT_CANNOT_BIND_EXCL       16
39 #define UDI_STAT_TOO_MANY_PARENTS       17
40 #define UDI_STAT_BAD_PARENT_TYPE        18
41 #define UDI_STAT_TERMINATED                     19
42 #define UDI_STAT_ATTR_MISMATCH          20
43 /**
44  * \}
45  */
46
47 /**
48  * \name Data Layout Specifiers
49  * \{
50  */
51 typedef const udi_ubit8_t       udi_layout_t;
52 /* Specific-Length Layout Type Codes */
53 #define UDI_DL_UBIT8_T                   1
54 #define UDI_DL_SBIT8_T                   2
55 #define UDI_DL_UBIT16_T                  3
56 #define UDI_DL_SBIT16_T                  4
57 #define UDI_DL_UBIT32_T                  5
58 #define UDI_DL_SBIT32_T                  6
59 #define UDI_DL_BOOLEAN_T                 7
60 #define UDI_DL_STATUS_T                  8
61 /* Abstract Element Layout Type Codes */
62 #define UDI_DL_INDEX_T                   20
63 /* Opaque Handle Element Layout Type Codes */
64 #define UDI_DL_CHANNEL_T                 30
65 #define UDI_DL_ORIGIN_T                  32
66 /* Indirect Element Layout Type Codes */
67 #define UDI_DL_BUF                       40
68 #define UDI_DL_CB                        41
69 #define UDI_DL_INLINE_UNTYPED            42
70 #define UDI_DL_INLINE_DRIVER_TYPED       43
71 #define UDI_DL_MOVABLE_UNTYPED           44
72 /* Nested Element Layout Type Codes */
73 #define UDI_DL_INLINE_TYPED              50
74 #define UDI_DL_MOVABLE_TYPED             51
75 #define UDI_DL_ARRAY                     52
76 #define UDI_DL_END                       0
77 /**
78  * \}
79  */
80
81
82 typedef struct udi_init_s               udi_init_t;
83 typedef struct udi_primary_init_s       udi_primary_init_t;
84 typedef struct udi_secondary_init_s     udi_secondary_init_t;
85 typedef struct udi_ops_init_s   udi_ops_init_t;
86 typedef struct udi_cb_init_s    udi_cb_init_t;
87 typedef struct udi_cb_select_s  udi_cb_select_t;
88 typedef struct udi_gcb_init_s   udi_gcb_init_t;
89
90 typedef struct udi_init_context_s       udi_init_context_t;
91 typedef struct udi_limits_s             udi_limits_t;
92 typedef struct udi_chan_context_s       udi_chan_context_t;
93 typedef struct udi_child_chan_context_s udi_child_chan_context_t;
94
95 typedef void    udi_op_t(void);
96 typedef udi_op_t * const        udi_ops_vector_t;
97
98 // === INCLUDE SUB-SECTIONS ===
99 #include "udi/cb.h"     // Control Blocks
100 #include "udi/time.h"   // Timer Services
101 #include "udi/log.h"    // Logging
102 #include "udi/attr.h"   // Attributes
103 #include "udi/strmem.h" // String/Memory
104 #include "udi/queues.h" // Queues
105 #include "udi/buf.h"    // Buffers
106 #include "udi/mem.h"    // Memory Management
107 #include "udi/imc.h"    // Inter-module Communication
108 #include "udi/meta_mgmt.h"      // Management Metalanguage
109 #include "udi/meta_gio.h"       // General IO Metalanguage
110 #include "udi/init.h"   // Init
111
112 #endif

UCC git Repository :: git.ucc.asn.au