"serial",
"skb",
"skb_map",
- "dist2",
- "dist_event",
+ "octopus",
"spawn",
"test",
"timer",
"ping_pong",
"mem",
"xmplthc",
- "dist2" ],
+ "octopus" ],
arch <- allArchitectures
]
/**
* \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);
/**
* \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);
#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
{
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)) {
{
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;
}
{
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;
}
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)) {
/* ----------------------- 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");
}
};
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");
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);
}
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,
// 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;
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);
//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;
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)) {
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)) {
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)) {
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)) {
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);
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);
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);
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)) {
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;
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;
#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_ */
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);
}
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)) {
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;
#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;
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
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
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");
}
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);
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;
}
// 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();
}
#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;
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
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)) {
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)) {
{
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);
#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;
}
}
-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,
* \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;
void yyerror(char *s)
{
#ifdef DIST2_DEBUG
- fprintf(stderr, "dist2_parser: %s\n", s);
+ fprintf(stderr, "octopus_parser: %s\n", s);
#endif
}
void yyerror(char *s)
{
#ifdef DIST2_DEBUG
- fprintf(stderr, "dist2_parser: %s\n", s);
+ fprintf(stderr, "octopus_parser: %s\n", s);
#endif
}
#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>
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;
}
}
-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;
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;
}
}
-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;
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;
}
}
-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;
#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,
}
}
-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;
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)) {
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);
}
}
-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) {
*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;
#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
#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>
}
}
-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' ?
}
}
-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;
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 "
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;
}
}
-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);
}
}*/
-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) ?
}
}
-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;
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;
}
}
-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);
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;
}
}
-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;
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),
}
}
-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;
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),
}
}
-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;
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),
}
// 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;
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;
}
}
-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);
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;
}
}
-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' ?
}
-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;
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;
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),
}
}
-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;
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;
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;
}
-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);
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)) {
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"
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);
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;
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");
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);
}
#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;
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: _ }";
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) {
" 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
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);
}
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) */
/**
* \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>.
*/
/*
#include <barrelfish/barrelfish.h>
#include <include/skb_debug.h>
-#include <if/dist2_defs.h>
+#include <if/octopus_defs.h>
#include <include/skb_server.h>
}
-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);
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);
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));
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);
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);
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;
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) {
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;
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++) {
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;
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++) {
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;
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];
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;
#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;
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;
{
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 }");
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;
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);
//#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);
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({
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;