rename dist2 interface to octopus
authorGerd Zellweger <zgerd@student.ethz.ch>
Fri, 16 Mar 2012 21:27:23 +0000 (22:27 +0100)
committerGerd Zellweger <zgerd@student.ethz.ch>
Fri, 16 Mar 2012 21:27:23 +0000 (22:27 +0100)
--HG--
branch : octopus.renaming
rename : if/dist2.if => if/octopus.if

32 files changed:
if/Hakefile
if/octopus.if [moved from if/dist2.if with 100% similarity]
lib/barrelfish/domain.c
lib/barrelfish/nameservice_client.c
lib/octopus/client/barriers.c
lib/octopus/client/capability_storage.c
lib/octopus/client/getset.c
lib/octopus/client/handler.h
lib/octopus/client/locking.c
lib/octopus/client/nameservice_client.c
lib/octopus/client/octopus.c
lib/octopus/client/pubsub.c
lib/octopus/client/semaphores.c
lib/octopus/client/trigger.c
lib/octopus/parser/parse.c
lib/octopus/parser/parse.y
lib/octopus/server/capstorage.c
lib/octopus/server/init.c
lib/octopus/server/queue.c
lib/octopus/server/queue.h
lib/octopus/server/service.c
usr/kaluga/common.c
usr/kaluga/kaluga.h
usr/kaluga/start_cpu.c
usr/kaluga/start_pci.c
usr/skb/dist/predicates.c
usr/skb/dist/skb_query.c
usr/tests/dist2test/d2bench.c
usr/tests/dist2test/d2bench1.c
usr/tests/dist2test/d2bench2.c
usr/tests/dist2test/d2trigger.c
usr/tests/dist2test/thc.c

index 1c2fe43..6feae5e 100644 (file)
@@ -46,8 +46,7 @@
                "serial",
                "skb",
                "skb_map",
-               "dist2",               
-               "dist_event",
+               "octopus",               
                "spawn",
                "test",
                "timer",
@@ -73,6 +72,6 @@
                "ping_pong",
                "mem",
                "xmplthc",
-               "dist2" ],
+               "octopus" ],
              arch <- allArchitectures
 ]
similarity index 100%
rename from if/dist2.if
rename to if/octopus.if
index a63c249..e1b9fcf 100644 (file)
@@ -1088,7 +1088,7 @@ struct skb_state *get_skb_state(void)
 /**
  * \brief Returns a pointer to the chips_context state on the dispatcher priv
  */
