Пример #1
0
void
retrieve_result__rx(struct intermon_binding *b, errval_t status,
                    uint8_t relations, genvaddr_t st)
{
    errval_t err;
    struct retrieve_rpc_st *rst = (struct retrieve_rpc_st*)(lvaddr_t)st;

    if (err_is_fail(status)) {
        err = status;
        goto report_error;
    }

    err = monitor_domcap_remote_relations(rst->cap.croot, rst->cap.cptr,
                                          rst->cap.bits, relations, 0xFF,
                                          NULL);
    PANIC_IF_ERR(err, "setting rrels for retrieved cap");

    struct event_closure updated_cont
        = MKCONT(retrieve_ownership_update__fin, rst);
    err = capsend_update_owner(rst->cap, updated_cont);
    PANIC_IF_ERR(err, "updating retrieve ownership");

report_error:
    retrieve_ownership__rx(err, rst);
}
Пример #2
0
static void
revoke_result__rx(errval_t result,
                  struct revoke_master_st *st,
                  bool locked)
{
    DEBUG_CAPOPS("%s\n", __FUNCTION__);
    errval_t err;

    if (locked) {
        caplock_unlock(st->cap);
    }

    if (err_is_ok(result)) {
        // clear the remote copies bit
        err = monitor_domcap_remote_relations(st->cap.croot, st->cap.cptr,
                                              st->cap.bits, 0, RRELS_COPY_BIT,
                                              NULL);
        if (err_is_fail(err) && err_no(err) != SYS_ERR_CAP_NOT_FOUND) {
            DEBUG_ERR(err, "resetting remote copies bit after revoke");
        }
    }

    DEBUG_CAPOPS("%s ## revocation completed, calling %p\n", __FUNCTION__,
                 st->result_handler);

    st->result_handler(result, st->st);
    free(st);
}