コード例 #1
0
ファイル: monitor_server.c プロジェクト: CoryXie/BarrelfishOS
static void ipi_alloc_notify_request(struct monitor_binding *st,
                                     struct capref ep, uintptr_t state)
{
    errval_t err;
    struct capref notify_cap = NULL_CAP;

    // Allocate a local notify channel ID
    int chanid;
    err = notification_allocate(ep, &chanid);
    if(err_is_fail(err)) {
        goto out;
    }

    // Get my arch ID
    uintptr_t my_arch_id = 0;
    err = invoke_monitor_get_arch_id(&my_arch_id);
    assert(err == SYS_ERR_OK);

    // Create notify cap
    err = notification_create_cap(chanid, my_arch_id, &notify_cap);

 out:
    // Return the notify cap or error
    ipi_alloc_notify_reply_cont(st, state, notify_cap, err);
}
コード例 #2
0
static void get_arch_core_id(struct monitor_blocking_binding *b)
{
    static uintptr_t arch_id = -1;
    errval_t err;
//    printf("%s:%s:%d: \n", __FILE__, __FUNCTION__, __LINE__);

    if (arch_id == -1) {
        err = invoke_monitor_get_arch_id(&arch_id);
        assert(err_is_ok(err));
        assert(arch_id != -1);
    }

    err = b->tx_vtbl.get_arch_core_id_response(b, NOP_CONT, arch_id);
    assert(err_is_ok(err));
}