-struct dist2_rpc_client *get_nameservice_rpc_client(void)
+struct octopus_rpc_client *get_nameservice_rpc_client(void)
 {
     dispatcher_handle_t handle = curdispatcher();
     struct dispatcher_generic* disp = get_dispatcher_generic(handle);
@@ -1098,7 +1098,7 @@ struct dist2_rpc_client *get_nameservice_rpc_client(void)
 /**
  * \brief set the chips_context state on the dispatcher priv
  */
-void set_nameservice_rpc_client(struct dist2_rpc_client *c)
+void set_nameservice_rpc_client(struct octopus_rpc_client *c)
 {
     dispatcher_handle_t handle = curdispatcher();
     struct dispatcher_generic* disp = get_dispatcher_generic(handle);
index e42f89d..e0b5011 100644 (file)
@@ -16,8 +16,8 @@
 #include <barrelfish/barrelfish.h>
 #include <barrelfish/nameservice_client.h>
 
-#include <if/dist2_defs.h>
-#include <if/dist2_rpcclient_defs.h>
+#include <if/octopus_defs.h>
+#include <if/octopus_rpcclient_defs.h>
 #include <if/monitor_defs.h>
 #include <octopus/getset.h> // for dist_read TODO
 #include <octopus/trigger.h> // for NOP_TRIGGER
@@ -32,13 +32,13 @@ errval_t nameservice_lookup(const char *iface, iref_t *retiref)
 {
     errval_t err;
 
-    struct dist2_rpc_client *r = get_nameservice_rpc_client();
+    struct octopus_rpc_client *r = get_nameservice_rpc_client();
     if (r == NULL) {
         return LIB_ERR_NAMESERVICE_NOT_BOUND;
     }
 
     char* record = NULL;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     errval_t error_code;
     err = r->vtbl.get(r, iface, NOP_TRIGGER, &record, &tid, &error_code);
     if (err_is_fail(err)) {
@@ -77,7 +77,7 @@ errval_t nameservice_blocking_lookup(const char *iface, iref_t *retiref)
 {
     errval_t err;
 
-    struct dist2_rpc_client *r = get_nameservice_rpc_client();
+    struct octopus_rpc_client *r = get_nameservice_rpc_client();
     if (r == NULL) {
         return LIB_ERR_NAMESERVICE_NOT_BOUND;
     }
@@ -121,7 +121,7 @@ errval_t nameservice_register(const char *iface, iref_t iref)
 {
     errval_t err = SYS_ERR_OK;
 
-    struct dist2_rpc_client *r = get_nameservice_rpc_client();
+    struct octopus_rpc_client *r = get_nameservice_rpc_client();
     if (r == NULL) {
         return LIB_ERR_NAMESERVICE_NOT_BOUND;
     }
@@ -136,7 +136,7 @@ errval_t nameservice_register(const char *iface, iref_t iref)
     snprintf(record, len+1, format, iface, iref);
 
     char* ret = NULL;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     errval_t error_code;
     err = r->vtbl.set(r, record, 0, NOP_TRIGGER, 0, &ret, &tid, &error_code);
     if (err_is_fail(err)) {
@@ -152,7 +152,7 @@ out:
 /* ----------------------- BIND/INIT CODE FOLLOWS ----------------------- */
 
 
-static void error_handler(struct dist2_binding *b, errval_t err)
+static void error_handler(struct octopus_binding *b, errval_t err)
 {
     USER_PANIC_ERR(err, "asynchronous error in nameservice binding");
 }
@@ -163,17 +163,17 @@ struct bind_state {
 };
 
 static void bind_continuation(void *st_arg, errval_t err,
-                              struct dist2_binding *b)
+                              struct octopus_binding *b)
 {
     struct bind_state *st = st_arg;
 
     if (err_is_ok(err)) {
         b->error_handler = error_handler;
 
-        struct dist2_rpc_client *r;
-        r = malloc(sizeof(struct dist2_rpc_client));
+        struct octopus_rpc_client *r;
+        r = malloc(sizeof(struct octopus_rpc_client));
         assert(r != NULL);
-        err = dist2_rpc_client_init(r, b);
+        err = octopus_rpc_client_init(r, b);
         if (err_is_fail(err)) {
             free(r);
             USER_PANIC_ERR(err, "error in nameservice_rpc_client_init");
@@ -195,7 +195,7 @@ static void get_name_iref_reply(struct monitor_binding *mb, iref_t iref,
     if (iref == 0) {
         err = LIB_ERR_GET_NAME_IREF;
     } else {
-        err = dist2_bind(iref, bind_continuation, st,
+        err = octopus_bind(iref, bind_continuation, st,
                 get_default_waitset(), IDC_BIND_FLAG_RPC_CAP_TRANSFER);
     }
 
index 8a0d218..2cc7517 100644 (file)
@@ -44,9 +44,9 @@ errval_t oct_barrier_enter(const char* name, char** barrier_record, size_t wait_
     uint64_t mode = 0;
     uint64_t state = 0;
     uint64_t fn = 0;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     size_t current_barriers = 0;
-    dist2_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD, dist2_BINDING_RPC,
+    octopus_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD, octopus_BINDING_RPC,
             DIST_ON_SET, NULL, NULL);
 
     err = oct_set_get(SET_SEQUENTIAL, barrier_record,
@@ -61,7 +61,7 @@ errval_t oct_barrier_enter(const char* name, char** barrier_record, size_t wait_
     //        wait_for);
 
     if (current_barriers != wait_for) {
-        struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+        struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
         err = cl->call_seq.exists(cl, name, t, &tid, &exist_err);
         if (err_is_fail(err)) {
             return err;
@@ -115,8 +115,8 @@ errval_t oct_barrier_leave(const char* barrier_record)
     uint64_t mode = 0;
     uint64_t state = 0;
     uint64_t fn = 0;
-    dist2_trigger_id_t tid;
-    dist2_trigger_t t = oct_mktrigger(SYS_ERR_OK, dist2_BINDING_RPC,
+    octopus_trigger_id_t tid;
+    octopus_trigger_t t = oct_mktrigger(SYS_ERR_OK, octopus_BINDING_RPC,
             DIST_ON_DEL, NULL, NULL);
 
     //debug_printf("leaving: %s\n", barrier_record);
@@ -135,7 +135,7 @@ errval_t oct_barrier_leave(const char* barrier_record)
         //debug_printf("remaining barriers is: %lu\n", remaining_barriers);
 
         if (err_is_ok(err)) {
-            struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+            struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
             err = cl->call_seq.exists(cl, barrier_name, t, &tid, &exist_err);
             if (err_is_fail(err)) {
                 goto out;
index 6618d2a..48fd7d2 100644 (file)
@@ -28,7 +28,7 @@
 errval_t oct_get_capability(const char *key, struct capref *retcap)
 {
     errval_t reterr;
-    struct dist2_thc_client_binding_t *cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t *cl = oct_get_thc_client();
 
     errval_t err = cl->call_seq.get_cap(cl, key, retcap, &reterr);
     if(err_is_fail(err)) {
@@ -47,7 +47,7 @@ errval_t oct_get_capability(const char *key, struct capref *retcap)
 errval_t oct_put_capability(const char *key, struct capref cap)
 {
     errval_t reterr;
-    struct dist2_thc_client_binding_t *cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t *cl = oct_get_thc_client();
 
     errval_t err = cl->call_seq.put_cap(cl, key, cap, &reterr);
     if(err_is_fail(err)) {
@@ -65,7 +65,7 @@ errval_t oct_put_capability(const char *key, struct capref cap)
 errval_t oct_remove_capability(const char *key)
 {
     errval_t reterr;
-    struct dist2_thc_client_binding_t *cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t *cl = oct_get_thc_client();
 
     errval_t err = cl->call_seq.remove_cap(cl, key, &reterr);
     if(err_is_fail(err)) {
index cfedc78..3c6003b 100644 (file)
@@ -143,10 +143,10 @@ errval_t oct_get_names(char*** names, size_t* len, const char* query, ...)
 
     FORMAT_QUERY(query, args, buf); // buf
 
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
 
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.get_names(cl, buf, NOP_TRIGGER, &data,
             &tid, &error_code);
     if (err_is_ok(err)) {
@@ -201,13 +201,13 @@ errval_t oct_get(char** data, const char* query, ...)
     assert(query != NULL);
     errval_t error_code;
     errval_t err = SYS_ERR_OK;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     va_list args;
 
     char* buf = NULL;
     FORMAT_QUERY(query, args, buf);
 
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     assert(cl != NULL);
     err = cl->call_seq.get(cl, buf, NOP_TRIGGER, data,
             &tid, &error_code);
@@ -241,11 +241,11 @@ errval_t oct_set(const char* query, ...)
     FORMAT_QUERY(query, args, buf);
 
     // Send to Server
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
 
     char* record = NULL;
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.set(cl, buf, SET_DEFAULT, NOP_TRIGGER, false,
             &record, &tid, &error_code);
     assert(record == NULL);
@@ -280,11 +280,11 @@ errval_t oct_mset(oct_mode_t mode, const char* query, ...)
     FORMAT_QUERY(query, args, buf);
 
     // Send to Server
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
 
     char* record = NULL;
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.set(cl, buf, mode, NOP_TRIGGER, false,
             &record, &tid, &error_code);
     assert(record == NULL);
@@ -326,9 +326,9 @@ errval_t oct_set_get(oct_mode_t mode, char** record, const char* query, ...)
     FORMAT_QUERY(query, args, buf);
 
     // Send to Server
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.set(cl, buf, mode, NOP_TRIGGER, true, record,
             &tid, &error_code);
     if (err_is_ok(err)) {
@@ -362,9 +362,9 @@ errval_t oct_del(const char* query, ...)
     char* buf = NULL;
     FORMAT_QUERY(query, args, buf);
 
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.del(cl, buf, NOP_TRIGGER, &tid, &error_code);
     if (err_is_ok(err)) {
         err = error_code;
@@ -394,9 +394,9 @@ errval_t oct_exists(const char* query, ...)
     char* buf = NULL;
     FORMAT_QUERY(query, args, buf);
 
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     err = cl->call_seq.exists(cl, buf, NOP_TRIGGER, &tid, &error_code);
     if (err_is_ok(err)) {
         err = error_code;
index cd0606b..c369740 100644 (file)
 #ifndef DIST2_HANDLER_H_
 #define DIST2_HANDLER_H_
 
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 #include <octopus/trigger.h>
 #include <octopus/pubsub.h>
 
-void trigger_handler(struct dist2_binding*, dist2_trigger_id_t,
-        uint64_t, dist2_mode_t, char*, uint64_t);
-void subscription_handler(struct dist2_binding*, subscription_t,
-        uint64_t, dist2_mode_t, char*, uint64_t);
+void trigger_handler(struct octopus_binding*, octopus_trigger_id_t,
+        uint64_t, octopus_mode_t, char*, uint64_t);
+void subscription_handler(struct octopus_binding*, subscription_t,
+        uint64_t, octopus_mode_t, char*, uint64_t);
 
 #endif /* DIST2_HANDLER_H_ */
index 7bb7613..ffee1f0 100644 (file)
@@ -53,9 +53,9 @@ errval_t oct_lock(const char* lock_name, char** lock_record)
     uint64_t mode = 0;
     uint64_t state = 0;
     uint64_t fn = 0;
-    dist2_trigger_id_t tid;
-    dist2_trigger_t t = oct_mktrigger(SYS_ERR_OK, DIST_ON_DEL,
-            dist2_BINDING_RPC, NULL, NULL);
+    octopus_trigger_id_t tid;
+    octopus_trigger_t t = oct_mktrigger(SYS_ERR_OK, DIST_ON_DEL,
+            octopus_BINDING_RPC, NULL, NULL);
 
     err = oct_set_get(SET_SEQUENTIAL, lock_record, "%s_ { lock: '%s' }",
             lock_name, lock_name);
@@ -90,7 +90,7 @@ errval_t oct_lock(const char* lock_name, char** lock_record)
         }
         else {
             // Someone else holds the lock
-            struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+            struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
             //debug_printf("exists for %s...\n", names[i-1]);
             err = cl->call_seq.exists(cl, names[i-1], t, &tid, &exist_err);
             if (err_is_fail(err)) {
index d73935a..c276396 100644 (file)
@@ -51,17 +51,17 @@ errval_t nameservice_blocking_lookup(const char *iface, iref_t *retiref)
     errval_t err;
     errval_t error_code;
     char* record = NULL;
-    dist2_mode_t mode;
+    octopus_mode_t mode;
     uint64_t state;
     uint64_t fn;
     uint64_t iref_number = 0;
 
-    struct dist2_thc_client_binding_t *cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t *cl = oct_get_thc_client();
     if (cl == NULL) {
         return LIB_ERR_NAMESERVICE_NOT_BOUND;
     }
 
-    dist2_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD, DIST_ON_SET, 0, 0);
+    octopus_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD, DIST_ON_SET, 0, 0);
     err = cl->call_seq.get(cl, iface, &record, t, &error_code);
     if (err_is_ok(err)) {
         err = error_code;
index 4ba54b9..eb2585e 100644 (file)
@@ -29,8 +29,8 @@
 #include "common.h"
 
 static struct oct_state {
-    struct dist2_binding* binding;
-    struct dist2_thc_client_binding_t thc_client;
+    struct octopus_binding* binding;
+    struct octopus_thc_client_binding_t thc_client;
     struct waitset ws;
     errval_t err;
     bool is_done;
@@ -40,24 +40,24 @@ static iref_t service_iref = 0;
 static uint64_t client_identifier = 0;
 static bool initialized = false;
 
-struct dist2_binding* oct_get_event_binding(void)
+struct octopus_binding* oct_get_event_binding(void)
 {
     assert(event.binding != NULL);
     return event.binding;
 }
 
-struct dist2_thc_client_binding_t* oct_get_thc_client(void)
+struct octopus_thc_client_binding_t* oct_get_thc_client(void)
 {
     //assert(rpc.rpc_client != NULL);
     return &rpc.thc_client;
 }
 
-static void identify_response_handler(struct dist2_binding* b)
+static void identify_response_handler(struct octopus_binding* b)
 {
     event.is_done = true;
 }
 
-static struct dist2_rx_vtbl rx_vtbl = {
+static struct octopus_rx_vtbl rx_vtbl = {
         .identify_response = identify_response_handler,
         .subscription = subscription_handler,
         .trigger = trigger_handler
@@ -67,12 +67,12 @@ static struct dist2_rx_vtbl rx_vtbl = {
 static int event_handler_thread(void* st)
 {
     errval_t err = SYS_ERR_OK;
-    struct dist2_binding* b = oct_get_event_binding();
+    struct octopus_binding* b = oct_get_event_binding();
 
     b->change_waitset(b, &event.ws);
 
     uint64_t id = (uint64_t) st;
-    err = b->tx_vtbl.identify_call(b, NOP_CONT, id, dist2_BINDING_EVENT);
+    err = b->tx_vtbl.identify_call(b, NOP_CONT, id, octopus_BINDING_EVENT);
     assert(err_is_ok(err));
 
     // TODO abort condition
@@ -87,7 +87,7 @@ static int event_handler_thread(void* st)
     return SYS_ERR_OK;
 }*/
 
-static void event_bind_cb(void *st, errval_t err, struct dist2_binding *b)
+static void event_bind_cb(void *st, errval_t err, struct octopus_binding *b)
 {
     if (err_is_fail(err)) {
         DEBUG_ERR(err, "oct_event bind failed");
@@ -113,13 +113,13 @@ static void get_name_iref_reply(struct monitor_binding *mb, iref_t iref,
 }
 
 static errval_t init_binding(struct oct_state* state,
-        dist2_bind_continuation_fn bind_fn)
+        octopus_bind_continuation_fn bind_fn)
 {
     errval_t err = SYS_ERR_OK;
     assert(service_iref != 0);
 
     state->is_done = false;
-    err = dist2_bind(service_iref, bind_fn, NULL, get_default_waitset(),
+    err = octopus_bind(service_iref, bind_fn, NULL, get_default_waitset(),
             IDC_BIND_FLAGS_DEFAULT);
     if (err_is_fail(err)) {
         return err_push(err, FLOUNDER_ERR_BIND);
@@ -175,27 +175,27 @@ errval_t oct_thc_init(void)
     assert(service_iref != 0);
     // XXX: Not sure but I think it would be better not to run the THC client
     // on the default waitset?
-    err = dist2_thc_connect(service_iref,
+    err = octopus_thc_connect(service_iref,
             get_default_waitset(), IDC_BIND_FLAGS_DEFAULT, &(rpc.binding));
     if (err_is_fail(err)) {
         return err;
     }
 
     assert(rpc.binding != NULL);
-    err = dist2_thc_init_client(&rpc.thc_client, rpc.binding, rpc.binding);
+    err = octopus_thc_init_client(&rpc.thc_client, rpc.binding, rpc.binding);
     if (err_is_fail(err)) {
         return err;
     }
 
     // TODO: Hack. Tell the server that these bindings belong together
-    dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    octopus_thc_client_binding_t* cl = oct_get_thc_client();
     err = cl->call_seq.get_identifier(cl, &client_identifier);
     if (err_is_fail(err)) {
         return err;
     }
 
     // Register rpc binding using identifier
-    err = cl->call_seq.identify(cl, client_identifier, dist2_BINDING_RPC);
+    err = cl->call_seq.identify(cl, client_identifier, octopus_BINDING_RPC);
 
     return err;
 }
@@ -231,7 +231,7 @@ errval_t oct_init(void)
     // Register event binding
     event.is_done = false;
     event.binding->tx_vtbl.identify_call(event.binding, NOP_CONT,
-            client_identifier, dist2_BINDING_EVENT);
+            client_identifier, octopus_BINDING_EVENT);
     while (!event.is_done) {
         messages_wait_and_handle_next();
     }
index cf04a00..b47f78b 100644 (file)
@@ -28,8 +28,8 @@
 #include "common.h"
 #include "handler.h"
 
-void subscription_handler(struct dist2_binding *b, subscription_t id,
-        uint64_t fn, dist2_mode_t mode, char *record,
+void subscription_handler(struct octopus_binding *b, subscription_t id,
+        uint64_t fn, octopus_mode_t mode, char *record,
         uint64_t st)
 {
     subscription_handler_fn handler_fn = (subscription_handler_fn) fn;
@@ -74,7 +74,7 @@ errval_t oct_subscribe(subscription_handler_fn function, const void *state,
     FORMAT_QUERY(query, args, buf);
 
     // send to skb
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
     err = cl->call_seq.subscribe(cl, buf, (uint64_t)function,
             (uint64_t)state, id, &error_code); // XXX: Sending Pointer as uint64
@@ -98,7 +98,7 @@ errval_t oct_subscribe(subscription_handler_fn function, const void *state,
 errval_t oct_unsubscribe(subscription_t id)
 {
     // send to skb
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
     errval_t err = cl->call_seq.unsubscribe(cl, id, &error_code);
     if (err_is_ok(err)) {
@@ -128,7 +128,7 @@ errval_t oct_publish(const char *record, ...)
     char *buf = NULL;
     FORMAT_QUERY(record, args, buf);
 
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     errval_t error_code;
     err = cl->call_seq.publish(cl, buf, &error_code);
     if(err_is_ok(err)) {
index 297a7a1..87aee0c 100644 (file)
@@ -87,10 +87,10 @@ errval_t oct_sem_wait(uint32_t id)
 {
     errval_t err = SYS_ERR_OK;
     char* result = NULL;
-    dist2_trigger_id_t tid;
-    dist2_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD,
-            dist2_BINDING_RPC, DIST_ON_SET, NULL, NULL);
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    octopus_trigger_id_t tid;
+    octopus_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD,
+            octopus_BINDING_RPC, DIST_ON_SET, NULL, NULL);
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
 
     char query[100];
     snprintf(query, 99, "r'sem\\.%d\\.[0-9]+' { sem: %d }", id, id);
index fa1d3dc..9854fba 100644 (file)
@@ -23,8 +23,8 @@
 #include "handler.h"
 #include "common.h"
 
-void trigger_handler(struct dist2_binding* b, dist2_trigger_id_t id,
-        uint64_t t, dist2_mode_t mode, char* record, uint64_t st)
+void trigger_handler(struct octopus_binding* b, octopus_trigger_id_t id,
+        uint64_t t, octopus_mode_t mode, char* record, uint64_t st)
 {
     assert(t != 0);
     trigger_handler_fn trigger_fn = (trigger_handler_fn) t;
@@ -40,10 +40,10 @@ void trigger_handler(struct dist2_binding* b, dist2_trigger_id_t id,
     }
 }
 
-dist2_trigger_t oct_mktrigger(errval_t in_case, dist2_binding_type_t send_to,
-        dist2_mode_t mode, trigger_handler_fn fn, void* state)
+octopus_trigger_t oct_mktrigger(errval_t in_case, octopus_binding_type_t send_to,
+        octopus_mode_t mode, trigger_handler_fn fn, void* state)
 {
-    return (dist2_trigger_t) {
+    return (octopus_trigger_t) {
                 .in_case = in_case,
                 .m = mode,
                 .send_to = send_to,
@@ -66,10 +66,10 @@ dist2_trigger_t oct_mktrigger(errval_t in_case, dist2_binding_type_t send_to,
  * \retval SYS_ERR_OK
  * \retval DIST2_INVALID_ID
  */
-errval_t oct_remove_trigger(dist2_trigger_id_t trigger_id)
+errval_t oct_remove_trigger(octopus_trigger_id_t trigger_id)
 {
     errval_t err = SYS_ERR_OK;
-    struct dist2_thc_client_binding_t* cl = oct_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     assert(cl != NULL);
 
     errval_t error_code;
index 33204a7..ad83b99 100644 (file)
@@ -1895,7 +1895,7 @@ yyreturn:
 void yyerror(char *s)
 {
 #ifdef DIST2_DEBUG
-    fprintf(stderr, "dist2_parser: %s\n", s);
+    fprintf(stderr, "octopus_parser: %s\n", s);
 #endif
 }
 
index 01f7b04..ed6e96b 100644 (file)
@@ -108,6 +108,6 @@ value:
 void yyerror(char *s)
 {
 #ifdef DIST2_DEBUG
-    fprintf(stderr, "dist2_parser: %s\n", s);
+    fprintf(stderr, "octopus_parser: %s\n", s);
 #endif
 }
index d0c1a3a..abefa23 100644 (file)
@@ -26,7 +26,7 @@
 #include <string.h>
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus_server/init.h>
 #include <octopus_server/service.h>
@@ -38,7 +38,7 @@
 
 static struct hashtable *capdb = NULL;
 
-static void get_cap_reply(struct dist2_binding *b,
+static void get_cap_reply(struct octopus_binding *b,
         struct oct_reply_state* ns)
 {
     errval_t err;
@@ -53,7 +53,7 @@ static void get_cap_reply(struct dist2_binding *b,
     }
 }
 
-void get_cap_handler(struct dist2_binding *b, char *key)
+void get_cap_handler(struct octopus_binding *b, char *key)
 {
     errval_t err, reterr = SYS_ERR_OK;
     struct capref cap;
@@ -74,7 +74,7 @@ void get_cap_handler(struct dist2_binding *b, char *key)
     free(key);
 }
 
-static void put_cap_reply(struct dist2_binding *b,
+static void put_cap_reply(struct octopus_binding *b,
         struct oct_reply_state* ns)
 {
     errval_t err;
@@ -89,7 +89,7 @@ static void put_cap_reply(struct dist2_binding *b,
     }
 }
 
-void put_cap_handler(struct dist2_binding *b, char *key,
+void put_cap_handler(struct octopus_binding *b, char *key,
                             struct capref cap)
 {
     errval_t err, reterr = SYS_ERR_OK;
@@ -114,7 +114,7 @@ void put_cap_handler(struct dist2_binding *b, char *key,
     free(key);
 }
 
-static void remove_cap_reply(struct dist2_binding *b,
+static void remove_cap_reply(struct octopus_binding *b,
         struct oct_reply_state* ns)
 {
     errval_t err;
@@ -129,7 +129,7 @@ static void remove_cap_reply(struct dist2_binding *b,
     }
 }
 
-void remove_cap_handler(struct dist2_binding *b, char *key)
+void remove_cap_handler(struct octopus_binding *b, char *key)
 {
     errval_t err, reterr = SYS_ERR_OK;
 
index bfa48ce..adc82ec 100644 (file)
 #include <barrelfish/barrelfish.h>
 #include <barrelfish/nameservice_client.h>
 
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 #include <if/monitor_defs.h>
 
 #include <octopus_server/init.h>
 #include <octopus_server/service.h>
 #include <octopus_server/debug.h>
 
-#define DIST2_RPC_SERVICE_NAME "dist2_rpc"
+#define DIST2_RPC_SERVICE_NAME "octopus_rpc"
 
 static struct export_state {
     bool is_done;
     errval_t err;
 } rpc_export;
 
-static const struct dist2_rx_vtbl rpc_rx_vtbl = {
+static const struct octopus_rx_vtbl rpc_rx_vtbl = {
         .get_names_call = get_names_handler,
         .get_call = get_handler,
         .set_call = set_handler,
@@ -68,7 +68,7 @@ static void rpc_export_cb(void *st, errval_t err, iref_t iref)
     }
 }
 
-static errval_t rpc_connect_cb(void *st, struct dist2_binding *b)
+static errval_t rpc_connect_cb(void *st, struct octopus_binding *b)
 {
     // Set up continuation queue
     b->st = NULL;
@@ -85,7 +85,7 @@ errval_t rpc_server_init(void)
     rpc_export.err = SYS_ERR_OK;
     rpc_export.is_done = false;
 
-    errval_t err = dist2_export(&rpc_export, rpc_export_cb, rpc_connect_cb,
+    errval_t err = octopus_export(&rpc_export, rpc_export_cb, rpc_connect_cb,
             get_default_waitset(), IDC_EXPORT_FLAGS_DEFAULT);
 
     if (err_is_fail(err)) {
index 54aa8b9..1aaf8b5 100644 (file)
@@ -17,7 +17,7 @@
 
 static void oct_rpc_send_next(void *arg)
 {
-    struct dist2_binding *b = arg;
+    struct octopus_binding *b = arg;
 
     struct oct_reply_state* current = oct_rpc_dequeue_reply(b);
 
@@ -27,7 +27,7 @@ static void oct_rpc_send_next(void *arg)
     }
 }
 
-void oct_rpc_enqueue_reply(struct dist2_binding *b,
+void oct_rpc_enqueue_reply(struct octopus_binding *b,
         struct oct_reply_state* st)
 {
     if (b->st == NULL) {
@@ -42,7 +42,7 @@ void oct_rpc_enqueue_reply(struct dist2_binding *b,
     *walk = st;
 }
 
-struct oct_reply_state* oct_rpc_dequeue_reply(struct dist2_binding *b)
+struct oct_reply_state* oct_rpc_dequeue_reply(struct octopus_binding *b)
 {
     struct oct_reply_state* head = b->st;
     b->st = head->next;
index a11a1f9..1cfcd35 100644 (file)
 #define DIST2_QUEUE_H
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus_server/service.h>
 
-void oct_rpc_enqueue_reply(struct dist2_binding *b,
+void oct_rpc_enqueue_reply(struct octopus_binding *b,
         struct oct_reply_state* st);
-struct oct_reply_state* oct_rpc_dequeue_reply(struct dist2_binding *b);
+struct oct_reply_state* oct_rpc_dequeue_reply(struct octopus_binding *b);
 
 #endif // DIST2_QUEUE_H
index 790e68f..f8d9aa1 100644 (file)
@@ -18,7 +18,7 @@
 #include <barrelfish/barrelfish.h>
 #include <barrelfish/nameservice_client.h>
 #include <skb/skb.h> // read list
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus_server/service.h>
 #include <octopus_server/query.h>
@@ -84,7 +84,7 @@ static void free_oct_reply_state(void* arg)
     }
 }
 
-static void trigger_send_handler(struct dist2_binding* b,
+static void trigger_send_handler(struct octopus_binding* b,
         struct oct_reply_state* drs)
 {
     char* record = drs->query_state.stdout.buffer[0] != '\0' ?
@@ -106,15 +106,15 @@ static void trigger_send_handler(struct dist2_binding* b,
     }
 }
 
-static inline bool can_install_trigger(dist2_trigger_t trigger, errval_t error)
+static inline bool can_install_trigger(octopus_trigger_t trigger, errval_t error)
 {
     return trigger.m > 0 &&
            (trigger.in_case == err_no(error) ||
            (trigger.m & DIST_ALWAYS_SET) != 0 );
 }
 
-static inline uint64_t install_trigger(struct dist2_binding* binding,
-        struct ast_object* ast, dist2_trigger_t trigger, errval_t error)
+static inline uint64_t install_trigger(struct octopus_binding* binding,
+        struct ast_object* ast, octopus_trigger_t trigger, errval_t error)
 {
     errval_t err;
     uint64_t watch_id = 0;
@@ -127,7 +127,7 @@ static inline uint64_t install_trigger(struct dist2_binding* binding,
         trigger_reply->client_handler = trigger.trigger;
         trigger_reply->client_state = trigger.st;
 
-        trigger_reply->binding = (trigger.send_to == dist2_BINDING_RPC) ?
+        trigger_reply->binding = (trigger.send_to == octopus_BINDING_RPC) ?
                 binding : get_event_binding(binding);
         if (trigger_reply->binding == NULL) {
             fprintf(stderr, "No event binding for trigger, send events "
@@ -142,7 +142,7 @@ static inline uint64_t install_trigger(struct dist2_binding* binding,
     return watch_id;
 }
 
-static void remove_trigger_reply(struct dist2_binding* b,
+static void remove_trigger_reply(struct octopus_binding* b,
         struct oct_reply_state* drs)
 {
     errval_t err;
@@ -158,7 +158,7 @@ static void remove_trigger_reply(struct dist2_binding* b,
     }
 }
 
-void remove_trigger_handler(struct dist2_binding *b, dist2_trigger_id_t tid)
+void remove_trigger_handler(struct octopus_binding *b, octopus_trigger_id_t tid)
 {
     struct oct_reply_state* drs = NULL;
     errval_t err = new_oct_reply_state(&drs, remove_trigger_reply);
@@ -181,7 +181,7 @@ void remove_trigger_handler(struct dist2_binding *b, dist2_trigger_id_t tid)
     }
 }*/
 
-static void get_reply(struct dist2_binding* b, struct oct_reply_state* drt)
+static void get_reply(struct octopus_binding* b, struct oct_reply_state* drt)
 {
     errval_t err;
     char* reply = err_is_ok(drt->error) ?
@@ -197,7 +197,7 @@ static void get_reply(struct dist2_binding* b, struct oct_reply_state* drt)
     }
 }
 
-void get_handler(struct dist2_binding *b, char *query, dist2_trigger_t trigger)
+void get_handler(struct octopus_binding *b, char *query, octopus_trigger_t trigger)
 {
     errval_t err = SYS_ERR_OK;
 
@@ -225,7 +225,7 @@ out:
     free(query);
 }
 
-static void get_names_reply(struct dist2_binding* b,
+static void get_names_reply(struct octopus_binding* b,
         struct oct_reply_state* drt)
 {
     errval_t err;
@@ -242,7 +242,7 @@ static void get_names_reply(struct dist2_binding* b,
     }
 }
 
-void get_names_handler(struct dist2_binding *b, char *query, dist2_trigger_t t)
+void get_names_handler(struct octopus_binding *b, char *query, octopus_trigger_t t)
 {
     DIST2_DEBUG(" get_names_handler: %s\n", query);
 
@@ -273,7 +273,7 @@ out:
     free(query);
 }
 
-static void set_reply(struct dist2_binding* b, struct oct_reply_state* drs)
+static void set_reply(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     char* record = err_is_ok(drs->error) && drs->return_record ?
             drs->query_state.stdout.buffer : NULL;
@@ -290,8 +290,8 @@ static void set_reply(struct dist2_binding* b, struct oct_reply_state* drs)
     }
 }
 
-void set_handler(struct dist2_binding *b, char *query, uint64_t mode,
-        dist2_trigger_t trigger, bool get)
+void set_handler(struct octopus_binding *b, char *query, uint64_t mode,
+        octopus_trigger_t trigger, bool get)
 {
     DIST2_DEBUG(" set_handler: %s\n", query);
     errval_t err = SYS_ERR_OK;
@@ -331,7 +331,7 @@ out:
     free(query);
 }
 
-static void del_reply(struct dist2_binding* b, struct oct_reply_state* drs)
+static void del_reply(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     errval_t err;
     err = b->tx_vtbl.del_response(b, MKCONT(free_oct_reply_state, drs),
@@ -345,7 +345,7 @@ static void del_reply(struct dist2_binding* b, struct oct_reply_state* drs)
     }
 }
 
-void del_handler(struct dist2_binding* b, char* query, dist2_trigger_t trigger)
+void del_handler(struct octopus_binding* b, char* query, octopus_trigger_t trigger)
 {
     DIST2_DEBUG(" del_handler: %s\n", query);
     errval_t err = SYS_ERR_OK;
@@ -383,7 +383,7 @@ out:
     free(query);
 }
 
-static void exists_reply(struct dist2_binding* b, struct oct_reply_state* drs)
+static void exists_reply(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     errval_t err;
     err = b->tx_vtbl.exists_response(b, MKCONT(free_oct_reply_state, drs),
@@ -398,8 +398,8 @@ static void exists_reply(struct dist2_binding* b, struct oct_reply_state* drs)
     }
 }
 
-void exists_handler(struct dist2_binding* b, char* query,
-        dist2_trigger_t trigger)
+void exists_handler(struct octopus_binding* b, char* query,
+        octopus_trigger_t trigger)
 {
     errval_t err = SYS_ERR_OK;
 
@@ -428,7 +428,7 @@ out:
     free(query);
 }
 
-static void wait_for_reply(struct dist2_binding* b, struct oct_reply_state* drs)
+static void wait_for_reply(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     errval_t err;
     err = b->tx_vtbl.wait_for_response(b, MKCONT(free_oct_reply_state, drs),
@@ -444,7 +444,7 @@ static void wait_for_reply(struct dist2_binding* b, struct oct_reply_state* drs)
 }
 
 // XXX: For compatibility reasons with nameserver API
-void wait_for_handler(struct dist2_binding* b, char* query) {
+void wait_for_handler(struct octopus_binding* b, char* query) {
     errval_t err = SYS_ERR_OK;
     errval_t set_watch_err = SYS_ERR_OK;
 
@@ -484,7 +484,7 @@ out:
     free(query);
 }
 
-static void subscribe_reply(struct dist2_binding* b,
+static void subscribe_reply(struct octopus_binding* b,
         struct oct_reply_state* drs)
 {
     errval_t err;
@@ -500,7 +500,7 @@ static void subscribe_reply(struct dist2_binding* b,
     }
 }
 
-void subscribe_handler(struct dist2_binding *b, char* query,
+void subscribe_handler(struct octopus_binding *b, char* query,
         uint64_t trigger_fn, uint64_t state)
 {
     DIST2_DEBUG("subscribe: query = %s\n", query);
@@ -530,7 +530,7 @@ out:
     free(query);
 }
 
-static void unsubscribe_reply(struct dist2_binding* b,
+static void unsubscribe_reply(struct octopus_binding* b,
         struct oct_reply_state* drs)
 {
     errval_t err;
@@ -545,7 +545,7 @@ static void unsubscribe_reply(struct dist2_binding* b,
     }
 }
 
-static void send_subscribed_message(struct dist2_binding* b, struct oct_reply_state* drs)
+static void send_subscribed_message(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     errval_t err = SYS_ERR_OK;
     char* record = drs->query_state.stdout.buffer[0] != '\0' ?
@@ -564,7 +564,7 @@ static void send_subscribed_message(struct dist2_binding* b, struct oct_reply_st
 
 }
 
-void unsubscribe_handler(struct dist2_binding *b, uint64_t id)
+void unsubscribe_handler(struct octopus_binding *b, uint64_t id)
 {
     errval_t err = SYS_ERR_OK;
 
@@ -590,7 +590,7 @@ void unsubscribe_handler(struct dist2_binding *b, uint64_t id)
                 send_subscribed_message);
         assert(err_is_ok(err));
 
-        subscriber->binding = (struct dist2_binding*)binding;
+        subscriber->binding = (struct octopus_binding*)binding;
         subscriber->client_handler = client_handler;
         subscriber->client_state = client_state;
         subscriber->server_id = server_id;
@@ -604,7 +604,7 @@ void unsubscribe_handler(struct dist2_binding *b, uint64_t id)
     srs->reply(b, srs);
 }
 
-static void publish_reply(struct dist2_binding* b, struct oct_reply_state* drs)
+static void publish_reply(struct octopus_binding* b, struct oct_reply_state* drs)
 {
     errval_t err;
     err = b->tx_vtbl.publish_response(b, MKCONT(free_oct_reply_state, drs),
@@ -618,7 +618,7 @@ static void publish_reply(struct dist2_binding* b, struct oct_reply_state* drs)
     }
 }
 
-void publish_handler(struct dist2_binding *b, char* record)
+void publish_handler(struct octopus_binding *b, char* record)
 {
     DIST2_DEBUG("publish_handler query: %s\n", record);
     errval_t err = SYS_ERR_OK;
@@ -669,7 +669,7 @@ void publish_handler(struct dist2_binding *b, char* record)
                         send_subscribed_message);
                 assert(err_is_ok(err));
 
-                subscriber->binding = (struct dist2_binding*)binding;
+                subscriber->binding = (struct octopus_binding*)binding;
                 subscriber->client_handler = client_handler;
                 strcpy(subscriber->query_state.stdout.buffer, record);
                 subscriber->client_state = client_state;
@@ -687,14 +687,14 @@ out:
     free_ast(ast);
 }
 
-void get_identifier(struct dist2_binding* b)
+void get_identifier(struct octopus_binding* b)
 {
     errval_t err = b->tx_vtbl.get_identifier_response(b, NOP_CONT,
             current_id++);
     assert(err_is_ok(err));
 }
 
-static void identify_binding_reply(struct dist2_binding* b,
+static void identify_binding_reply(struct octopus_binding* b,
         struct oct_reply_state* drs)
 {
     errval_t err;
@@ -710,8 +710,8 @@ static void identify_binding_reply(struct dist2_binding* b,
 
 }
 
-void identify_binding(struct dist2_binding* b, uint64_t id,
-        dist2_binding_type_t type)
+void identify_binding(struct octopus_binding* b, uint64_t id,
+        octopus_binding_type_t type)
 {
     assert(id <= current_id);
 
index a634f10..3a73ae9 100644 (file)
@@ -5,18 +5,18 @@
 
 errval_t trigger_existing_and_watch(const char* query,
         trigger_handler_fn event_handler, void* state,
-        dist2_trigger_id_t* tid)
+        octopus_trigger_id_t* tid)
 {
     errval_t error_code;
     char** names = NULL;
     char* output = NULL;
     char* record = NULL; // freed by cpu_change_event
     size_t len = 0;
-    dist2_trigger_t t = dist_mktrigger(0, dist2_BINDING_EVENT,
+    octopus_trigger_t t = dist_mktrigger(0, octopus_BINDING_EVENT,
             TRIGGER_ALWAYS, event_handler, state);
 
     // Get current cores registered in system
-    struct dist2_thc_client_binding_t* rpc = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* rpc = dist_get_thc_client();
     errval_t err = rpc->call_seq.get_names(rpc, query,
             t, &output, tid, &error_code);
     if (err_is_fail(err)) {
index 941ea41..69c57a4 100644 (file)
@@ -14,7 +14,7 @@ extern coreid_t my_core_id;
 extern uint32_t my_arch_id;
 
 errval_t trigger_existing_and_watch(const char*,
-        trigger_handler_fn, void*,  dist2_trigger_id_t*);
+        trigger_handler_fn, void*,  octopus_trigger_id_t*);
 
 
 #include "boot_modules.h"
index cf0164b..827b8b0 100644 (file)
@@ -120,7 +120,7 @@ static inline void configure_monitor_binding(void)
     mb->st = NULL;
 }
 
-static void cpu_change_event(dist2_mode_t mode, char* record, void* state)
+static void cpu_change_event(octopus_mode_t mode, char* record, void* state)
 {
     if (mode & DIST_ON_SET) {
         KALUGA_DEBUG("CPU found: %s\n", record);
@@ -176,7 +176,7 @@ errval_t watch_for_cores(void)
     static char* local_apics = "r'hw\\.apic\\.[0-9]+' { cpu_id: _, "
                                "                        enabled: 1, "
                                "                        id: _ }";
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     errval_t err = trigger_existing_and_watch(local_apics, cpu_change_event,
             &core_counter, &tid);
     cores_on_boot = core_counter;
@@ -202,7 +202,7 @@ errval_t watch_for_cores(void)
     return err;
 }
 
-static void ioapic_change_event(dist2_mode_t mode, char* record, void* state)
+static void ioapic_change_event(octopus_mode_t mode, char* record, void* state)
 {
     if (mode & DIST_ON_SET) {
         struct module_info* mi = find_module("ioapic");
@@ -251,7 +251,7 @@ errval_t watch_for_ioapic(void)
     static char* io_apics = "r'hw.ioapic.[0-9]+' { id: _, address: _, "
                             "irqbase: _ }";
 
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     return trigger_existing_and_watch(io_apics, ioapic_change_event,
             &core_counter, &tid);
 }
index a6ee448..a8e3e55 100644 (file)
@@ -24,9 +24,9 @@
 
 #include "kaluga.h"
 
-static void pci_change_event(dist2_mode_t mode, char* device_record, void* st);
+static void pci_change_event(octopus_mode_t mode, char* device_record, void* st);
 
-static void spawnd_up_event(dist2_mode_t mode, char* spawnd_record, void* st)
+static void spawnd_up_event(octopus_mode_t mode, char* spawnd_record, void* st)
 {
     assert(mode & DIST_ON_SET);
     uint64_t iref;
@@ -44,12 +44,12 @@ static void spawnd_up_event(dist2_mode_t mode, char* spawnd_record, void* st)
 static errval_t wait_for_spawnd(coreid_t core, void* state)
 {
     // Check if the core we're spawning on is already up...
-    struct dist2_thc_client_binding_t* cl = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = dist_get_thc_client();
     char* iref_record = NULL;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     errval_t error_code;
-    dist2_trigger_t t = dist_mktrigger(DIST2_ERR_NO_RECORD,
-            dist2_BINDING_EVENT, DIST_ON_SET, spawnd_up_event, state);
+    octopus_trigger_t t = dist_mktrigger(DIST2_ERR_NO_RECORD,
+            octopus_BINDING_EVENT, DIST_ON_SET, spawnd_up_event, state);
 
     // Construct service name
     static char* format = "spawn.%hhu { iref: _ }";
@@ -68,7 +68,7 @@ static errval_t wait_for_spawnd(coreid_t core, void* state)
     return error_code;
 }
 
-static void pci_change_event(dist2_mode_t mode, char* device_record, void* st)
+static void pci_change_event(octopus_mode_t mode, char* device_record, void* st)
 {
     errval_t err;
     if (mode & DIST_ON_SET) {
@@ -155,11 +155,11 @@ errval_t watch_for_pci_devices(void)
                                " bus: _, device: _, function: _, vendor: _,"
                                " device_id: _, class: _, subclass: _, "
                                " prog_if: _ }";
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     return trigger_existing_and_watch(pci_device, pci_change_event, NULL, &tid);
 }
 
-static void bridge_change_event(dist2_mode_t mode, char* bridge_record, void* st)
+static void bridge_change_event(octopus_mode_t mode, char* bridge_record, void* st)
 {
     if (mode & DIST_ON_SET) {
         // No need to ask the SKB as we always start pci for
@@ -201,7 +201,7 @@ errval_t watch_for_pci_root_bridge(void)
     static char* root_bridge = "r'hw\\.pci\\.rootbridge\\.[0-9]+' { "
                                " bus: _, device: _, function: _, maxbus: _,"
                                " acpi_node: _ }";
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     return trigger_existing_and_watch(root_bridge, bridge_change_event,
             NULL, &tid);
 }
index 74e9277..b522dee 100644 (file)
@@ -477,7 +477,7 @@ int p_bitfield_union(void) /* p_index_union(Storage, -[Attributes], -Current, +N
     return PFAIL;
 }
 
-void dist_rpc_enqueue_reply(struct dist2_binding *b, struct dist_reply_state* st);
+void dist_rpc_enqueue_reply(struct octopus_binding *b, struct dist_reply_state* st);
 extern struct bitfield* trigger_ids;
 
 int p_trigger_watch(void) /* p_trigger_watch(+String, +Mode, +Recipient, +WatchId, -Retract) */
index 2b3b9f5..dbf300e 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Implementation of the interface as described in <dist2_server/query.h>.
+ * \brief Implementation of the interface as described in <octopus_server/query.h>.
  */
 
 /*
@@ -19,7 +19,7 @@
 #include <barrelfish/barrelfish.h>
 #include <include/skb_debug.h>
 
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <include/skb_server.h>
 
@@ -313,7 +313,7 @@ static void store_template(struct dist_reply_state* drs,
 
 }
 
-errval_t set_watch(struct dist2_binding* b, struct ast_object* ast,
+errval_t set_watch(struct octopus_binding* b, struct ast_object* ast,
         uint64_t mode, struct dist_reply_state* drs, uint64_t* wid)
 {
     errval_t err = init_bitmap(&trigger_ids);
@@ -354,7 +354,7 @@ errval_t set_watch(struct dist2_binding* b, struct ast_object* ast,
     return err;
 }
 
-errval_t del_watch(struct dist2_binding* b, dist2_trigger_id_t id,
+errval_t del_watch(struct octopus_binding* b, octopus_trigger_id_t id,
         struct dist_query_state* dqs)
 {
     dident remove_watch = ec_did("remove_watch", 2);
@@ -374,7 +374,7 @@ errval_t del_watch(struct dist2_binding* b, dist2_trigger_id_t id,
     return err;
 }
 
-struct dist2_binding* get_event_binding(struct dist2_binding* b)
+struct octopus_binding* get_event_binding(struct octopus_binding* b)
 {
     errval_t err = SYS_ERR_OK;
     struct dist_query_state* dqs = calloc(1, sizeof(struct dist_query_state));
@@ -407,7 +407,7 @@ struct dist2_binding* get_event_binding(struct dist2_binding* b)
     DIST2_DEBUG("get_event_binding\n");
     debug_skb_output(dqs);
 
-    struct dist2_binding* recipient = NULL;
+    struct octopus_binding* recipient = NULL;
     // TODO pointer size vs. long int in skb :-(
     sscanf(dqs->stdout.buffer, "%lu", (uintptr_t*) &recipient);
 
@@ -415,7 +415,7 @@ struct dist2_binding* get_event_binding(struct dist2_binding* b)
     return recipient;
 }
 
-errval_t add_subscription(struct dist2_binding* b, struct ast_object* ast,
+errval_t add_subscription(struct octopus_binding* b, struct ast_object* ast,
         uint64_t trigger_fn, uint64_t state, struct dist_reply_state* drs)
 {
     errval_t err = init_bitmap(&subscriber_ids);
@@ -456,7 +456,7 @@ errval_t add_subscription(struct dist2_binding* b, struct ast_object* ast,
     return err;
 }
 
-errval_t del_subscription(struct dist2_binding* b, uint64_t id,
+errval_t del_subscription(struct octopus_binding* b, uint64_t id,
         struct dist_query_state* sqs)
 {
     errval_t err = SYS_ERR_OK;
@@ -519,7 +519,7 @@ errval_t find_subscribers(struct ast_object* ast, struct dist_query_state* sqs)
     return err;
 }
 
-errval_t set_binding(dist2_binding_type_t type, uint64_t id, void* binding)
+errval_t set_binding(octopus_binding_type_t type, uint64_t id, void* binding)
 {
     struct dist_query_state* dqs = malloc(sizeof(struct dist_query_state));
     if (dqs == NULL) {
@@ -528,11 +528,11 @@ errval_t set_binding(dist2_binding_type_t type, uint64_t id, void* binding)
 
     dident set_binding;
     switch (type) {
-    case dist2_BINDING_RPC:
+    case octopus_BINDING_RPC:
         set_binding = ec_did("set_rpc_binding", 2);
         break;
 
-    case dist2_BINDING_EVENT:
+    case octopus_BINDING_EVENT:
         set_binding = ec_did("set_event_binding", 2);
         break;
 
index f45f6d6..e080c2a 100644 (file)
@@ -55,7 +55,7 @@ static void variable_records(void)
         errval_t error_code;
         char* data = NULL;
 
-        struct dist2_rpc_client* cl = dist_get_thc_client();
+        struct octopus_rpc_client* cl = dist_get_thc_client();
         assert(cl != NULL);
 
         for (size_t k = 0; k < MAX_ITERATIONS; k++) {
@@ -87,7 +87,7 @@ static void variable_records(void)
 
 static void add_record(void) {
     size_t exps = sizeof(add_records) / sizeof(size_t);
-    struct dist2_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = dist_get_thc_client();
     assert(cl != NULL);
 
     errval_t error_code;
@@ -144,7 +144,7 @@ static void one_record(void)
     errval_t error_code;
     char* data = NULL;
 
-    struct dist2_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = dist_get_thc_client();
 
     for (size_t i = 0; i < MAX_ITERATIONS; i++) {
 
@@ -169,7 +169,7 @@ static void unnamed_record(void)
     errval_t err = dist_set("object0 { attr1: 'bla', attr2: 12.0 }");
     assert(err_is_ok(err));
 
-    struct dist2_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = dist_get_thc_client();
     assert(cl != NULL);
 
     char* data = NULL;
index 00d9f3b..ca1d528 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char** argv)
 
     char payload[256] = { [0 ... 254] = 'a', [255] = '\0' };
 
-    struct dist2_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = dist_get_thc_client();
     assert(cl != NULL);
 
     char record[300];
index 543d7c5..76bfc1d 100644 (file)
@@ -139,7 +139,7 @@ static void no_name_get_worstcase(void)
     for (size_t i = 1; i < exps; i++) {
         printf("# Run no_name_get_worstcase with %lu records:\n", records[i]);
 
-        struct dist2_rpc_client* cl = dist_get_thc_client();
+        struct octopus_rpc_client* cl = dist_get_thc_client();
         assert(cl != NULL);
         errval_t error_code;
         char* record;
index c792559..bc9cfeb 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "common.h"
 
-static void trigger_handler(dist2_mode_t m, char* record, void* state)
+static void trigger_handler(octopus_mode_t m, char* record, void* state)
 {
     size_t* received = (size_t*) state;
     *received = *received + 1;
@@ -36,7 +36,7 @@ static void trigger_handler(dist2_mode_t m, char* record, void* state)
     free(record);
 }
 
-static void persistent_trigger(dist2_mode_t m, char* record, void* state) {
+static void persistent_trigger(octopus_mode_t m, char* record, void* state) {
     size_t* received = (size_t*) state;
     *received = *received + 1;
 
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
 {
     dist_init();
     errval_t err = SYS_ERR_OK;
-    dist2_trigger_id_t tid;
+    octopus_trigger_id_t tid;
     size_t received = 0;
 
     err = dist_set("obj1 { attr: 1 }");
@@ -68,10 +68,10 @@ int main(int argc, char *argv[])
     err = dist_set("obj3 { attr: 3 }");
     ASSERT_ERR_OK(err);
 
-    struct dist2_thc_client_binding_t* c = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* c = dist_get_thc_client();
 
-    dist2_trigger_t record_deleted = dist_mktrigger(SYS_ERR_OK,
-            dist2_BINDING_EVENT, DIST_ON_DEL, trigger_handler, &received);
+    octopus_trigger_t record_deleted = dist_mktrigger(SYS_ERR_OK,
+            octopus_BINDING_EVENT, DIST_ON_DEL, trigger_handler, &received);
 
     errval_t error_code = SYS_ERR_OK;
     char* output = NULL;
@@ -90,9 +90,9 @@ int main(int argc, char *argv[])
 
     received = 0;
     tid = 0;
-    dist2_mode_t m = DIST_ON_SET | DIST_ON_DEL | DIST_PERSIST;
-    dist2_trigger_t ptrigger = dist_mktrigger(SYS_ERR_OK,
-            dist2_BINDING_EVENT, m, persistent_trigger, &received);
+    octopus_mode_t m = DIST_ON_SET | DIST_ON_DEL | DIST_PERSIST;
+    octopus_trigger_t ptrigger = dist_mktrigger(SYS_ERR_OK,
+            octopus_BINDING_EVENT, m, persistent_trigger, &received);
     output = NULL;
     err = c->call_seq.get(c, "obj2", ptrigger, &output,
             &tid, &error_code);
index cd3cb88..251d648 100644 (file)
 //#include <octopus/getset.h>
 
 #include <thc/thc.h>
-#include <if/dist2_defs.h>
-#include <if/dist2_thc.h>
+#include <if/octopus_defs.h>
+#include <if/octopus_thc.h>
 
 
 
 static int th(void* st)
 {
-    struct dist2_thc_client_binding_t cl;
-    struct dist2_binding* b = NULL;
+    struct octopus_thc_client_binding_t cl;
+    struct octopus_binding* b = NULL;
 
 
     printf("running event loop?\n");
     errval_t err;
     assert(get_default_waitset() != NULL);
-    err = dist2_thc_connect_by_name("dist2_rpc",
+    err = octopus_thc_connect_by_name("octopus_rpc",
                                    get_default_waitset(),
                                    IDC_BIND_FLAGS_DEFAULT,
                                    &b);
@@ -48,18 +48,18 @@ static int th(void* st)
         DEBUG_ERR(err, "connect failed!");
         abort();
     }
-    printf("dist2_thc_connect_by_name done...\n");
+    printf("octopus_thc_connect_by_name done...\n");
 
 
-    err = dist2_thc_init_client(&cl, b, b);
+    err = octopus_thc_init_client(&cl, b, b);
     if (err_is_fail(err)) {
         DEBUG_ERR(err, "init failed");
         abort();
     }
-    printf("dist2_thc_init_client done...\n");
+    printf("octopus_thc_init_client done...\n");
 
 
-    //struct dist2_thc_client_binding_t* cl = (struct dist2_thc_client_binding_t*)st;
+    //struct octopus_thc_client_binding_t* cl = (struct octopus_thc_client_binding_t*)st;
     debug_printf("before do finish\n");
 
     DO_FINISH({
@@ -67,13 +67,13 @@ static int th(void* st)
 
         bool stop = false;
         while (!stop) {
-            dist2_client_msg_t m;
+            octopus_client_msg_t m;
             debug_printf("before recv any\n");
-            cl.recv_any(&cl, &m, (struct dist2_client_selector) { .trigger=1 });
+            cl.recv_any(&cl, &m, (struct octopus_client_selector) { .trigger=1 });
             debug_printf("after recv any\n");
 
             switch (m.msg) {
-            case dist2_trigger:
+            case octopus_trigger:
                 //ASYNC({trigger_handler(m.args.trigger.mode, m.args.trigger.record, m.args.trigger.error_code);});
                 break;