add break lock functionality to sosd
[archipelago] / xseg / drivers / user / xseg_segdev.c
index f88f6d6..9ec5cb2 100644 (file)
@@ -14,6 +14,7 @@
 #include <xseg/xseg.h>
 #include <sys/util.h>
 #include <sys/kernel/segdev.h>
+#include <drivers/xseg_segdev.h>
 
 #define ERRSIZE 512
 static char errbuf[ERRSIZE];
@@ -148,12 +149,22 @@ static struct xseg_type xseg_segdev = {
        "segdev"
 };
 
-static int segdev_signal_init(void)
+static int segdev_local_signal_init(struct xseg *xseg, xport portno)
+{
+       return -1;
+}
+
+static void segdev_local_signal_quit(struct xseg *xseg, xport portno)
+{
+       return;
+}
+
+static int segdev_remote_signal_init(void)
 {
        return 0;
 }
 
-static void segdev_signal_quit(void)
+static void segdev_remote_signal_quit(void)
 {
        return;
 }
@@ -178,9 +189,13 @@ static int segdev_signal(struct xseg *xseg, uint32_t portno)
        struct xseg_port *port = xseg_get_port(xseg, portno);
        if (!port)
                return -1;
+       struct segdev_signal_desc *ssd = xseg_get_signal_desc(xseg, port);
+       if (!ssd)
+               return -1;
 
-       if (!port->waitcue)
+       if (!ssd->waitcue){
                return 0;
+       }
        else
                return write(opendev(), &portno, sizeof(portno));
 }
@@ -197,11 +212,49 @@ static void *segdev_realloc(void *mem, uint64_t size)
 
 static void segdev_mfree(void *mem) { }
 
+static int segdev_init_signal_desc(struct xseg *xseg, void *sd)
+{
+       return -1;
+}
+
+static void segdev_quit_signal_desc(struct xseg *xseg, void *sd)
+{
+       return;
+}
+
+static void *segdev_alloc_data(struct xseg *xseg)
+{
+       return NULL;
+}
+
+static void segdev_free_data(struct xseg *xseg, void *data)
+{
+       return;
+}
+
+static void *segdev_alloc_signal_desc(struct xseg *xseg, void *data)
+{
+       return NULL;
+}
+
+static void segdev_free_signal_desc(struct xseg *xseg, void *data, void *sd)
+{
+       return;
+}
+
 static struct xseg_peer xseg_peer_segdev = {
        /* xseg signal operations */
        {
-               .signal_init = segdev_signal_init,
-               .signal_quit = segdev_signal_quit,
+               .init_signal_desc   = segdev_init_signal_desc,
+               .quit_signal_desc   = segdev_quit_signal_desc,
+               .alloc_data         = segdev_alloc_data,
+               .free_data          = segdev_free_data,
+               .alloc_signal_desc  = segdev_alloc_signal_desc,
+               .free_signal_desc   = segdev_free_signal_desc,
+               .local_signal_init  = segdev_local_signal_init,
+               .local_signal_quit  = segdev_local_signal_quit,
+               .remote_signal_init = segdev_remote_signal_init,
+               .remote_signal_quit = segdev_remote_signal_quit,
                .prepare_wait = segdev_prepare_wait,
                .cancel_wait = segdev_cancel_wait,
                .wait_signal = segdev_wait_signal,