More work on UDI, Added more Login VTerms
authorJohn Hodge <tpg@prelude.(none)>
Tue, 12 Jan 2010 14:25:31 +0000 (22:25 +0800)
committerJohn Hodge <tpg@prelude.(none)>
Tue, 12 Jan 2010 14:25:31 +0000 (22:25 +0800)
Kernel/Makefile.BuildNum
Modules/IPStack/main.c
Modules/UDI/include/udi.h
Modules/UDI/include/udi_attr.h [new file with mode: 0644]
Modules/UDI/include/udi_cb.h [new file with mode: 0644]
Modules/UDI/include/udi_init.h
Modules/UDI/include/udi_log.h [new file with mode: 0644]
Usermode/Applications/init_src/main.c

index 662ae94..1f36a5a 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 94
+BUILD_NUM = 1295
index cf9adf6..448381d 100644 (file)
@@ -79,7 +79,7 @@ int IPStack_Install(char **Arguments)
 char *IPStack_ReadDir(tVFS_Node *Node, int Pos)
 {
        tInterface      *iface;
-       char    name[] = "ip0\0\0\0";
+       char    *name;
        ENTER("pNode iPos", Node, Pos);
        
        // Traverse the list
@@ -91,23 +91,31 @@ char *IPStack_ReadDir(tVFS_Node *Node, int Pos)
                return NULL;
        }
        
+       name = malloc(6);
+       name[0] = 'i';
+       name[1] = 'p';
+       
        // Create the name
        Pos = iface->Node.ImplInt;
-       if(Pos < 10)
+       if(Pos < 10) {
                name[2] = '0' + Pos;
+               name[3] = '\0';
+       }
        else if(Pos < 100) {
                name[2] = '0' + Pos/10;
                name[3] = '0' + Pos%10;
+               name[4] = '\0';
        }
        else {
                name[2] = '0' + Pos/100;
                name[3] = '0' + (Pos/10)%10;
                name[4] = '0' + Pos%10;
+               name[5] = '\0';
        }
        
        LEAVE('s', name);
        // Return the pre-generated name
-       return strdup(name);
+       return name;
 }
 
 /**
index acfdebb..136d42d 100644 (file)
@@ -135,7 +135,11 @@ typedef const udi_ubit8_t  udi_layout_t;
  * \}
  */
 
+
 // === INCLUDE SUB-SECTIONS ===
+#include "udi_log.h"   // Management Metalanguage
+#include "udi_attr.h"  // Management Metalanguage
+#include "udi_cb.h"    // Management Metalanguage
 #include "udi_meta_mgmt.h"     // Management Metalanguage
 #include "udi_init.h"  // Init
 
diff --git a/Modules/UDI/include/udi_attr.h b/Modules/UDI/include/udi_attr.h
new file mode 100644 (file)
index 0000000..a63ce8a
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * \file udi_attr.h
+ */
+#ifndef _UDI_ATTR_H_
+#define _UDI_ATTR_H_
+
+typedef struct udi_instance_attr_list_s        udi_instance_attr_list_t;
+typedef udi_ubit8_t    udi_instance_attr_type_t;
+
+/* Instance attribute limits */
+#define UDI_MAX_ATTR_NAMELEN   32
+#define UDI_MAX_ATTR_SIZE              64
+
+/**
+ * \brief Instance Attribute
+ */
+struct udi_instance_attr_list_s
+{
+     char      attr_name[UDI_MAX_ATTR_NAMELEN];
+     udi_ubit8_t       attr_value[UDI_MAX_ATTR_SIZE];
+     udi_ubit8_t       attr_length;
+     udi_instance_attr_type_t  attr_type;
+};
+
+
+/**
+ * \brief Instance Attribute Types
+ * \see ::udi_instance_attr_type_t
+ */
+enum
+{
+       UDI_ATTR_NONE,
+       UDI_ATTR_STRING,
+       UDI_ATTR_ARRAY8,
+       UDI_ATTR_UBIT32,
+       UDI_ATTR_BOOLEAN,
+       UDI_ATTR_FILE
+};
+
+
+#endif
diff --git a/Modules/UDI/include/udi_cb.h b/Modules/UDI/include/udi_cb.h
new file mode 100644 (file)
index 0000000..1f26a59
--- /dev/null
@@ -0,0 +1,39 @@
+/**
+ * \file udi_cb.h
+ */
+#ifndef _UDI_CB_H_
+#define _UDI_CB_H_
+
+typedef struct udi_cb_s        udi_cb_t;
+
+/**
+ * \brief Describes a generic control block
+ * \note Semi-opaque
+ */
+struct udi_cb_s
+{
+       /**
+        * \brief Channel associated with the control block
+        */
+       udi_channel_t   channel;
+       /**
+        * \brief Current state
+        * \note Driver changable
+        */
+       void    *context;
+       /**
+        * \brief CB's scratch area
+        */
+       void    *scratch;
+       /**
+        * \brief ???
+        */
+       void    *initiator_context;
+       /**
+        * \brief Request Handle?
+        */
+       udi_origin_t    origin;
+};
+
+
+#endif
index cfc9e3f..fc69950 100644 (file)
@@ -17,6 +17,9 @@ typedef struct udi_limits_s           udi_limits_t;
 typedef struct udi_chan_context_s      udi_chan_context_t;
 typedef struct udi_child_chan_context_s        udi_child_chan_context_t;
 
+typedef void   udi_op_t(void);
+typedef udi_op_t * const       udi_ops_vector_t;
+
 /**
  * \brief UDI Initialisation Structure
  * 
@@ -239,15 +242,6 @@ struct udi_gcb_init_s
 
 // ===
 // ===
-/**
- * \brief 
- */
-struct udi_init_context_s
-{
-       udi_index_t     region_idx;
-       udi_limits_t    limits;
-};
-
 /**
  * \brief Environement Imposed Limits
  */
@@ -283,6 +277,15 @@ struct udi_limits_s
        udi_ubit32_t    min_timer_res;
 };
 
+/**
+ * \brief Primary Region Context data
+ */
+struct udi_init_context_s
+{
+       udi_index_t     region_idx;
+       udi_limits_t    limits;
+};
+
 /**
  * \brief Channel context data
  */
diff --git a/Modules/UDI/include/udi_log.h b/Modules/UDI/include/udi_log.h
new file mode 100644 (file)
index 0000000..7a01ed4
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * \file udi_log.h
+ */
+#ifndef _UDI_LOG_H_
+#define _UDI_LOG_H_
+
+// Required Files
+#include "udi_cb.h"
+
+/**
+ * \brief Trace Event
+ */
+typedef udi_ubit32_t   udi_trevent_t;
+
+/**
+ * \brief Log Callback
+ */
+typedef void udi_log_write_call_t(udi_cb_t *gcb, udi_status_t correlated_status);
+
+/**
+ * \name Log Severities
+ * \brief Values for severity
+ * \{
+ */
+#define UDI_LOG_DISASTER       1
+#define UDI_LOG_ERROR          2
+#define UDI_LOG_WARNING                3
+#define UDI_LOG_INFORMATION    4
+/**
+ * \}
+ */
+
+
+#endif
index c142331..5005708 100644 (file)
@@ -5,7 +5,7 @@
 
 // === CONSTANTS ===
 #define NULL   ((void*)0)
-#define NUM_TERMS      1
+#define NUM_TERMS      4
 #define        DEFAULT_TERMINAL        "/Devices/VTerm/0"
 #define DEFAULT_SHELL  "/Acess/SBin/login"
 

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