"main.c", "monitor_server.c", "monitor_rpc_server.c",
"boot.c", "queue.c", "domain.c", "intermon_bindings.c",
"resource_ctrl.c", "timing.c", "send_cap.c", "octopus_client.c",
- "capops/capsend.c", "capops/capqueue.c",
+ "capops/capsend.c", "capops/capqueue.c", "capops/internal.c",
"capops/caplock.c", "capops/copy.c", "capops/move.c",
"capops/retrieve.c", "capops/delete.c", "capops/revoke.c",
"capops/retype.c", "capops/init.c", "capops/magic.c",
/*
- * Copyright (c) 2012 ETH Zurich.
+ * Copyright (c) 2012, 2016 ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
errval_t err;
size_t dest_count;
bool init_destset = false;
- size_t online_monitors = num_monitors_online();
+ size_t online_monitors = num_monitors_ready_for_capops();
// do not count self when calculating #dest cores
dest_count = online_monitors - 1;
DEBUG_CAPOPS("%s: dest_count = %zu\n", __FUNCTION__, dest_count);
--- /dev/null
+/*
+ * Copyright (c) 2016 ETH Zurich.
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+#include <stdlib.h>
+#include <monitor.h>
+#include "internal.h"
+
+/**
+ * \brief Return number of montiors for which we've seen 'capops_ready'
+ * \return #monitors that have initialized in the distops protocol
+ */
+size_t num_monitors_ready_for_capops(void) {
+
+ errval_t err;
+ size_t capops_ready_count = 0;
+
+ for (coreid_t c = 0; c < MAX_COREID; c++) {
+ struct intermon_binding *b;
+ err = intermon_binding_get(c, &b);
+ if (err_is_ok(err)) {
+ struct intermon_state *st = b->st;
+ capops_ready_count += st->capops_ready;
+ }
+
+ }
+
+ // Return #<other monitors ready> and us, so that client code can remain
+ // unchanged.
+ return capops_ready_count + 1;
+}
/*
- * Copyright (c) 2012 ETH Zurich.
+ * Copyright (c) 2012, 2016 ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
void revoke_commit__rx(struct intermon_binding *b, genvaddr_t st);
void revoke_done__rx(struct intermon_binding *b, genvaddr_t st);
+/* Return number of monitors for which we've seen 'capops_ready' */
+size_t num_monitors_ready_for_capops(void);
+
#endif
/*
- * Copyright (c) 2012 ETH Zurich.
+ * Copyright (c) 2012, 2016 ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
capops_retrieve(rst->cap, revoke_retrieve__rx, rst);
}
else {
- if (num_monitors_online() == 1) {
+ if (num_monitors_ready_for_capops() == 1) {
DEBUG_CAPOPS("%s: only one monitor: do simpler revoke\n",
__FUNCTION__);
// no remote monitors exist; do simplified revocation process
static void
revoke_no_remote(struct revoke_master_st *st)
{
- assert(num_monitors_online() == 1);
+ assert(num_monitors_ready_for_capops() == 1);
if (!delete_steps_get_waitset()) {
delete_steps_init(get_default_waitset());
*/
/*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011, ETH Zurich.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2016, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
/* octopus_client.c */
errval_t octopus_client_bind(void);
-size_t num_monitors_online(void);
errval_t octopus_set_bspkcb(void);
#endif // MONITOR_H
return st.err;
}
-size_t num_monitors_online(void)
-{
- errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
- if (r == NULL) {
- err = octopus_client_bind();
- if (err_is_fail(err)) {
- DEBUG_ERR(err, "octopus_client_bind");
- debug_printf("no connection to octopus, num_monitors=1\n");
- return 1;
- }
- r = get_octopus_rpc_client();
- }
- assert(r != NULL);
-
- char** names = NULL;
- size_t count = 0;
-
- static char* spawnds = "r'spawn.[0-9]+' { iref: _ }";
- struct octopus_get_names_response__rx_args reply;
- err = r->vtbl.get_names(r, spawnds, NOP_TRIGGER, reply.output,
- &reply.tid, &reply.error_code);
- if (err_is_fail(err) || err_is_fail(reply.error_code)) {
- err = err_push(err, SPAWN_ERR_FIND_SPAWNDS);
- goto out;
- }
-
- err = oct_parse_names(reply.output, &names, &count);
- if (err_is_fail(err)) {
- goto out;
- }
-
-out:
- oct_free_names(names, count);
- if (err_is_fail(err)) {
- DEBUG_ERR(err, "num_spawnds_online");
- debug_printf("error in octopus, setting num_monitors=1\n");
- return 1;
- }
- return count;
-}
-
errval_t octopus_set_bspkcb(void)
{
errval_t err, octerr;