More renaming
authorGerd Zellweger <zgerd@student.ethz.ch>
Fri, 16 Mar 2012 22:03:45 +0000 (23:03 +0100)
committerGerd Zellweger <zgerd@student.ethz.ch>
Fri, 16 Mar 2012 22:03:45 +0000 (23:03 +0100)
--HG--
branch : octopus.renaming

44 files changed:
include/barrelfish/core_state.h
include/barrelfish/domain.h
include/octopus/init.h
include/octopus/pubsub.h
include/octopus/trigger.h
include/octopus_server/debug.h
include/octopus_server/init.h
include/octopus_server/query.h
include/octopus_server/service.h
lib/barrelfish/nameservice_client.c
lib/octopus/parser/parse.y
usr/acpi/Hakefile
usr/acpi/acpi.c
usr/acpi/acpi_main.c
usr/acpi/apic.c
usr/ioapic/Hakefile
usr/ioapic/interrupts.c
usr/ioapic/ioapic_main.c
usr/kaluga/Hakefile
usr/kaluga/common.c
usr/kaluga/main.c
usr/kaluga/start_cpu.c
usr/kaluga/start_pci.c
usr/pci/Hakefile
usr/pci/pci.c
usr/pci/pcimain.c
usr/skb/Hakefile
usr/skb/dist/predicates.c
usr/skb/dist/skb_query.c
usr/skb/skb_main.c
usr/tests/dist2test/Hakefile
usr/tests/dist2test/d2barrier.c
usr/tests/dist2test/d2bench.c
usr/tests/dist2test/d2bench1.c
usr/tests/dist2test/d2bench2.c
usr/tests/dist2test/d2bench3.c
usr/tests/dist2test/d2getset.c
usr/tests/dist2test/d2locksimple.c
usr/tests/dist2test/d2pubsub.c
usr/tests/dist2test/d2read.c
usr/tests/dist2test/d2sem.c
usr/tests/dist2test/d2trigger.c
usr/tests/semaphores/Hakefile
usr/tests/shm/Hakefile

index 52ae601..ca3c234 100644 (file)
@@ -81,7 +81,7 @@ struct slot_alloc_state {
 };
 
 struct terminal_state;
-struct dist2_rpc_client;
+struct octopus_rpc_client;
 struct domain_state;
 struct spawn_state;
 struct monitor_binding;
