8 * \brief UDI Initialisation Structure
10 * Defines how to initialise and use a UDI driver
15 * \brief Defines the primary region
16 * \note For secondary modules this must be NULL
18 udi_primary_init_t *primary_init_info;
21 * \brief Defines all secondary regions
22 * Pointer to a list (so, essentially an array) of ::udi_secondary_init_t
23 * It is terminated by an entry with ::udi_secondary_init_t.region_idx
25 * \note If NULL, it is to be treated as an empty list
27 udi_secondary_init_t *secondary_init_list;
30 * \brief Channel operations
31 * Pointer to a ::udi_ops_init_t.ops_idx == 0 terminated list that
32 * defines the channel opterations usage for each ops vector implemented
34 * \note Must contain at least one entry for each metalanguage used
36 udi_ops_init_t *ops_init_list;
39 * \brief Control Blocks
41 udi_cb_init_t *cb_init_list;
44 * \brief Generic Control Blocks
46 udi_gcb_init_t *gcb_init_list;
49 * \brief Overrides for control blocks
50 * Allows a control block to override the ammount of scratch space it
51 * gets for a specific ops vector.
53 udi_cb_select_t *cb_select_list;
54 } __attribute__((packed));
58 * \name Flags for ::udi_primary_init_t.mgmt_op_flags
63 * \brief Tells the environment that this operation may take some time
64 * Used as a hint in scheduling tasks
66 #define UDI_OP_LONG_EXEC 0x01
73 * \brief Describes the Primary Region
74 * Tells the environment how to set up the driver's primary region.
76 struct udi_primary_init_s
79 * \brief Management Ops Vector
80 * Pointer to a list of functions for the Management Metalanguage
82 udi_mgmt_ops_t *mgmt_ops;
85 * \brief Flags for \a mgmt_ops
86 * Each entry in \a mgmt_ops is acommanied by an entry in this array.
87 * Each entry contains the flags that apply to the specified ops vector.
88 * \see UDI_OP_LONG_EXEC
90 const udi_ubit8_t *mgmt_op_flags;
93 * \brief Scratch space size
94 * Specifies the number of bytes to allocate for each control block
95 * passed by the environment.
96 * \note must not exceed ::UDI_MAX_SCRATCH
98 udi_size_t mgmt_scratch_requirement;
101 * \todo What is this?
103 udi_ubit8_t enumeration_attr_list_length;
106 * \brief Size in bytes to allocate to each instance of the primary
108 * Essentially the size of the driver's instance state
109 * \note Must be at least sizeof(udi_init_context_t) and not more
110 * than UDI_MIN_ALLOC_LIMIT
112 udi_size_t rdata_size;
115 * \brief Size in bytes to allocate for each call to ::udi_enumerate_req
116 * \note Must not exceed UDI_MIN_ALLOC_LIMIT
118 udi_size_t child_data_size;
121 * \brief Number of path handles for each parent bound to this driver
122 * \todo What the hell are path handles?
124 udi_ubit8_t per_parent_paths;
128 * \brief Tells the environment how to create a secondary region
130 struct udi_secondary_init_s
133 * \brief Region Index
134 * Non-zero driver-dependent index value that identifies the region
135 * \note This corresponds to a "region" declaration in the udiprops.txt
138 udi_index_t region_idx;
140 * \brief Number of bytes to allocate
142 * \note Again, must be between sizeof(udi_init_context_t) and
143 * UDI_MIN_ALLOC_LIMIT
145 udi_size_t rdata_size;
149 * \brief Defines channel endpoints (ways of communicating with the driver)
152 struct udi_ops_init_s
155 * \brief ops index number
156 * Used to uniquely this entry
157 * \note If this is zero, it marks the end of the list
161 * \brief Metalanguage Index
162 * Defines what metalanguage is used
164 udi_index_t meta_idx;
166 * \brief Metalanguage Operation
167 * Defines what metalanguage operation is used
169 udi_index_t meta_ops_num;
171 * \brief Size of the context area
172 * \note If non-zero, must be at least
174 udi_size_t chan_context_size;
176 * \brief Pointer to the operations
177 * Pointer to a <<meta>>_<<role>>_ops_t structure
179 udi_ops_vector_t *ops_vector;
181 * \brief Flags for each entry in \a ops_vector
183 const udi_ubit8_t *op_flags;
187 * \brief Defines control blocks
188 * Much the same as ::udi_ops_init_t
193 udi_index_t meta_idx;
194 udi_index_t meta_cb_num;
195 udi_size_t scratch_requirement;
197 * \brief Size of inline memory
199 udi_size_t inline_size;
201 * \brief Layout of inline memory
203 udi_layout_t *inline_layout;
207 * \brief Overrides the scratch size for an operation
209 struct udi_cb_select_s
216 * \brief General Control Blocks
217 * These control blocks can only be used as general data storage, not
218 * for any channel operations.
220 struct udi_gcb_init_s
223 udi_size_t scratch_requirement;
230 * \brief Environement Imposed Limits
235 * \brief Maximum legal ammount of memory that can be allocated
237 udi_size_t max_legal_alloc;
240 * \brief Maximum ammount of guaranteed memory
242 udi_size_t max_safe_alloc;
244 * \brief Maximum size of the final string from ::udi_trace_write
247 udi_size_t max_trace_log_formatted_len;
249 * \brief Maximum legal size of an instanct attribute value
251 udi_size_t max_instance_attr_len;
253 * \brief Minumum time difference (in nanoseconds between unique values
254 * returned by ::udi_time_current
256 udi_ubit32_t min_curtime_res;
258 * \brief Minimum resolution of timers
259 * \see ::udi_timer_start_repeating, ::udi_timer_start
261 udi_ubit32_t min_timer_res;
262 } __attribute__((packed));
265 * \brief Primary Region Context data
267 struct udi_init_context_s
269 udi_index_t region_idx;
274 * \brief Channel context data
276 struct udi_chan_context_s
279 * \brief Pointer to the driver instance's initial region data
282 } __attribute__((packed));
285 * \brief Child Channel context
287 struct udi_child_chan_context_s
290 * \brief Pointer to the driver instance's initial region data
294 * \brief Some sort of unique ID number
296 udi_ubit32_t child_ID;