Modules/UDI - Attributes, PIO, CB allocation and channel_spawn
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / udi_internal.h
index be9f5bc..9cc835a 100644 (file)
@@ -15,6 +15,7 @@
 
 typedef struct sUDI_PropMessage        tUDI_PropMessage;
 typedef struct sUDI_PropRegion         tUDI_PropRegion;
+typedef struct sUDI_PropDevSpec        tUDI_PropDevSpec;
 
 typedef const struct sUDI_MetaLang     tUDI_MetaLang;
 
@@ -25,6 +26,8 @@ typedef struct sUDI_DriverModule      tUDI_DriverModule;
 typedef struct sUDI_DriverInstance     tUDI_DriverInstance;
 typedef struct sUDI_DriverRegion       tUDI_DriverRegion;
 
+typedef struct sUDI_ChildBinding       tUDI_ChildBinding;
+
 struct sUDI_PropMessage
 {
         int    locale;
@@ -34,6 +37,7 @@ struct sUDI_PropMessage
 
 struct sUDI_PropRegion
 {
+       udi_index_t     RegionIdx;
        enum {
                UDI_REGIONTYPE_NORMAL,
                UDI_REGIONTYPE_FP,
@@ -57,16 +61,20 @@ struct sUDI_PropRegion
        }       Latency;
        udi_ubit32_t    OverrunTime;
 
-
+       udi_index_t     BindMeta;
+       udi_index_t     PriBindOps;
+       udi_index_t     SecBindOps;
+       udi_index_t     BindCb;
 };
 
 struct sUDI_MetaLang
 {
        const char *Name;
-        int    nOpGroups;
+        int    nCbTypes;
        struct {
-               void    *OpList;
-       } OpGroups;
+               udi_size_t      Size;
+               udi_layout_t    *Layout;
+       } CbTypes[];
 };
 
 struct sUDI_MetaLangRef
@@ -85,6 +93,15 @@ struct sUDI_BindOps
        udi_ubit8_t     bind_cb_idx;
 };
 
+struct sUDI_PropDevSpec
+{
+        int    MessageNum;
+       udi_ubit8_t     MetaIdx;
+       tUDI_MetaLang   *Metalang;
+        int    nAttribs;
+       udi_instance_attr_list_t        Attribs[];
+};
+
 struct sUDI_DriverModule
 {
        tUDI_DriverModule       *Next;
@@ -108,13 +125,25 @@ struct sUDI_DriverModule
 
         int    nParents;
        tUDI_BindOps    *Parents;
+       
+        int    nChildBindOps;
+       tUDI_BindOps    *ChildBindOps;
+
+        int    nDevices;
+       tUDI_PropDevSpec        **Devices;
+
         int    nRegions;
 };
 
 struct sUDI_DriverInstance
 {
+       struct sUDI_DriverInstance      *Next;
        tUDI_DriverModule       *Module;
        udi_channel_t   ManagementChannel;
+       tUDI_DriverInstance     *Parent;
+       tUDI_ChildBinding       *ParentChildBinding;
+       
+       tUDI_ChildBinding       *FirstChild;
        tUDI_DriverRegion       *Regions[];
 };
 
@@ -123,7 +152,22 @@ struct sUDI_DriverRegion
        udi_init_context_t      *InitContext;
 };
 
+struct sUDI_ChildBinding
+{
+       tUDI_ChildBinding       *Next;
+       
+       udi_ubit32_t    ChildID;
+       tUDI_MetaLang   *Metalang;
+       tUDI_BindOps    *BindOps;
+       
+       udi_ops_init_t  *Ops;
+       tUDI_DriverInstance     *BoundInstance;
+       
+        int    nAttribs;
+       udi_instance_attr_list_t        Attribs[];
+};
 
+// --- Metalanguages ---
 extern tUDI_MetaLang   cMetaLang_Management;
 
 
@@ -133,9 +177,13 @@ extern tUDI_MetaLang *UDI_int_GetMetaLang(tUDI_DriverInstance *Inst, udi_index_t
 
 // --- Channels ---
 extern udi_channel_t   UDI_CreateChannel_Blank(tUDI_MetaLang *metalang);
-extern int     UDI_BindChannel_Raw(udi_channel_t channel, bool other_side, udi_index_t meta_ops_num, void *context, const void *ops);
-extern int     UDI_BindChannel(udi_channel_t channel, bool other_side, tUDI_DriverInstance *inst, udi_index_t ops, udi_index_t region);
+extern udi_channel_t   UDI_CreateChannel_Linked(udi_channel_t orig, udi_ubit8_t spawn_idx);
+extern int     UDI_BindChannel_Raw(udi_channel_t channel, bool other_side, tUDI_DriverInstance *inst, udi_index_t region_idx, udi_index_t meta_ops_num,  void *context, const void *ops);
+extern int     UDI_BindChannel(udi_channel_t channel, bool other_side, tUDI_DriverInstance *inst, udi_index_t ops, udi_index_t region, void *context, bool is_child_bind, udi_ubit32_t child_ID);
+extern tUDI_DriverInstance     *UDI_int_ChannelGetInstance(udi_cb_t *gcb, bool other_side, udi_index_t *region_idx);
+extern void    UDI_int_ChannelSetContext(udi_channel_t channel, void *context);
 extern const void      *UDI_int_ChannelPrepForCall(udi_cb_t *gcb, tUDI_MetaLang *metalang, udi_index_t meta_ops_num);
+extern void    UDI_int_ChannelFlip(udi_cb_t *gcb);
 extern void    UDI_int_ChannelReleaseFromCall(udi_cb_t *gcb);
 
 // --- Async Calls ---
@@ -145,9 +193,11 @@ struct sUDI_DeferredCall
 {
        struct sUDI_DeferredCall        *Next;
        tUDI_DeferredUnmarshal  *Unmarshal;
+       udi_cb_t        *cb;
        udi_op_t        *Handler;
        // ...
 };
+extern void    UDI_int_DeferredThread(void *unused);   // Worker started by main.c
 extern void    UDI_int_AddDeferred(tUDI_DeferredCall *Call);
 extern void    UDI_int_MakeDeferredCb(udi_cb_t *cb, udi_op_t *handler);
 extern void    UDI_int_MakeDeferredCbU8(udi_cb_t *cb, udi_op_t *handler, udi_ubit8_t arg1);
@@ -156,6 +206,8 @@ extern void UDI_int_MakeDeferredCbS(udi_cb_t *cb, udi_op_t *handler, udi_status_
 // --- CBs ---
 extern void *udi_cb_alloc_internal(tUDI_DriverInstance *Inst, udi_ubit8_t bind_cb_idx, udi_channel_t channel);
 
+// --- Attribute Management ---
+extern udi_instance_attr_type_t udi_instance_attr_get_internal(udi_cb_t *gcb, const char *attr_name, udi_ubit32_t child_ID, void *attr_value, udi_size_t attr_length, udi_size_t *actual_length);
 
 #endif
 

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