-BUILD_NUM = 1315
+BUILD_NUM = 1321
offset += (cluster - 2) * disk->bootsect.spc;\r
}\r
// Sector in cluster\r
- if(disk->bootsect.spc == 1)\r
- offset += (dirpos / 16);\r
- else\r
+ if(disk->bootsect.spc != 1)\r
offset += (dirpos / 16) % disk->bootsect.spc;\r
// Offset in sector\r
a = dirpos % 16;\r
\r
- LOG("offset=%i, a=%i", (Uint)offset, a);\r
+ LOG("offset=%i, a=%i", offset, a);\r
\r
// Read Sector\r
VFS_ReadAt(disk->fileHandle, offset*512, 512, fileinfo); // Read Dir Data\r
#
CPPFLAGS = -I./include
-OBJ = main.o logging.o
+OBJ = main.o logging.o strmem.o imc.o
+OBJ += meta_mgmt.o
NAME = UDI
-include ../Makefile.tpl
--- /dev/null
+/**
+ * \file imc.c
+ * \author John Hodge (thePowersGang)
+ */
+#include <acess.h>
+#include <udi.h>
+#include <udi_imc.h>
+
+// === CODE ===
+/**
+ */
+void udi_channel_anchor(
+ udi_channel_anchor_call_t *callback, udi_cb_t *gcb,
+ udi_channel_t channel, udi_index_t ops_idx, void *channel_context
+ )
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+/**
+ */
+extern void udi_channel_spawn(
+ udi_channel_spawn_call_t *callback, udi_cb_t *gcb,
+ udi_channel_t channel, udi_index_t spawn_idx,
+ udi_index_t ops_idx, void *channel_context
+ )
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+/**
+ *
+ */
+void udi_channel_set_context(
+ udi_channel_t target_channel, void *channel_context
+ )
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+void udi_channel_op_abort(
+ udi_channel_t target_channel, udi_cb_t *orig_cb
+ )
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+void udi_channel_close(udi_channel_t channel)
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+void udi_channel_event_ind(udi_channel_event_cb_t *cb)
+{
+ udi_channel_event_complete(cb, UDI_OK);
+}
+
+void udi_channel_event_complete(
+ udi_channel_event_cb_t *cb, udi_status_t status
+ )
+{
+ Warning("%s Unimplemented", __func__);
+}
+
+// === EXPORTS ===
+EXPORT(udi_channel_anchor);
+EXPORT(udi_channel_spawn);
+EXPORT(udi_channel_set_context);
+EXPORT(udi_channel_op_abort);
+EXPORT(udi_channel_close);
+EXPORT(udi_channel_event_ind);
+EXPORT(udi_channel_event_complete);
--- /dev/null
+/**
+ * \file udi_imc.h
+ * \brief Inter-Module Communication
+ */
+#ifndef _UDI_IMC_H_
+#define _UDI_IMC_H_
+
+typedef void udi_channel_anchor_call_t(udi_cb_t *gcb, udi_channel_t anchored_channel);
+typedef void udi_channel_spawn_call_t(udi_cb_t *gcb, udi_channel_t new_channel);
+
+typedef struct udi_channel_event_cb_s udi_channel_event_cb_t;
+
+typedef void udi_channel_event_ind_op_t(udi_channel_event_cb_t *cb);
+
+/**
+ * \brief Anchors a channel end to the current region
+ */
+extern void udi_channel_anchor(
+ udi_channel_anchor_call_t *callback, udi_cb_t *gcb,
+ udi_channel_t channel, udi_index_t ops_idx, void *channel_context
+ );
+
+/**
+ * \brief Created a new channel between two regions
+ */
+extern void udi_channel_spawn(
+ udi_channel_spawn_call_t *callback,
+ udi_cb_t *gcb,
+ udi_channel_t channel,
+ udi_index_t spawn_idx,
+ udi_index_t ops_idx,
+ void *channel_context
+ );
+
+/**
+ * \brief Attaches a new context pointer to the current channel
+ */
+extern void udi_channel_set_context(
+ udi_channel_t target_channel,
+ void *channel_context
+ );
+/**
+ * \brief
+ */
+extern void udi_channel_op_abort(
+ udi_channel_t target_channel,
+ udi_cb_t *orig_cb
+ );
+
+/**
+ * \brief Closes an open channel
+ */
+extern void udi_channel_close(udi_channel_t channel);
+
+/**
+ * \brief Describes a channel event
+ */
+struct udi_channel_event_cb_s
+{
+ udi_cb_t gcb;
+ udi_ubit8_t event;
+ union {
+ struct {
+ udi_cb_t *bind_cb;
+ } internal_bound;
+ struct {
+ udi_cb_t *bind_cb;
+ udi_ubit8_t parent_ID;
+ udi_buf_path_t *path_handles;
+ } parent_bound;
+ udi_cb_t *orig_cb;
+ } params;
+};
+/* Channel event types */
+#define UDI_CHANNEL_CLOSED 0
+#define UDI_CHANNEL_BOUND 1
+#define UDI_CHANNEL_OP_ABORTED 2
+
+/**
+ * \brief Proxy function
+ */
+extern void udi_channel_event_ind(udi_channel_event_cb_t *cb);
+
+/**
+ * \brief Called when channel event is completed
+ */
+extern void udi_channel_event_complete(
+ udi_channel_event_cb_t *cb, udi_status_t status
+ );
+
+
+#endif
* \{
*/
typedef void udi_devmgmt_req_op_t(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID);
-/* Values for mgmt_op */
-#define UDI_DMGMT_PREPARE_TO_SUSPEND 1
-#define UDI_DMGMT_SUSPEND 2
-#define UDI_DMGMT_SHUTDOWN 3
-#define UDI_DMGMT_PARENT_SUSPENDED 4
-#define UDI_DMGMT_RESUME 5
-#define UDI_DMGMT_UNBIND 6
typedef void udi_devmgmt_ack_op_t(udi_mgmt_cb_t *cb, udi_ubit8_t flags, udi_status_t status);
-/* Values for flags */
-#define UDI_DMGMT_NONTRANSPARENT (1U<<0)
-/* Meta-Specific Status Codes */
-#define UDI_DMGMT_STAT_ROUTING_CHANGE (UDI_STAT_META_SPECIFIC|1)
/**
* \}
*/
/* Special parent_ID filter values */
#define UDI_ANY_PARENT_ID 0
+/**
+ * \brief
+ */
+extern void udi_devmgmt_req(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID );
+/**
+ * \brief Values for ::udi_devmgmt_req \a mgmt_op
+ */
+enum eDMGMT
+{
+ UDI_DMGMT_PREPARE_TO_SUSPEND = 1,
+ UDI_DMGMT_SUSPEND,
+ UDI_DMGMT_SHUTDOWN,
+ UDI_DMGMT_PARENT_SUSPENDED,
+ UDI_DMGMT_RESUME,
+ UDI_DMGMT_UNBIND
+};
+
+extern void udi_devmgmt_ack(udi_mgmt_cb_t *cb, udi_ubit8_t flags, udi_status_t status);
+//!\brief Values for flags
+#define UDI_DMGMT_NONTRANSPARENT (1U<<0)
+//!\brief Meta-Specific Status Codes
+#define UDI_DMGMT_STAT_ROUTING_CHANGE (UDI_STAT_META_SPECIFIC|1)
+
+extern void udi_final_cleanup_req(udi_mgmt_cb_t *cb);
+extern void udi_final_cleanup_ack(udi_mgmt_cb_t *cb);
+
+
#endif
--- /dev/null
+/**
+ * \file udi_strmem.h
+ */
+#ifndef _UDI_STRMEM_H_
+#define _UDI_STRMEM_H_
+
+/**
+ * \brief Gets the length of a C style string
+ */
+extern udi_size_t udi_strlen(const char *s);
+
+/**
+ * \brief Appends to a string
+ */
+extern char *udi_strcat(char *s1, const char *s2);
+extern char *udi_strncat(char *s1, const char *s2, udi_size_t n);
+
+/**
+ * \brief Compares Strings/Memory
+ */
+extern udi_sbit8_t udi_strcmp(const char *s1, const char *s2);
+extern udi_sbit8_t udi_strncmp(const char *s1, const char *s2, udi_size_t n);
+extern udi_sbit8_t udi_memcmp(const void *s1, const void *s2, udi_size_t n);
+
+extern char *udi_strcpy(char *s1, const char *s2);
+extern char *udi_strncpy(char *s1, const char *s2, udi_size_t n);
+extern void *udi_memcpy(void *s1, const void *s2, udi_size_t n);
+extern void *udi_memmove(void *s1, const void *s2, udi_size_t n);
+
+extern char *udi_strncpy_rtrim(char *s1, const char *s2, udi_size_t n);
+
+extern char *udi_strchr(const char *s, char c);
+extern char *udi_strrchr(const char *s, char c);
+extern void *udi_memchr (const void *s, udi_ubit8_t c, udi_size_t n);
+
+extern void *udi_memset(void *s, udi_ubit8_t c, udi_size_t n);
+extern udi_ubit32_t udi_strtou32(const char *s, char **endptr, int base);
+
+
+extern udi_size_t udi_snprintf(char *s, udi_size_t max_bytes, const char *format, ...);
+
+
+
+#endif
--- /dev/null
+/**
+ * \file meta_mgmt.c
+ * \author John Hodge (thePowersGang)
+ */
+#include <acess.h>
+#include <udi.h>
+#include <udi_meta_mgmt.h>
+
+// === CODE ===
+void udi_devmgmt_req(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID )
+{
+ ENTER("pcb imgmt_op iparent_ID", cb, mgmt_op, parent_ID);
+ LEAVE('-');
+}
+
+void udi_devmgmt_ack(udi_mgmt_cb_t *cb, udi_ubit8_t flags, udi_status_t status)
+{
+ ENTER("pcb xflags istatus", cb, flags, status);
+ LEAVE('-');
+}
+
+void udi_final_cleanup_req(udi_mgmt_cb_t *cb)
+{
+ ENTER("pcb", cb);
+ LEAVE('-');
+}
+
+void udi_final_cleanup_ack(udi_mgmt_cb_t *cb)
+{
+ ENTER("pcb", cb);
+ LEAVE('-');
+}
+
+// === EXPORTS ===
+EXPORT(udi_devmgmt_req);
+EXPORT(udi_devmgmt_ack);
+EXPORT(udi_final_cleanup_req);
+EXPORT(udi_final_cleanup_ack);
--- /dev/null
+/**
+ * \file strmem.c
+ * \author John Hodge (thePowersGang)
+ */
+#include <acess.h>
+#include <udi.h>
+#include <udi_strmem.h>
+
+// === CODE ===
+udi_size_t udi_snprintf(char *s, udi_size_t max_bytes, const char *format, ...)
+{
+ s[0] = '\0';
+ return 0;
+}
+
+// === EXPORTS ===
+EXPORT(udi_snprintf);