Kernel - Slight reworks to timer code
[tpg/acess2.git] / Modules / Interfaces / UDI / include / udi / cb.h
1 /**
2  * \file udi_cb.h
3  */
4 #ifndef _UDI_CB_H_
5 #define _UDI_CB_H_
6
7 typedef struct udi_cb_s udi_cb_t;
8 typedef void udi_cb_alloc_call_t(udi_cb_t *gcb, udi_cb_t *new_cb);
9 typedef void udi_cb_alloc_batch_call_t(udi_cb_t *gcb, udi_cb_t *first_new_cb);
10 typedef void udi_cancel_call_t(udi_cb_t *gcb);
11
12 #define UDI_GCB(mcb)    (&(mcb)->gcb)
13 #define UDI_MCB(gcb, cb_type)   ((cb_type *)(gcb))
14
15 /**
16  * \brief Describes a generic control block
17  * \note Semi-opaque
18  */
19 struct udi_cb_s
20 {
21         /**
22          * \brief Channel associated with the control block
23          */
24         udi_channel_t   channel;
25         /**
26          * \brief Current state
27          * \note Driver changable
28          */
29         void    *context;
30         /**
31          * \brief CB's scratch area
32          */
33         void    *scratch;
34         /**
35          * \brief ???
36          */
37         void    *initiator_context;
38         /**
39          * \brief Request Handle?
40          */
41         udi_origin_t    origin;
42 };
43
44 extern void udi_cb_alloc (
45         udi_cb_alloc_call_t     *callback,
46         udi_cb_t        *gcb,
47         udi_index_t     cb_idx,
48         udi_channel_t   default_channel
49         );
50
51 extern void udi_cb_alloc_dynamic(
52         udi_cb_alloc_call_t     *callback,
53         udi_cb_t        *gcb,
54         udi_index_t     cb_idx,
55         udi_channel_t   default_channel,
56         udi_size_t      inline_size,
57         udi_layout_t    *inline_layout
58         );
59
60 extern void udi_cb_alloc_batch(
61         udi_cb_alloc_batch_call_t       *callback,
62         udi_cb_t        *gcb,
63         udi_index_t     cb_idx,
64         udi_index_t     count,
65         udi_boolean_t   with_buf,
66         udi_size_t      buf_size,
67         udi_buf_path_t  path_handle
68         );
69
70 extern void udi_cb_free(udi_cb_t *cb);
71
72 extern void udi_cancel(udi_cancel_call_t *callback, udi_cb_t *gcb);
73
74
75
76
77 #endif

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