@@ -95,7 +95,7 @@ struct core_state_generic {
     struct mem_rpc_client *mem_st;
     struct morecore_state morecore_state;
     struct ram_alloc_state ram_alloc_state;
-    struct dist2_rpc_client *nameservice_rpc_client;
+    struct octopus_rpc_client *nameservice_rpc_client;
     struct spawn_rpc_client *spawn_rpc_clients[MAX_CPUS];
     struct terminal_state *terminal_state;
     struct domain_state *domain_state;
index 20772ea..87a3bf4 100644 (file)
@@ -18,7 +18,7 @@
 typedef void (*domain_spanned_callback_t)(void *arg, errval_t err);
 
 struct mem_rpc_client;
-struct dist2_rpc_client;
+struct octopus_rpc_client;
 struct monitor_binding;
 struct monitor_blocking_rpc_client;
 struct waitset;
@@ -40,8 +40,8 @@ struct vspace *get_current_vspace(void);
 struct pmap *get_current_pmap(void);
 struct morecore_state *get_morecore_state(void);
 struct ram_alloc_state *get_ram_alloc_state(void);
-void set_nameservice_rpc_client(struct dist2_rpc_client *st);
-struct dist2_rpc_client *get_nameservice_rpc_client(void);
+void set_nameservice_rpc_client(struct octopus_rpc_client *st);
+struct octopus_rpc_client *get_nameservice_rpc_client(void);
 void set_spawn_rpc_client(coreid_t core, struct spawn_rpc_client *st);
 struct spawn_rpc_client *get_spawn_rpc_client(coreid_t core);
 struct terminal_state *get_terminal_state(void);
index 516f104..88e9dfc 100644 (file)
@@ -16,8 +16,8 @@
 #define DIST2_INIT_H_
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
-#include <if/dist2_thc.h>
+#include <if/octopus_defs.h>
+#include <if/octopus_thc.h>
 
 STATIC_ASSERT(sizeof(uintptr_t) <= sizeof(uint64_t),
         "Sending pointers might fail :-(.");
@@ -25,7 +25,7 @@ STATIC_ASSERT(sizeof(uintptr_t) <= sizeof(uint64_t),
 errval_t oct_init(void);
 errval_t oct_thc_init(void);
 
-struct dist2_thc_client_binding_t* oct_get_thc_client(void);
-struct dist2_binding* oct_get_event_binding(void);
+struct octopus_thc_client_binding_t* oct_get_thc_client(void);
+struct octopus_binding* oct_get_event_binding(void);
 
 #endif /* DIST2_INIT_H_ */
index 8be700d..f43a78b 100644 (file)
 #define DIST2_PUBSUB_H_
 
 #include <stdint.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus/trigger.h>
 
-typedef dist2_trigger_id_t subscription_t;
+typedef octopus_trigger_id_t subscription_t;
 typedef trigger_handler_fn subscription_handler_fn;
 
 errval_t oct_subscribe(subscription_handler_fn, const void*, subscription_t*,
index 5f87ff2..75f5205 100644 (file)
 #define DIST2_TRIGGER_H_
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus/definitions.h>
 
-#define NOP_TRIGGER     (dist2_trigger_t){ .in_case = 0, .m = 0, .trigger = 0, .st = 0 }
+#define NOP_TRIGGER     (octopus_trigger_t){ .in_case = 0, .m = 0, .trigger = 0, .st = 0 }
 
-typedef void(*trigger_handler_fn)(dist2_mode_t mode, char* record, void* state);
-dist2_trigger_t oct_mktrigger(errval_t, dist2_binding_type_t, dist2_mode_t,
+typedef void(*trigger_handler_fn)(octopus_mode_t mode, char* record, void* state);
+octopus_trigger_t oct_mktrigger(errval_t, octopus_binding_type_t, octopus_mode_t,
         trigger_handler_fn, void*);
-errval_t oct_remove_trigger(dist2_trigger_id_t);
+errval_t oct_remove_trigger(octopus_trigger_id_t);
 
 #endif /* DIST2_TRIGGER_H_ */
index 2d369f4..6a73ac0 100644 (file)
@@ -18,7 +18,7 @@
 //#define DIST_SERVICE_DEBUG 1
 
 #if defined(DIST_SERVICE_DEBUG) || defined(GLOBAL_DEBUG)
-#define DIST2_DEBUG(x...) debug_printf("dist2_service: " x)
+#define DIST2_DEBUG(x...) debug_printf("octopus_service: " x)
 #else
 #define DIST2_DEBUG(x...) ((void)0)
 #endif
index 6e7447c..e90643e 100644 (file)
@@ -21,6 +21,6 @@ errval_t init_capstorage(void);
 
 errval_t rpc_server_init(void);
 
-errval_t dist_server_init(void);
+errval_t oct_server_init(void);
 
 #endif /* DIST2_INIT_H_ */
index b494867..ada2be4 100644 (file)
@@ -19,7 +19,7 @@
 #define DIST2_QUERY_H_
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 
 #include <octopus_server/service.h>
 #include <octopus/parser/ast.h>
  * \retval DIST2_ERR_ENGINE_FAIL
  * \retval LIB_ERR_MALLOC_FAIL
  */
-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);
 
 /**
  * Given a query returns a number of record names matching
  * the query. The record names are stored as a comma separated string
- * in dist_query_state.
+ * in oct_query_state.
  *
  * \param ast Abstract Syntax Tree of query.
  * \param dqs Contains the result of the query invocation.
@@ -54,7 +54,7 @@ errval_t set_binding(dist2_binding_type_t type, uint64_t id, void* binding);
  * \retval DIST2_ERR_NO_RECORD
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t get_record_names(struct ast_object* ast, struct dist_query_state* dqs);
+errval_t get_record_names(struct ast_object* ast, struct oct_query_state* dqs);
 
 /**
  * \brief Returns a record matching the given query.
@@ -66,7 +66,7 @@ errval_t get_record_names(struct ast_object* ast, struct dist_query_state* dqs);
  * \retval DIST2_ERR_NO_RECORD
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t get_record(struct ast_object* ast, struct dist_query_state* dqs);
+errval_t get_record(struct ast_object* ast, struct oct_query_state* dqs);
 
 /**
  * \brief Stores a record in the database.
@@ -79,7 +79,7 @@ errval_t get_record(struct ast_object* ast, struct dist_query_state* dqs);
  * \retval DIST2_ERR_ENGINE_FAIL
  */
 errval_t set_record(struct ast_object* ast, uint64_t mode,
-        struct dist_query_state* dqs);
+        struct oct_query_state* dqs);
 
 /**
  * \brief Deletes a record in the database.
@@ -91,7 +91,7 @@ errval_t set_record(struct ast_object* ast, uint64_t mode,
  * \retval DIST2_ERR_NO_RECORD
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t del_record(struct ast_object*, struct dist_query_state*);
+errval_t del_record(struct ast_object*, struct oct_query_state*);
 
 /**
  * Sets a watch for a record(s) matching the given query. The Query Engine
@@ -107,8 +107,8 @@ errval_t del_record(struct ast_object*, struct dist_query_state*);
  * \retval SYS_ERR_OK
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t set_watch(struct dist2_binding* b, struct ast_object* ast,
-        uint64_t mode, struct dist_reply_state* drs, uint64_t* wid);
+errval_t set_watch(struct octopus_binding* b, struct ast_object* ast,
+        uint64_t mode, struct oct_reply_state* drs, uint64_t* wid);
 
 /**
  * \brief Removes a watch
@@ -121,8 +121,8 @@ errval_t set_watch(struct dist2_binding* b, struct ast_object* ast,
  * \retval DIST2_ERR_INVALID_ID
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t del_watch(struct dist2_binding* b, dist2_trigger_id_t id,
-        struct dist_query_state* dqs);
+errval_t del_watch(struct octopus_binding* b, octopus_trigger_id_t id,
+        struct oct_query_state* dqs);
 
 /**
  * \brief Adds a subscription.
@@ -138,8 +138,8 @@ errval_t del_watch(struct dist2_binding* b, dist2_trigger_id_t id,
  * \retval DIST2_ERR_ENGINE_FAIL
  * \retval LIB_ERR_MALLOC_FAIL
  */
-errval_t add_subscription(struct dist2_binding* b, struct ast_object* ast,
-        uint64_t trigger_fn, uint64_t state, struct dist_reply_state* drs);
+errval_t add_subscription(struct octopus_binding* b, struct ast_object* ast,
+        uint64_t trigger_fn, uint64_t state, struct oct_reply_state* drs);
 
 /**
  * \brief Deletes a subscription for a given (Binding, Id) pair.
@@ -152,8 +152,8 @@ errval_t add_subscription(struct dist2_binding* b, struct ast_object* ast,
  * \retval DIST2_ERR_NO_SUBSCRIPTION
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t del_subscription(struct dist2_binding* b, uint64_t id,
-        struct dist_query_state* dqs);
+errval_t del_subscription(struct octopus_binding* b, uint64_t id,
+        struct oct_query_state* dqs);
 
 /**
  * Find all subscribers with a matching subscription for the given
@@ -166,7 +166,7 @@ errval_t del_subscription(struct dist2_binding* b, uint64_t id,
  * \retval DIST2_ERR_NO_SUBSCRIBERS
  * \retval DIST2_ERR_ENGINE_FAIL
  */
-errval_t find_subscribers(struct ast_object* ast, struct dist_query_state* dqs);
+errval_t find_subscribers(struct ast_object* ast, struct oct_query_state* dqs);
 
 /**
  * \brief Find the event binding of the client based on his RPC binding.
@@ -174,6 +174,6 @@ errval_t find_subscribers(struct ast_object* ast, struct dist_query_state* dqs);
  * \param binding RPC binding
  * \return Pointer of event binding or NULL on error.
  */
-struct dist2_binding* get_event_binding(struct dist2_binding* binding);
+struct octopus_binding* get_event_binding(struct octopus_binding* binding);
 
 #endif /* DIST2_QUERY_H_ */
index 1f37676..e058b46 100644 (file)
 #define DIST2_SERVICE_H_
 
 #include <barrelfish/barrelfish.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
 #include <octopus/definitions.h>
 
-struct dist_reply_state;
+struct oct_reply_state;
 
 struct skb_writer {
     char buffer[MAX_QUERY_LENGTH]; // TODO can be bigger than max query length...
     size_t length;
 };
 
-struct dist_query_state {
+struct oct_query_state {
     struct skb_writer stdout;
     struct skb_writer stderr;
     int exec_res;
 };
 
-typedef void(*dist_reply_handler_fn)(struct dist2_binding*, struct dist_reply_state*);
+typedef void(*oct_reply_handler_fn)(struct octopus_binding*, struct oct_reply_state*);
 
-struct dist_reply_state {
-    struct dist2_binding* binding;
-    dist_reply_handler_fn reply;
+struct oct_reply_state {
+    struct octopus_binding* binding;
+    oct_reply_handler_fn reply;
 
-    struct dist_query_state query_state;
+    struct oct_query_state query_state;
     bool return_record;
     errval_t error;
 
     // Pubsub / Trigger state
     uint64_t client_handler;
     uint64_t client_state;
-    dist2_mode_t mode;
-    dist2_trigger_id_t server_id;
+    octopus_mode_t mode;
+    octopus_trigger_id_t server_id;
 
     // For capability storage
     struct capref cap;
 
-    struct dist_reply_state *next;
+    struct oct_reply_state *next;
 };
 
-errval_t new_dist_reply_state(struct dist_reply_state**, dist_reply_handler_fn);
+errval_t new_oct_reply_state(struct oct_reply_state**, oct_reply_handler_fn);
 
-void get_names_handler(struct dist2_binding*, char*, dist2_trigger_t);
-void get_handler(struct dist2_binding*, char*, dist2_trigger_t);
-void set_handler(struct dist2_binding*, char*, uint64_t, dist2_trigger_t, bool);
-void del_handler(struct dist2_binding*, char*, dist2_trigger_t);
-void exists_handler(struct dist2_binding*, char*, dist2_trigger_t);
-void wait_for_handler(struct dist2_binding*, char*);
-void remove_trigger_handler(struct dist2_binding*, dist2_trigger_id_t);
+void get_names_handler(struct octopus_binding*, char*, octopus_trigger_t);
+void get_handler(struct octopus_binding*, char*, octopus_trigger_t);
+void set_handler(struct octopus_binding*, char*, uint64_t, octopus_trigger_t, bool);
+void del_handler(struct octopus_binding*, char*, octopus_trigger_t);
+void exists_handler(struct octopus_binding*, char*, octopus_trigger_t);
+void wait_for_handler(struct octopus_binding*, char*);
+void remove_trigger_handler(struct octopus_binding*, octopus_trigger_id_t);
 
-void subscribe_handler(struct dist2_binding*, char*, uint64_t, uint64_t);
-void publish_handler(struct dist2_binding*, char*);
-void unsubscribe_handler(struct dist2_binding*, uint64_t);
+void subscribe_handler(struct octopus_binding*, char*, uint64_t, uint64_t);
+void publish_handler(struct octopus_binding*, char*);
+void unsubscribe_handler(struct octopus_binding*, uint64_t);
 
-void get_identifier(struct dist2_binding*);
-void identify_binding(struct dist2_binding*, uint64_t, dist2_binding_type_t);
+void get_identifier(struct octopus_binding*);
+void identify_binding(struct octopus_binding*, uint64_t, octopus_binding_type_t);
 
 // Capability Storage
-void get_cap_handler(struct dist2_binding*, char*);
-void put_cap_handler(struct dist2_binding*, char*, struct capref);
-void remove_cap_handler(struct dist2_binding*, char*);
+void get_cap_handler(struct octopus_binding*, char*);
+void put_cap_handler(struct octopus_binding*, char*, struct capref);
+void remove_cap_handler(struct octopus_binding*, char*);
 
 #endif /* DIST2_SERVICE_H_ */
index e0b5011..d2a92c9 100644 (file)
@@ -19,7 +19,7 @@
 #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/getset.h> // for oct_read TODO
 #include <octopus/trigger.h> // for NOP_TRIGGER
 
 /**
@@ -53,7 +53,7 @@ errval_t nameservice_lookup(const char *iface, iref_t *retiref)
     }
 
     uint64_t iref_number = 0;
-    err = dist_read(record, "_ { iref: %d }", &iref_number);
+    err = oct_read(record, "_ { iref: %d }", &iref_number);
     if (err_is_fail(err) || iref_number == 0) {
         err = err_push(err, LIB_ERR_NAMESERVICE_INVALID_NAME);
         goto out;
@@ -97,7 +97,7 @@ errval_t nameservice_blocking_lookup(const char *iface, iref_t *retiref)
     }
 
     uint64_t iref_number = 0;
-    err = dist_read(record, "_ { iref: %d }", &iref_number);
+    err = oct_read(record, "_ { iref: %d }", &iref_number);
     if (err_is_fail(err)) {
         err = err_push(err, LIB_ERR_NAMESERVICE_INVALID_NAME);
         goto out;
index ed6e96b..1345143 100644 (file)
@@ -4,9 +4,9 @@
 #include <assert.h>
 
 #ifdef TEST_PARSER
-#include "../../../include/dist2/parser/ast.h"
+#include "../../../include/octopus/parser/ast.h"
 #else
-#include <dist2/parser/ast.h>
+#include <octopus/parser/ast.h>
 #endif
 
 #include "y.tab.h"
@@ -14,7 +14,7 @@
 void yyerror(char *);
 
 #define YYPARSE_PARAM data
-#define YYLEX_PARAM   ((struct dist_parser_state*)data)->scanner
+#define YYLEX_PARAM   ((struct oct_parser_state*)data)->scanner
 
 %}
 
@@ -65,7 +65,7 @@ void yyerror(char *);
 
 %%
 program:
-      record                         { ((struct dist_parser_state*) data)->ast = $1; YYACCEPT;  }
+      record                         { ((struct oct_parser_state*) data)->ast = $1; YYACCEPT;  }
     
 record: 
       name END_OF_INPUT              { $$ = ast_object($1, NULL); }
index 37cd4c7..35b217f 100644 (file)
@@ -22,6 +22,6 @@
                        addIncludes = [ "acpica/include" ],
                        addCFlags = [ "-Wno-redundant-decls" ],
                        addLibraries = [ "mm", "acpica", "skb", "pciconfspace", 
-                                        "dist2", "dist_parser", "thc" ],
+                                        "octopus", "octopus_parser", "thc" ],
                        architectures = [ "x86_64", "x86_32" ] }
 ]
index 1e0ab88..f3f1f44 100644 (file)
@@ -552,10 +552,10 @@ static ACPI_STATUS add_pci_device(ACPI_HANDLE handle, UINT32 level,
            resources.minbus, resources.maxbus, resources.minmem,
            resources.maxmem);
 
-    // dist2 record for rootbridge
+    // octopus record for rootbridge
     ACPI_DEBUG("acpi_node: %s\n", namebuf);
     static char* format = "hw.pci.rootbridge. { bus: %lu, device: %lu, function: %lu, maxbus: %lu, acpi_node: '%s' }";
-    errval_t err = dist_mset(SET_SEQUENTIAL, format,
+    errval_t err = oct_mset(SET_SEQUENTIAL, format,
             bridgeaddr.bus, bridgeaddr.device, bridgeaddr.function,
             resources.maxbus, namebuf);
     assert(err_is_ok(err));
@@ -604,7 +604,7 @@ static int acpi_init(void)
     // Signal device manager that we have added records for everything
     // available to us at boot time.
     char* record = NULL;
-    err = dist_barrier_enter("barrier.acpi", &record, 2);
+    err = oct_barrier_enter("barrier.acpi", &record, 2);
     if (err_is_fail(err)) {
         USER_PANIC_ERR(err, "Could not enter barrier.");
     }
index af62049..346f809 100644 (file)
@@ -219,7 +219,7 @@ int main(int argc, char *argv[])
         }
     }
 
-    err = dist_init();
+    err = oct_init();
     if (err_is_fail(err)) {
         USER_PANIC_ERR(err, "Initialize dist");
     }
index 17001b7..be5a502 100644 (file)
@@ -64,7 +64,7 @@ errval_t find_all_apics(void)
                    s->ProcessorId, s->Id,
                    s->LapicFlags & ACPI_MADT_ENABLED);
 
-            errval_t err = dist_set("hw.apic.%d { cpu_id: %d, id: %d, enabled: %d }",
+            errval_t err = oct_set("hw.apic.%d { cpu_id: %d, id: %d, enabled: %d }",
                                      s->Id, s->ProcessorId, s->Id,
                                      s->LapicFlags & ACPI_MADT_ENABLED);
             assert(err_is_ok(err));
@@ -85,7 +85,7 @@ errval_t find_all_apics(void)
                          RegionType_IOAPIC,
                          0);
 
-            errval_t err = dist_mset(SET_SEQUENTIAL,
+            errval_t err = oct_mset(SET_SEQUENTIAL,
                                      "hw.ioapic. { id: %d, address: %u, irqbase: %d }",
                                      s->Id, s->Address, s->GlobalIrqBase);
             assert(err_is_ok(err));
index 5552780..103f9a0 100644 (file)
 --------------------------------------------------------------------------
 
 [  build application { target = "ioapic",
-                       flounderTHCStubs = [ "dist2" ],
-                       flounderBindings = [ "ioapic", "dist2" ],
-                       flounderDefs = [ "monitor", "monitor_blocking", "dist2" ],
-                       flounderExtraDefs = [ ("monitor_blocking",["rpcclient"]), ("dist2", ["rpcclient"]) ],                       
+                       flounderTHCStubs = [ "octopus" ],
+                       flounderBindings = [ "ioapic", "octopus" ],
+                       flounderDefs = [ "monitor", "monitor_blocking", "octopus" ],
+                       flounderExtraDefs = [ ("monitor_blocking",["rpcclient"]), ("octopus", ["rpcclient"]) ],                       
                        mackerelDevices = [ "lpc_ioapic" ],
                        cFiles = [ "ioapic_main.c", "ioapic.c", "interrupts.c", "ioapic_service.c" ],
                        addIncludes = [ "../acpi/acpica/include" ], -- need some defines in interrupt.c
                        addCFlags = [ "-Wno-redundant-decls" ],
-                       addLibraries = [ "mm", "skb", "dist2", "dist_parser", "thc" ],
+                       addLibraries = [ "mm", "skb", "octopus", "octopus_parser", "thc" ],
                        architectures = [ "x86_64", "x86_32" ]
                     }
 ]
index 259c6b7..461382b 100644 (file)
@@ -216,7 +216,7 @@ errval_t init_all_apics(void)
 
     char** names = NULL;
     size_t len = 0;
-    err = dist_get_names(&names, &len,
+    err = oct_get_names(&names, &len,
             "r'hw.ioapic.[0-9]+' { id: _, address: _, irqbase: _ }");
     if (err_is_fail(err)) {
         return err;
@@ -224,11 +224,11 @@ errval_t init_all_apics(void)
 
     for (size_t i=0; i<len; i++) {
         char* record = NULL;
-        err = dist_get(&record, names[i]);
+        err = oct_get(&record, names[i]);
         if (err_is_ok(err)) {
             APIC_DEBUG("Found I/O APIC record: %s\n", record);
             uint64_t id, address, irqbase;
-            err = dist_read(record, "_ { id: %d, address: %d, irqbase: %d }",
+            err = oct_read(record, "_ { id: %d, address: %d, irqbase: %d }",
                     &id, &address, &irqbase);
             free(record);
             if (err_is_fail(err)) {
@@ -244,7 +244,7 @@ errval_t init_all_apics(void)
     }
 
 out:
-    dist_free_names(names, len);
+    oct_free_names(names, len);
     return err;
 }
 
index 64806b4..8d9d963 100644 (file)
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
     // Initialize I/O APIC Driver
     //
     errval_t err;
-    err = dist_init();
+    err = oct_init();
     if (err_is_fail(err)) {
         USER_PANIC_ERR(err, "Connect to dist Service");
     }
index 8c5161e..91fa7fe 100644 (file)
@@ -14,8 +14,8 @@
                       cFiles = [ "main.c", "queue.c", "boot_modules.c", "common.c",
                                  "start_cpu.c", "start_pci.c", "driver_startup.c" ],
                          flounderDefs = [ "monitor" ],
-                      flounderBindings = [ "dist2" ],
-                      addLibraries = [ "skb", "dist2", "dist_parser", 
+                      flounderBindings = [ "octopus" ],
+                      addLibraries = [ "skb", "octopus", "octopus_parser", 
                                        "thc", "vfs", "nfs", "ahci", "lwip",
                                        "contmng", "procon", "hashtable", 
                                        "spawndomain", "elf", "trace" ] }
index 3a73ae9..22b07af 100644 (file)
@@ -12,11 +12,11 @@ errval_t trigger_existing_and_watch(const char* query,
     char* output = NULL;
     char* record = NULL; // freed by cpu_change_event
     size_t len = 0;
-    octopus_trigger_t t = dist_mktrigger(0, octopus_BINDING_EVENT,
+    octopus_trigger_t t = oct_mktrigger(0, octopus_BINDING_EVENT,
             TRIGGER_ALWAYS, event_handler, state);
 
     // Get current cores registered in system
-    struct octopus_thc_client_binding_t* rpc = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* rpc = oct_get_thc_client();
     errval_t err = rpc->call_seq.get_names(rpc, query,
             t, &output, tid, &error_code);
     if (err_is_fail(err)) {
@@ -26,14 +26,14 @@ errval_t trigger_existing_and_watch(const char* query,
 
     switch(err_no(err)) {
     case SYS_ERR_OK:
-        err = dist_parse_names(output, &names, &len);
+        err = oct_parse_names(output, &names, &len);
         if (err_is_fail(err)) {
             goto out;
         }
 
         for (size_t i=0; i < len; i++) {
             KALUGA_DEBUG("get record for name:%s\n", names[i]);
-            err = dist_get(&record, names[i]);
+            err = oct_get(&record, names[i]);
 
             switch (err_no(err)) {
             case SYS_ERR_OK:
@@ -61,7 +61,7 @@ errval_t trigger_existing_and_watch(const char* query,
     }
 
 out:
-    dist_free_names(names, len);
+    oct_free_names(names, len);
     free(output);
 
     return err;
index 440eac5..16414b1 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
         USER_PANIC_ERR(err, "Device DB not loaded.");
     }
 
-    err = dist_init();
+    err = oct_init();
     if (err_is_fail(err)) {
         USER_PANIC_ERR(err, "Initialize dist library.");
     }
@@ -102,7 +102,7 @@ int main(int argc, char** argv)
     // The current boot protocol needs us to have
     // knowledge about how many CPUs are available at boot
     // time in order to start-up properly.
-    err = dist_barrier_enter("barrier.acpi", &record, 2);
+    err = oct_barrier_enter("barrier.acpi", &record, 2);
 
     err = watch_for_ioapic();
     if (err_is_fail(err)) {
index 827b8b0..7444cb6 100644 (file)
@@ -89,7 +89,7 @@ static void boot_initialize_reply(struct monitor_binding *st)
 {
     KALUGA_DEBUG("boot_initialize_reply\n");
     cores_booted = true;
-    errval_t err = dist_set("all_spawnds_up { iref: 0 }");
+    errval_t err = oct_set("all_spawnds_up { iref: 0 }");
     assert(err_is_ok(err));
 }
 
@@ -126,7 +126,7 @@ static void cpu_change_event(octopus_mode_t mode, char* record, void* state)
         KALUGA_DEBUG("CPU found: %s\n", record);
 
         uint64_t cpu_id, arch_id, enabled = 0;
-        errval_t err = dist_read(record, "_ { cpu_id: %d, id: %d, enabled: %d }",
+        errval_t err = oct_read(record, "_ { cpu_id: %d, id: %d, enabled: %d }",
                 &cpu_id, &arch_id, &enabled);
         if (err_is_fail(err)) {
             DEBUG_ERR(err, "Cannot read record.");
index a8e3e55..aad8d9b 100644 (file)
@@ -30,7 +30,7 @@ static void spawnd_up_event(octopus_mode_t mode, char* spawnd_record, void* st)
 {
     assert(mode & DIST_ON_SET);
     uint64_t iref;
-    errval_t err = dist_read(spawnd_record, "_ { iref: %d }", &iref);
+    errval_t err = oct_read(spawnd_record, "_ { iref: %d }", &iref);
     if (err_is_fail(err)) {
         USER_PANIC_ERR(err, "Failed to read iref from spawnd record?");
     }
@@ -44,11 +44,11 @@ static void spawnd_up_event(octopus_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 octopus_thc_client_binding_t* cl = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* cl = oct_get_thc_client();
     char* iref_record = NULL;
     octopus_trigger_id_t tid;
     errval_t error_code;
-    octopus_trigger_t t = dist_mktrigger(DIST2_ERR_NO_RECORD,
+    octopus_trigger_t t = oct_mktrigger(DIST2_ERR_NO_RECORD,
             octopus_BINDING_EVENT, DIST_ON_SET, spawnd_up_event, state);
 
     // Construct service name
@@ -73,7 +73,7 @@ static void pci_change_event(octopus_mode_t mode, char* device_record, void* st)
     errval_t err;
     if (mode & DIST_ON_SET) {
         uint64_t vendor_id, device_id;
-        err = dist_read(device_record, "_ { vendor: %d, device_id: %d }",
+        err = oct_read(device_record, "_ { vendor: %d, device_id: %d }",
                 &vendor_id, &device_id);
         if (err_is_fail(err)) {
             USER_PANIC_ERR(err, "Got malformed device record?");
index 4e712ec..a6cdfda 100644 (file)
@@ -22,7 +22,7 @@
                                  "ht_config.c", "ioapic_client.c", "pcie.c" ],
                       addCFlags = [ "-Wno-redundant-decls" ],
                       addLibraries = [ "mm", "skb", "pciconfspace", "acpi_client", 
-                                       "dist2", "dist_parser", "thc" ],
+                                       "octopus", "octopus_parser", "thc" ],
                       architectures = [ "x86_64", "x86_32" ]
                     }
 ]
index 928240b..95e6f1d 100644 (file)
@@ -590,20 +590,20 @@ static void assign_bus_numbers(struct pci_address parentaddr, uint8_t *busnum,
                              pci_hdr0_int_pin_rd(&devhdr) - 1);
 
 
-                // dist2 start
+                // octopus start
                 char* record = NULL;
                 static char* device_fmt = "hw.pci.device. { "
                                           "bus: %u, device: %u, function: %u, "
                                           "vendor: %u, device_id: %u, class: %u, "
                                           "subclass: %u, prog_if: %u }";
-                errval_t err = dist_mset(SET_SEQUENTIAL, device_fmt,
+                errval_t err = oct_mset(SET_SEQUENTIAL, device_fmt,
                         addr.bus, addr.device, addr.function, vendor,
                         device_id, classcode.clss, classcode.subclss,
                         classcode.prog_if);
 
                 assert(err_is_ok(err));
                 free(record);
-                // end dist2
+                // end octopus
 
                 query_bars(devhdr, addr, false);
             }
@@ -633,7 +633,7 @@ errval_t pci_setup_root_complex(void)
     char** names = NULL;
     size_t len = 0;
     // TODO: react to new rootbridges
-    err = dist_get_names(&names, &len,
+    err = oct_get_names(&names, &len,
                "r'hw.pci.rootbridge.[0-9]+' { acpi_node: _, bus: _, device: _, function: _, maxbus: _ }");
     if (err_is_fail(err)) {
        DEBUG_ERR(err, "get names");
@@ -641,7 +641,7 @@ errval_t pci_setup_root_complex(void)
     }
 
     for (size_t i=0; i<len; i++) {
-               err = dist_get(&record, names[i]);
+               err = oct_get(&record, names[i]);
                if (err_is_fail(err)) {
                        goto out;
                }
@@ -651,7 +651,7 @@ errval_t pci_setup_root_complex(void)
                char* acpi_node = NULL; // freed in pci_add_root
                int64_t bus, device, function, maxbus;
                static char* format =  "_ { acpi_node: %s, bus: %d, device: %d, function: %d, maxbus: %d }";
-               err = dist_read(record, format, &acpi_node, &bus, &device, &function, &maxbus);
+               err = oct_read(record, format, &acpi_node, &bus, &device, &function, &maxbus);
                if (err_is_fail(err)) {
                        free(acpi_node);
                        free(record);
@@ -671,7 +671,7 @@ errval_t pci_setup_root_complex(void)
     }
 
 out:
-       dist_free_names(names, len);
+       oct_free_names(names, len);
     return err;
 }
 
index bbfe697..2d2e096 100644 (file)
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
     debug_printf("pci staretd\n");
     errval_t err;
 
-    err = dist_init();
+    err = oct_init();
     if (err_is_fail(err)) {
        USER_PANIC_ERR(err, "dist initialization failed.");
     }
index 58c96e6..93620e5 100644 (file)
@@ -32,7 +32,7 @@ let ramfs_files = find inDir "eclipse_kernel/lib" ".eco"
                                          "posixcompat", "msun",
                                          "icsolver", "vfs", "nfs", "ahci", "lwip",
                                          "contmng", "procon", "hashtable", "pcre", 
-                                         "dist_server", "dist_parser", "skb",
+                                         "octopus_server", "octopus_parser", "skb",
                                          "bench", "dmalloc", "hashtable"],
                         architectures = [ arch ]
                 }
index b522dee..4de9f18 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * \file
  * \brief Definitions for external C predicates used in Prolog code of
- * the dist2 server implementation.
+ * the octopus server implementation.
  */
 
 /*
@@ -477,7 +477,7 @@ int p_bitfield_union(void) /* p_index_union(Storage, -[Attributes], -Current, +N
     return PFAIL;
 }
 
-void dist_rpc_enqueue_reply(struct octopus_binding *b, struct dist_reply_state* st);
+void oct_rpc_enqueue_reply(struct octopus_binding *b, struct oct_reply_state* st);
 extern struct bitfield* trigger_ids;
 
 int p_trigger_watch(void) /* p_trigger_watch(+String, +Mode, +Recipient, +WatchId, -Retract) */
@@ -508,7 +508,7 @@ int p_trigger_watch(void) /* p_trigger_watch(+String, +Mode, +Recipient, +WatchI
         return res;
     }
 
-    struct dist_reply_state* drs = NULL;
+    struct oct_reply_state* drs = NULL;
     res = ec_get_long(ec_arg(4), (long int*) &drs);
     if (res != PSUCCEED) {
         return res;
@@ -542,10 +542,10 @@ int p_trigger_watch(void) /* p_trigger_watch(+String, +Mode, +Recipient, +WatchI
 
         if (!retract) {
             // Copy reply state because the trigger will stay intact
-            struct dist_reply_state* drs_copy = NULL;
-            errval_t err = new_dist_reply_state(&drs_copy, NULL);
+            struct oct_reply_state* drs_copy = NULL;
+            errval_t err = new_oct_reply_state(&drs_copy, NULL);
             assert(err_is_ok(err));
-            memcpy(drs_copy, drs, sizeof(struct dist_reply_state));
+            memcpy(drs_copy, drs, sizeof(struct oct_reply_state));
             drs = drs_copy; // overwrite drs
         }
         else {
@@ -557,7 +557,7 @@ int p_trigger_watch(void) /* p_trigger_watch(+String, +Mode, +Recipient, +WatchI
         drs->mode = (retract) ? (action | DIST_REMOVED) : action;
 
         if (drs->binding->st != NULL) {
-            dist_rpc_enqueue_reply(drs->binding, drs);
+            oct_rpc_enqueue_reply(drs->binding, drs);
         }
         else {
             drs->reply(drs->binding, drs);
index dbf300e..37e00db 100644 (file)
@@ -85,7 +85,7 @@ static void read_eclipse_queue(int qid, struct skb_writer* w)
     w->buffer[w->length] = '\0';
 }
 
-static errval_t run_eclipse(struct dist_query_state* st)
+static errval_t run_eclipse(struct oct_query_state* st)
 {
     assert(st != NULL);
     long int qid;
@@ -125,13 +125,13 @@ static errval_t run_eclipse(struct dist_query_state* st)
     return err;
 }
 
-static void debug_skb_output(struct dist_query_state* st)
+static void debug_skb_output(struct oct_query_state* st)
 {
     DIST2_DEBUG(
             " output: %s error: %s error_code: %d\n", st->stdout.buffer, st->stderr.buffer, st->exec_res);
 }
 
-errval_t get_record(struct ast_object* ast, struct dist_query_state* sqs)
+errval_t get_record(struct ast_object* ast, struct oct_query_state* sqs)
 {
     assert(ast != NULL);
     assert(sqs != NULL);
@@ -163,7 +163,7 @@ errval_t get_record(struct ast_object* ast, struct dist_query_state* sqs)
     return err;
 }
 
-errval_t get_record_names(struct ast_object* ast, struct dist_query_state* dqs)
+errval_t get_record_names(struct ast_object* ast, struct oct_query_state* dqs)
 {
     assert(ast != NULL);
     assert(dqs != NULL);
@@ -209,7 +209,7 @@ errval_t get_record_names(struct ast_object* ast, struct dist_query_state* dqs)
 }
 
 errval_t set_record(struct ast_object* ast, uint64_t mode,
-        struct dist_query_state* sqs)
+        struct oct_query_state* sqs)
 {
     assert(ast != NULL);
     assert(sqs != NULL);
@@ -244,7 +244,7 @@ errval_t set_record(struct ast_object* ast, uint64_t mode,
     return err;
 }
 
-errval_t del_record(struct ast_object* ast, struct dist_query_state* dqs)
+errval_t del_record(struct ast_object* ast, struct oct_query_state* dqs)
 {
     // TODO sr.attributes, sr.constraints currently not used for delete
     // it's just based on the name
@@ -296,7 +296,7 @@ static errval_t init_bitmap(struct bitfield** bf)
     return err;
 }
 
-static void store_template(struct dist_reply_state* drs,
+static void store_template(struct oct_reply_state* drs,
         struct skb_ec_terms* sr, pword storage, pword recipient)
 {
     dident add_subscription = ec_did("add_subscription", 4);
@@ -314,7 +314,7 @@ static void store_template(struct dist_reply_state* drs,
 }
 
 errval_t set_watch(struct octopus_binding* b, struct ast_object* ast,
-        uint64_t mode, struct dist_reply_state* drs, uint64_t* wid)
+        uint64_t mode, struct oct_reply_state* drs, uint64_t* wid)
 {
     errval_t err = init_bitmap(&trigger_ids);
     if (err_is_fail(err)) {
@@ -355,7 +355,7 @@ errval_t set_watch(struct octopus_binding* b, struct ast_object* ast,
 }
 
 errval_t del_watch(struct octopus_binding* b, octopus_trigger_id_t id,
-        struct dist_query_state* dqs)
+        struct oct_query_state* dqs)
 {
     dident remove_watch = ec_did("remove_watch", 2);
     pword binding_ptr = ec_long((long int) b);
@@ -377,7 +377,7 @@ errval_t del_watch(struct octopus_binding* b, octopus_trigger_id_t id,
 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));
+    struct oct_query_state* dqs = calloc(1, sizeof(struct oct_query_state));
     if (dqs == NULL) {
         DIST2_DEBUG("Server out of memory.");
         return NULL;
@@ -416,7 +416,7 @@ struct octopus_binding* get_event_binding(struct octopus_binding* b)
 }
 
 errval_t add_subscription(struct octopus_binding* b, struct ast_object* ast,
-        uint64_t trigger_fn, uint64_t state, struct dist_reply_state* drs)
+        uint64_t trigger_fn, uint64_t state, struct oct_reply_state* drs)
 {
     errval_t err = init_bitmap(&subscriber_ids);
     if (err_is_fail(err)) {
@@ -457,7 +457,7 @@ errval_t add_subscription(struct octopus_binding* b, struct ast_object* ast,
 }
 
 errval_t del_subscription(struct octopus_binding* b, uint64_t id,
-        struct dist_query_state* sqs)
+        struct oct_query_state* sqs)
 {
     errval_t err = SYS_ERR_OK;
     pword binding_term = ec_long((long int) get_event_binding(b));
@@ -484,7 +484,7 @@ errval_t del_subscription(struct octopus_binding* b, uint64_t id,
     return err;
 }
 
-errval_t find_subscribers(struct ast_object* ast, struct dist_query_state* sqs)
+errval_t find_subscribers(struct ast_object* ast, struct oct_query_state* sqs)
 {
     struct skb_ec_terms sr;
     errval_t err = transform_record(ast, &sr);
@@ -521,7 +521,7 @@ errval_t find_subscribers(struct ast_object* ast, struct dist_query_state* sqs)
 
 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));
+    struct oct_query_state* dqs = malloc(sizeof(struct oct_query_state));
     if (dqs == NULL) {
         return LIB_ERR_MALLOC_FAIL;
     }
index 1c84006..e79651b 100644 (file)
@@ -33,7 +33,7 @@
 int skb_init(void);
 void execute_string(char *string);
 
-/* XXX: used dlmalloc for benchmarking dist2 */
+/* XXX: used dlmalloc for benchmarking octopus */
 #include <dmalloc/dmalloc.h>
 typedef void *(*alt_malloc_t)(size_t bytes);
 extern alt_malloc_t alt_malloc;
@@ -76,7 +76,7 @@ int main(int argc, char**argv)
     execute_string("set_flag(print_depth,100).");
 
     if(disp_get_core_id() == 0) {
-        //debug_printf("dist_server_init\n");
+        //debug_printf("oct_server_init\n");
         //execute_string("set_flag(gc, off).");
         //execute_string("set_flag(gc_policy, fixed).");
         //execute_string("set_flat(gc_interval, 536870912)."); // 512 mb
@@ -86,7 +86,7 @@ int main(int argc, char**argv)
         //execute_string("set_flag(debugging, nodebug).");
         //bench_init();
 
-        // dist2 related stuff
+        // octopus related stuff
         execute_string("[objects3].");
         execute_string("[pubsub3].");
         execute_string("[bindings].");
@@ -103,7 +103,7 @@ int main(int argc, char**argv)
         ec_external(ec_did("split", 4), (int (*)()) ec_regsplit, e);
         // end
 
-        errval_t err = dist_server_init();
+        errval_t err = oct_server_init();
         assert(err_is_ok(err));
     }
     if (disp_get_core_id() == 0) {
index 80c6990..8d7ab48 100644 (file)
 
 [ build application { target = "d2getset",
                       cFiles = [ "d2getset.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
 
   build application { target = "d2pubsub",
                       cFiles = [ "d2pubsub.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
 
   
   build application { target = "d2trigger",
                       cFiles = [ "d2trigger.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
 
   build application { target = "d2barrier",
                       cFiles = [ "d2barrier.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
                                         
   build application { target = "d2locksimple",
                       cFiles = [ "d2locksimple.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
 
   build application { target = "d2read",
                       cFiles = [ "d2read.c" ],
-                      flounderBindings = [ "dist2" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderBindings = [ "octopus" ],
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
                     
   build application { target = "d2sem",
                       cFiles = [ "d2sem.c" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
                     
   build application { target = "d2bench",
                       cFiles = [ "d2bench.c" ],
-                      flounderBindings = [ "dist2" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderBindings = [ "octopus" ],
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
 
   build application { target = "d2bench1",
                       cFiles = [ "d2bench1.c" ],
-                      flounderBindings = [ "dist2" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderBindings = [ "octopus" ],
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     },
                     
   build application { target = "d2bench2",
                       cFiles = [ "d2bench2.c" ],
-                      flounderBindings = [ "dist2" ],
-                      flounderTHCStubs = [ "dist2" ],
-                      addLibraries = [ "dist2", "dist_parser", "thc" ]
+                      flounderBindings = [ "octopus" ],
+                      flounderTHCStubs = [ "octopus" ],
+                      addLibraries = [ "octopus", "octopus_parser", "thc" ]
                     }    
 ]
index 0d39bf0..eb364bf 100644 (file)
@@ -25,13 +25,13 @@ int main(int argc, char *argv[])
 {
        assert(argc >= 2);
     errval_t err = SYS_ERR_OK;
-    dist_init();
+    oct_init();
 
     size_t wait_for = atoi(argv[1]);
     char* record = NULL;
     debug_printf("Barrier test with: %lu processes:\n", wait_for);
 
-    err = dist_barrier_enter("my_barrier", &record, wait_for);
+    err = oct_barrier_enter("my_barrier", &record, wait_for);
     if(err_is_ok(err)) {
                debug_printf("Execute Barrier code section\n");
                debug_printf("Barrier record is: %s\n", record);
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
        DEBUG_ERR(err, "Barrier enter fail.");
        abort();
     }
-    err = dist_barrier_leave(record);
+    err = oct_barrier_leave(record);
     ASSERT_ERR_OK(err);
 
     debug_printf("Process no longer inside barrier.\n");
index e080c2a..3a7bd47 100644 (file)
@@ -45,7 +45,7 @@ static void variable_records(void)
         printf("# Run experiment with %lu records:\n", records[i]);
 
         for (size_t j = records[i - 1]; j < records[i]; j++) {
-            errval_t err = dist_set("object%lu { attr: 'object%lu' }", j, j);
+            errval_t err = oct_set("object%lu { attr: 'object%lu' }", j, j);
             if (err_is_fail(err)) {
                 DEBUG_ERR(err, "set");
                 exit(0);
@@ -55,7 +55,7 @@ static void variable_records(void)
         errval_t error_code;
         char* data = NULL;
 
-        struct octopus_rpc_client* cl = dist_get_thc_client();
+        struct octopus_rpc_client* cl = oct_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 octopus_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = oct_get_thc_client();
     assert(cl != NULL);
 
     errval_t error_code;
@@ -138,13 +138,13 @@ static void add_record(void) {
 
 static void one_record(void)
 {
-    errval_t err = dist_set("object0");
+    errval_t err = oct_set("object0");
     assert(err_is_ok(err));
 
     errval_t error_code;
     char* data = NULL;
 
-    struct octopus_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = oct_get_thc_client();
 
     for (size_t i = 0; i < MAX_ITERATIONS; i++) {
 
@@ -166,10 +166,10 @@ static void one_record(void)
 
 static void unnamed_record(void)
 {
-    errval_t err = dist_set("object0 { attr1: 'bla', attr2: 12.0 }");
+    errval_t err = oct_set("object0 { attr1: 'bla', attr2: 12.0 }");
     assert(err_is_ok(err));
 
-    struct octopus_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = oct_get_thc_client();
     assert(cl != NULL);
 
     char* data = NULL;
@@ -196,7 +196,7 @@ static void unnamed_record(void)
 int main(int argc, char** argv)
 {
     bench_init();
-    dist_init();
+    oct_init();
 
     if (0) one_record();
     if (0) variable_records();
index ca1d528..a4f77c2 100644 (file)
@@ -30,22 +30,22 @@ int main(int argc, char** argv)
        int clients = atoi(argv[1]);
        assert(clients > 0);
 
-    dist_init();
+    oct_init();
 
     char payload[256] = { [0 ... 254] = 'a', [255] = '\0' };
 
-    struct octopus_rpc_client* cl = dist_get_thc_client();
+    struct octopus_rpc_client* cl = oct_get_thc_client();
     assert(cl != NULL);
 
     char record[300];
     sprintf(record, "rec { attr: '%s' }", payload);
     printf("record is: %s\n", record);
 
-    errval_t err = dist_set(record);
+    errval_t err = oct_set(record);
     assert(err_is_ok(err));
 
     char* barrier = NULL;
-    err = dist_barrier_enter("d2bench1", &barrier, clients);
+    err = oct_barrier_enter("d2bench1", &barrier, clients);
     assert(err_is_ok(err));
 
     char* reply;
index 76bfc1d..9d98f19 100644 (file)
@@ -131,7 +131,7 @@ static void construct_record(size_t attributes) {
 static void no_name_get_worstcase(void)
 {
     // reference record to measure retrieve time
-    errval_t err = dist_set("zzz { weight: 999, value: 'high', attr: 999, bench: 1234.123, rand: '1' }");
+    errval_t err = oct_set("zzz { weight: 999, value: 'high', attr: 999, bench: 1234.123, rand: '1' }");
     char* query = "_ { weight: 999, value: 'high', attr: 999, bench: 1234.123, rand: '1' }";
     assert(err_is_ok(err));
 
@@ -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 octopus_rpc_client* cl = dist_get_thc_client();
+        struct octopus_rpc_client* cl = oct_get_thc_client();
         assert(cl != NULL);
         errval_t error_code;
         char* record;
@@ -171,7 +171,7 @@ static void no_name_get_worstcase(void)
 
 int main(int argc, char** argv)
 {
-    dist_init();
+    oct_init();
     bench_init();
 
     no_name_get_worstcase();
index a78f2f3..87314f5 100644 (file)
@@ -27,7 +27,7 @@
 static void start_publisher(void) {
 
        for (size_t i=0; i < MAX_SEND; i++) {
-               errval_t err = dist_publish("msg_1 { val: %d }", 1);
+               errval_t err = oct_publish("msg_1 { val: %d }", 1);
                if (err_is_fail(err)) { DEBUG_ERR(err, "publish"); exit(1); }
        }
 
@@ -39,13 +39,13 @@ static void handle_msg(uint64_t id, char* msg, void* state)
 }
 
 static void start_subscriber() {
-       errval_t err = dist_subscribe(handle_msg, NULL, &id, "_ { val: 1 }");
+       errval_t err = oct_subscribe(handle_msg, NULL, &id, "_ { val: 1 }");
        if (err_is_fail(err)) { DEBUG_ERR(err, "subscribe"); exit(1); }
 }
 
 int main(int argc, char** argv)
 {
-    dist_init();
+    oct_init();
     bench_init();
 
     start_client();
index 577fe04..fdadfa8 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Tests for dist2 get/set/del API
+ * \brief Tests for octopus get/set/del API
  */
 
 /*
@@ -33,37 +33,37 @@ static void get_names(void)
     char** names = NULL;
     size_t size = 0;
 
-    err = dist_get_names(&names, &size, "r'^object.*'");
+    err = oct_get_names(&names, &size, "r'^object.*'");
     ASSERT_ERR_OK(err);
     assert(size == 4);
     ASSERT_STRING(names[0], "object3");
     ASSERT_STRING(names[1], "object4");
     ASSERT_STRING(names[2], "object5");
     ASSERT_STRING(names[3], "object6");
-    dist_free_names(names, size);
+    oct_free_names(names, size);
 
-    err = dist_get_names(&names, &size, "_ { weight: _ }");
+    err = oct_get_names(&names, &size, "_ { weight: _ }");
     ASSERT_ERR_OK(err);
     assert(size == 2);
     //ASSERT_STRING(names[0], "object2");
     ASSERT_STRING(names[0], "object3");
     ASSERT_STRING(names[1], "object4");
-    dist_free_names(names, size);
+    oct_free_names(names, size);
 
-    err = dist_get_names(&names, &size, "_ { attr: _, weight: %d }", 20);
+    err = oct_get_names(&names, &size, "_ { attr: _, weight: %d }", 20);
     ASSERT_ERR_OK(err);
     assert(size == 1);
     ASSERT_STRING(names[0], "object4");
-    dist_free_names(names, size);
+    oct_free_names(names, size);
 
     names = NULL;
     size = 0;
-    err = dist_get_names(&names, &size, "asdfasd", 20);
+    err = oct_get_names(&names, &size, "asdfasd", 20);
     assert(names == NULL);
     assert(size == 0);
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
 
-    err = dist_get_names(&names, &size, "}+_df}");
+    err = oct_get_names(&names, &size, "}+_df}");
     assert(names == NULL);
     assert(size == 0);
     ASSERT_ERR(err, DIST2_ERR_PARSER_FAIL);
@@ -76,64 +76,64 @@ static void get_records(void)
     errval_t err = SYS_ERR_OK;
     char* data = NULL;
 
-    err = dist_get(&data, "recordDoesNotExist");
+    err = oct_get(&data, "recordDoesNotExist");
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
     assert(data == NULL);
 
-    err = dist_get(&data, "parser { error, m, }");
+    err = oct_get(&data, "parser { error, m, }");
     ASSERT_ERR(err, DIST2_ERR_PARSER_FAIL);
     assert(data == NULL);
 
 
-    err = dist_get(&data, "object1");
+    err = oct_get(&data, "object1");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object1 { weight: 20 }");
     free(data);
 
-    /*err = dist_get(&data, "object2 { weight: 25 }");
+    /*err = oct_get(&data, "object2 { weight: 25 }");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object2 { weight: 25 }");
     free(data);*/
 
-    err = dist_get(&data, "object4");
+    err = oct_get(&data, "object4");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object4 { attr: 'Somestring', fl: 12.0, weight: 20 }");
     free(data);
 
-    err = dist_get(&data, "_ { weight >= 10, fl > 11.0 }");
+    err = oct_get(&data, "_ { weight >= 10, fl > 11.0 }");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object4 { attr: 'Somestring', fl: 12.0, weight: 20 }");
     free(data);
 
-    err = dist_del("object4");
+    err = oct_del("object4");
     ASSERT_ERR_OK(err);
 
-    err = dist_get(&data, "object4");
+    err = oct_get(&data, "object4");
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
     //free(data); TODO??
 
-    err = dist_set("object4 { attr: 'Somestring', fl: 12.0, weight: 20 }");
+    err = oct_set("object4 { attr: 'Somestring', fl: 12.0, weight: 20 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_get(&data, "object4");
+    err = oct_get(&data, "object4");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object4 { attr: 'Somestring', fl: 12.0, weight: 20 }");
     free(data);
 
-    err = dist_del("object1");
+    err = oct_del("object1");
     ASSERT_ERR_OK(err);
 
-    err = dist_get(&data, "object1");
+    err = oct_get(&data, "object1");
     //printf("data: %s\n", data);
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
     // TODO free(data);?
 
-    /*err = dist_get(&data, "object2 { weight: 25 }");
+    /*err = oct_get(&data, "object2 { weight: 25 }");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data, "object2 { weight: 25 }");
     free(data);*/
 
-    err = dist_get(&data, "_ { pattern1: r'^12.*ab$' }");
+    err = oct_get(&data, "_ { pattern1: r'^12.*ab$' }");
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data,
             "object5 { pattern1: '123abab', pattern2: " \
@@ -143,7 +143,7 @@ static void get_records(void)
 
     // Test long regex
     R(re, "_ { pattern3: r'^(((((((0?[13578])|(1[02]))[\.\-/]?((0?[1-9])|([12]\d)|(3[01])))|(((0?[469])|(11))[\.\-/]?((0?[1-9])|([12]\d)|(30)))|((0?2)[\.\-/]?((0?[1-9])|(1\d)|(2[0-8]))))[\.\-/]?(((19)|(20))?([\d][\d]))))|((0?2)[\.\-/]?(29)[\.\-/]?(((19)|(20))?(([02468][048])|([13579][26])))))$' }");
-    err = dist_get(&data, re);
+    err = oct_get(&data, re);
     ASSERT_ERR_OK(err);
     ASSERT_STRING(data,
             "object5 { pattern1: '123abab', pattern2: " \
@@ -152,56 +152,56 @@ static void get_records(void)
     free(data);
 
 
-    // TODO implement dist_del with constraints, attributes!
+    // TODO implement oct_del with constraints, attributes!
 
     printf("get_records() done!\n");
 }
 
 static void exist_records(void)
 {
-    errval_t err = dist_exists("././12");
+    errval_t err = oct_exists("././12");
     ASSERT_ERR(err, DIST2_ERR_PARSER_FAIL);
 
-    err = dist_exists("recordDoesNotExist");
+    err = oct_exists("recordDoesNotExist");
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
 
-    err = dist_exists("object3 { fl > 10, weight: _ }");
+    err = oct_exists("object3 { fl > 10, weight: _ }");
     ASSERT_ERR_OK(err);
 }
 
 static void set_records(void)
 {
-    errval_t err = dist_set("q{weqw1,.");
+    errval_t err = oct_set("q{weqw1,.");
     ASSERT_ERR(err, DIST2_ERR_PARSER_FAIL);
 
-    err = dist_set("object1 { weight: %d }", 20);
+    err = oct_set("object1 { weight: %d }", 20);
     ASSERT_ERR_OK(err);
 
     // TODO: Do we want this?
     /*
-    err = dist_set("object2 { weight: %lu, weight: %lu }", 20, 25);
+    err = oct_set("object2 { weight: %lu, weight: %lu }", 20, 25);
     ASSERT_ERR_OK(err);*/
 
     char* str = "A text string.";
-    err = dist_set("object3 { attr: '%s', weight: 9, fl: 12.0 }",
+    err = oct_set("object3 { attr: '%s', weight: 9, fl: 12.0 }",
             str);
     ASSERT_ERR_OK(err);
 
-    err = dist_set(
+    err = oct_set(
             "object4 { attr: 'Somestring', weight: 20, fl: %f }", 12.0);
     ASSERT_ERR_OK(err);
 
     char* pattern1 = "123abab";
     char* pattern2 = "StringToTestRegexMatching";
     char* pattern3 = "10-10-2010";
-    err = dist_set(
+    err = oct_set(
             "object5 { pattern1: '%s', pattern2: '%s', pattern3: '%s' }",
             pattern1, pattern2, pattern3);
     ASSERT_ERR_OK(err);
 
     pattern1 = "123ababc";
     pattern3 = "21-00-2900";
-    err = dist_set(
+    err = oct_set(
             "object6 { pattern1: '%s', pattern2: '%s', pattern3: '%s' }",
             pattern1, pattern2, pattern3);
     ASSERT_ERR_OK(err);
@@ -215,30 +215,30 @@ static void regex_name(void)
     errval_t err = SYS_ERR_OK;
     char* rec = NULL;
 
-    err = dist_set("obj123 { attr: 12 }");
+    err = oct_set("obj123 { attr: 12 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_set("obj1 { attr: 12 }");
+    err = oct_set("obj1 { attr: 12 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_set("obj134 { attr: 12 }");
+    err = oct_set("obj134 { attr: 12 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_get(&rec, "r'obj.$' { attr: 12 }");
+    err = oct_get(&rec, "r'obj.$' { attr: 12 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_set("r'obj.$' { attr: 12 }");
+    err = oct_set("r'obj.$' { attr: 12 }");
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD_NAME);
 
     char** names = NULL;
     size_t len = 0;
-    err = dist_get_names(&names, &len, "r'^obj.$'");
+    err = oct_get_names(&names, &len, "r'^obj.$'");
     ASSERT_ERR_OK(err);
     assert(len == 1);
     ASSERT_STRING("obj1", names[0]);
-    dist_free_names(names, len);
+    oct_free_names(names, len);
 
-    err = dist_del("r'obj.$' { attr: 12}");
+    err = oct_del("r'obj.$' { attr: 12}");
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD_NAME);
 
     printf("regex_name() done!\n");
@@ -246,7 +246,7 @@ static void regex_name(void)
 
 int main(int argc, char *argv[])
 {
-    dist_init();
+    oct_init();
 
     // Run Tests
     set_records();
index 3ddd5ab..09015c4 100644 (file)
@@ -34,12 +34,12 @@ static void lockit(void* arg)
     errval_t err = SYS_ERR_OK;
 
     if (!locked) {
-        err = dist_lock("lock_test", &lock);
+        err = oct_lock("lock_test", &lock);
         DEBUG_ERR(err, "lock");
         assert(err_is_ok(err));
         locked = true;
     } else {
-        err = dist_unlock(lock);
+        err = oct_unlock(lock);
         DEBUG_ERR(err, "unlock");
         assert(err_is_ok(err));
         locked = false;
@@ -49,7 +49,7 @@ static void lockit(void* arg)
 
 int main(int argc, char *argv[])
 {
-    dist_init();
+    oct_init();
 
     /*
      debug_printf("create periodic event...\n");
index ba4f018..a3ca829 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Tests for dist2 publish/subscribe API
+ * \brief Tests for octopus publish/subscribe API
  */
 
 /*
@@ -23,7 +23,7 @@
 static const char* barrier_name = "d2pubsub_test";
 static struct thread_sem ts;
 
-static void message_handler(dist_mode_t mode, char* record, void* st)
+static void message_handler(oct_mode_t mode, char* record, void* st)
 {
     size_t* received = (size_t*) st;
 
@@ -34,7 +34,7 @@ static void message_handler(dist_mode_t mode, char* record, void* st)
 
         debug_printf("Message: %s received: %lu\n", record, *received);
 
-        errval_t err = dist_read(record, "%s", &name);
+        errval_t err = oct_read(record, "%s", &name);
         ASSERT_ERR_OK(err);
         ASSERT_STRING(receive_order[*received], name);
 
@@ -61,32 +61,32 @@ static void subscriber(void)
 
     thread_sem_init(&ts, 0);
 
-    err = dist_subscribe(message_handler, &received, &id1, "111 [] attr: 10 }");
+    err = oct_subscribe(message_handler, &received, &id1, "111 [] attr: 10 }");
     ASSERT_ERR(err, DIST2_ERR_PARSER_FAIL);
 
-    err = dist_subscribe(message_handler, &received, &id1,
+    err = oct_subscribe(message_handler, &received, &id1,
             "_ { fl: 1.01, attr: 10 }");
     ASSERT_ERR_OK(err);
     debug_printf("id is: %lu\n", id1);
 
     char* str = "test.txt";
-    err = dist_subscribe(message_handler, &received, &id2, "_ { str: r'%s' }",
+    err = oct_subscribe(message_handler, &received, &id2, "_ { str: r'%s' }",
             str);
     ASSERT_ERR_OK(err);
     debug_printf("id is: %lu\n", id2);
 
-    err = dist_subscribe(message_handler, &received, &id3, "_ { age > %d }",
+    err = oct_subscribe(message_handler, &received, &id3, "_ { age > %d }",
             9);
     ASSERT_ERR_OK(err);
     debug_printf("id is: %lu\n", id3);
 
-    err = dist_subscribe(message_handler, &received, &id4,
+    err = oct_subscribe(message_handler, &received, &id4,
             "r'^msg_(6|7)$'");
     ASSERT_ERR_OK(err);
     debug_printf("id is: %lu\n", id4);
 
     // Synchronize with publisher
-    err = dist_barrier_enter(barrier_name, &barrier_record, 2);
+    err = oct_barrier_enter(barrier_name, &barrier_record, 2);
     if (err_is_fail(err)) DEBUG_ERR(err, "barrier enter");
     assert(err_is_ok(err));
 
@@ -96,20 +96,20 @@ static void subscriber(void)
     }
 
     // Unsubscribe message handlers
-    err = dist_unsubscribe(id1);
+    err = oct_unsubscribe(id1);
     ASSERT_ERR_OK(err);
-    err = dist_unsubscribe(id2);
+    err = oct_unsubscribe(id2);
     ASSERT_ERR_OK(err);
-    err = dist_unsubscribe(id3);
+    err = oct_unsubscribe(id3);
     ASSERT_ERR_OK(err);
-    err = dist_unsubscribe(id4);
+    err = oct_unsubscribe(id4);
     ASSERT_ERR_OK(err);
 
     while(received != 10) {
         messages_wait_and_handle_next();
     }
 
-    dist_barrier_leave(barrier_record);
+    oct_barrier_leave(barrier_record);
     free(barrier_record);
 
     printf("Subscriber all done.\n");
@@ -121,32 +121,32 @@ static void publisher(void)
     char* barrier_record = NULL;
 
     // Synchronize with subscriber
-    err = dist_barrier_enter(barrier_name, &barrier_record, 2);
+    err = oct_barrier_enter(barrier_name, &barrier_record, 2);
     if (err_is_fail(err)) DEBUG_ERR(err, "barrier enter");
     assert(err_is_ok(err));
 
-    err = dist_publish("msg_1 { age: %d }", 9);
+    err = oct_publish("msg_1 { age: %d }", 9);
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_2 { age: %d }", 10);
+    err = oct_publish("msg_2 { age: %d }", 10);
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_3 { str: %d, age: '%d' }", 123, 8);
+    err = oct_publish("msg_3 { str: %d, age: '%d' }", 123, 8);
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_4 { str: 'test.txt' }");
+    err = oct_publish("msg_4 { str: 'test.txt' }");
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_5 { str: 'test.txt', attr: 10, fl: 1.01 }");
+    err = oct_publish("msg_5 { str: 'test.txt', attr: 10, fl: 1.01 }");
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_6 { type: 'test', pattern: '123123' }");
+    err = oct_publish("msg_6 { type: 'test', pattern: '123123' }");
     ASSERT_ERR_OK(err);
 
-    err = dist_publish("msg_7 { type: 'test' }");
+    err = oct_publish("msg_7 { type: 'test' }");
     ASSERT_ERR_OK(err);
 
-    dist_barrier_leave(barrier_record);
+    oct_barrier_leave(barrier_record);
     free(barrier_record);
 
     printf("Publisher all done.\n");
@@ -154,7 +154,7 @@ static void publisher(void)
 
 int main(int argc, char** argv)
 {
-    dist_init();
+    oct_init();
     assert(argc >= 2);
 
     if (strcmp(argv[1], "subscriber") == 0) {
index 0d1f2c4..81cf00b 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Tests dist_read call
+ * \brief Tests oct_read call
  */
 
 /*
 int main(int argc, char *argv[])
 {
     errval_t err = SYS_ERR_OK;
-    dist_init();
+    oct_init();
 
     char* name = NULL;
     char* attr1 = NULL;
     double d;
     uint64_t i;
 
-    err = dist_read("record", "%s", &name);
+    err = oct_read("record", "%s", &name);
     ASSERT_ERR_OK(err);
     ASSERT_STRING(name, "record");
     free(name);
 
-    err = dist_read("record {}", "%s {}", &name);
+    err = oct_read("record {}", "%s {}", &name);
     ASSERT_ERR_OK(err);
     ASSERT_STRING(name, "record");
     free(name);
 
-    err = dist_read("record { attr1: 'Test String 123' }", "%s { attr1: %s }", &name, &attr1);
+    err = oct_read("record { attr1: 'Test String 123' }", "%s { attr1: %s }", &name, &attr1);
     ASSERT_STRING(name, "record");
     ASSERT_STRING(attr1, "Test String 123");
     ASSERT_ERR_OK(err);
     free(name);
     free(attr1);
 
-    err = dist_read("record2 { str: 'string', float: 12.0, integer: 1212}",
+    err = oct_read("record2 { str: 'string', float: 12.0, integer: 1212}",
                "_ { float: %f, str: %s, integer: %d }", &d, &attr1, &i);
     ASSERT_ERR_OK(err);
     ASSERT_STRING(attr1, "string");
index 0b2d50f..7b69c71 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Tests for dist2 get/set/del API
+ * \brief Tests for octopus get/set/del API
  */
 
 /*
 
 int main(int argc, char *argv[])
 {
-    dist_init();
+    oct_init();
 
     uint32_t id;
 
-    errval_t err = dist_sem_new(&id, 1);
+    errval_t err = oct_sem_new(&id, 1);
     ASSERT_ERR_OK(err);
     debug_printf("Semaphore created with id=%d\n", id);
 
-    err = dist_sem_trywait(id);
+    err = oct_sem_trywait(id);
     ASSERT_ERR_OK(err);
 
-    err = dist_sem_trywait(id);
+    err = oct_sem_trywait(id);
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
 
-    err = dist_sem_post(id);
+    err = oct_sem_post(id);
     ASSERT_ERR_OK(err);
 
-    err = dist_sem_post(id);
+    err = oct_sem_post(id);
     ASSERT_ERR_OK(err);
 
-    err = dist_sem_trywait(id);
+    err = oct_sem_trywait(id);
     ASSERT_ERR_OK(err);
 
-    err = dist_sem_trywait(id);
+    err = oct_sem_trywait(id);
     ASSERT_ERR_OK(err);
 
-    err = dist_sem_trywait(id);
+    err = oct_sem_trywait(id);
     ASSERT_ERR(err, DIST2_ERR_NO_RECORD);
 
     printf("d2sem SUCCESS!\n");
index bc9cfeb..674d978 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file
- * \brief Test RPC calls with triggers in dist2
+ * \brief Test RPC calls with triggers in octopus
  */
 
 /*
@@ -56,21 +56,21 @@ static void persistent_trigger(octopus_mode_t m, char* record, void* state) {
 
 int main(int argc, char *argv[])
 {
-    dist_init();
+    oct_init();
     errval_t err = SYS_ERR_OK;
     octopus_trigger_id_t tid;
     size_t received = 0;
 
-    err = dist_set("obj1 { attr: 1 }");
+    err = oct_set("obj1 { attr: 1 }");
     ASSERT_ERR_OK(err);
-    err = dist_set("obj2 { attr: 2 }");
+    err = oct_set("obj2 { attr: 2 }");
     ASSERT_ERR_OK(err);
-    err = dist_set("obj3 { attr: 3 }");
+    err = oct_set("obj3 { attr: 3 }");
     ASSERT_ERR_OK(err);
 
-    struct octopus_thc_client_binding_t* c = dist_get_thc_client();
+    struct octopus_thc_client_binding_t* c = oct_get_thc_client();
 
-    octopus_trigger_t record_deleted = dist_mktrigger(SYS_ERR_OK,
+    octopus_trigger_t record_deleted = oct_mktrigger(SYS_ERR_OK,
             octopus_BINDING_EVENT, DIST_ON_DEL, trigger_handler, &received);
 
     errval_t error_code = SYS_ERR_OK;
@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
     debug_printf("tid is: %lu\n", tid);
     free(output);
 
-    dist_del("obj3");
+    oct_del("obj3");
     while (received != 1) {
         messages_wait_and_handle_next();
     }
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
     received = 0;
     tid = 0;
     octopus_mode_t m = DIST_ON_SET | DIST_ON_DEL | DIST_PERSIST;
-    octopus_trigger_t ptrigger = dist_mktrigger(SYS_ERR_OK,
+    octopus_trigger_t ptrigger = oct_mktrigger(SYS_ERR_OK,
             octopus_BINDING_EVENT, m, persistent_trigger, &received);
     output = NULL;
     err = c->call_seq.get(c, "obj2", ptrigger, &output,
@@ -101,19 +101,19 @@ int main(int argc, char *argv[])
     debug_printf("tid is: %lu\n", tid);
     ASSERT_STRING(output, "obj2 { attr: 2 }");
 
-    dist_del("obj2");
+    oct_del("obj2");
     while (received != 1) {
         messages_wait_and_handle_next();
     }
 
     received = 0;
-    dist_set("obj2 { attr: 'asdf' }");
+    oct_set("obj2 { attr: 'asdf' }");
     while (received != 1) {
         messages_wait_and_handle_next();
     }
 
     received = 0;
-    err = dist_remove_trigger(tid);
+    err = oct_remove_trigger(tid);
     DEBUG_ERR(err, "remove trigger");
     ASSERT_ERR_OK(err);
     while (received != 1) {
index 914bd13..f12608b 100644 (file)
@@ -12,6 +12,6 @@
 
 [ build application { target = "semtest",
                       cFiles = [ "semtest.c" ],
-                             addLibraries = [ "posixcompat", "vfs_nonfs", "ahci", "dist2", "thc" ]
+                             addLibraries = [ "posixcompat", "vfs_nonfs", "ahci", "octopus", "thc" ]
                     }
 ]
index 3aadd82..967acc2 100644 (file)
@@ -1,9 +1,9 @@
 [ build application { target = "shm_client" ,
                       cFiles = [ "shm_client.c" ],
-                      addLibraries = [ "posixcompat", "dist2", "thc"  ]
+                      addLibraries = [ "posixcompat", "octopus", "thc"  ]
                     },
   build application { target = "shm_server" ,
                       cFiles = [ "shm_server.c" ],
-                      addLibraries = [ "posixcompat", "dist2", "thc" ]
+                      addLibraries = [ "posixcompat", "octopus", "thc" ]
                     }
 ]