本文整理汇总了C++中USER_PANIC_ERR函数的典型用法代码示例。如果您正苦于以下问题:C++ USER_PANIC_ERR函数的具体用法?C++ USER_PANIC_ERR怎么用?C++ USER_PANIC_ERR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USER_PANIC_ERR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fsb_init_msg
static void fsb_init_msg(struct bench_binding *b, coreid_t id)
{
errval_t err;
// change waitset of the binding
waitset_init(&signal_waitset);
err = b->change_waitset(b, &signal_waitset);
assert(err_is_ok(err));
binding = b;
reply_received = true;
#if CONFIG_TRACE
// configure tracing
err = trace_control(TRACE_EVENT(TRACE_SUBSYS_MULTIHOP,
TRACE_EVENT_MULTIHOP_BENCH_START, 0),
TRACE_EVENT(TRACE_SUBSYS_MULTIHOP,
TRACE_EVENT_MULTIHOP_BENCH_STOP, 0), 0);
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "trace_control failed");
}
#endif
// start tracing
err = trace_event(TRACE_SUBSYS_MULTIHOP, TRACE_EVENT_MULTIHOP_BENCH_START,
0);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "trace_event failed");
}
experiment();
}
示例2: domain_mgmt_init
void domain_mgmt_init(void)
{
errval_t err;
/* Register notification endpoint with kernel */
struct capref epcap;
struct lmp_endpoint *notifyep;
// XXX: This has to be huge so we can receive a batch of
// notifications when deleting CNodes recursively.
err = endpoint_create(100 * 12, &epcap, ¬ifyep);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed creating endpoint");
}
// register to receive on this endpoint
struct event_closure cl = {
.handler = handle_notification,
.arg = notifyep,
};
err = lmp_endpoint_register(notifyep, get_default_waitset(), cl);
assert(err_is_ok(err));
err = invoke_monitor_register(epcap);
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "Could not register with kernel");
}
else {
#ifdef DEBUG_MONITOR_ALL
debug_printf("monitor ep registered\n");
#endif
}
}
示例3: monitor_bind_ump_client_request_error
static void monitor_bind_ump_client_request_error(struct monitor_binding *b,
struct capref frame,
uintptr_t conn_id,
uintptr_t domain_id,
errval_t err)
{
errval_t err2;
err2 = cap_destroy(frame);
if (err_is_fail(err2)) {
USER_PANIC_ERR(err, "cap_destroy failed");
}
if (conn_id != 0) {
err2 = remote_conn_free(conn_id);
if (err_is_fail(err2)) {
USER_PANIC_ERR(err2, "remote_conn_free failed");
}
}
err2 = b->tx_vtbl.bind_ump_reply_client(b, NOP_CONT, 0, domain_id, err,
NULL_CAP);
if (err_is_fail(err2)) {
USER_PANIC_ERR(err2, "error reply failed");
}
}
示例4: update_owner__rx_handler
void
update_owner__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st)
{
errval_t err;
struct intermon_state *inter_st = (struct intermon_state*)b->st;
coreid_t from = inter_st->core_id;
struct capref capref;
struct capability cap;
caprep_to_capability(&caprep, &cap);
err = slot_alloc(&capref);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to allocate slot for owner update");
}
err = monitor_copy_if_exists(&cap, capref);
if (err_is_ok(err)) {
err = monitor_set_cap_owner(cap_root, get_cap_addr(capref),
get_cap_valid_bits(capref), from);
}
if (err_no(err) == SYS_ERR_CAP_NOT_FOUND) {
err = SYS_ERR_OK;
}
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to update cap ownership");
}
cap_destroy(capref);
err = owner_updated(from, st);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to send ownership update response");
}
}
示例5: find_descendants__rx_handler
void
find_descendants__rx_handler(struct intermon_binding *b, intermon_caprep_t caprep, genvaddr_t st)
{
errval_t err;
struct intermon_state *inter_st = (struct intermon_state*)b->st;
coreid_t from = inter_st->core_id;
struct capability cap;
caprep_to_capability(&caprep, &cap);
bool has_descendants;
err = monitor_has_descendants(&cap, &has_descendants);
assert(err_is_ok(err));
struct find_descendants_result_msg_st *msg_st;
msg_st = malloc(sizeof(*msg_st));
if (!msg_st) {
err = LIB_ERR_MALLOC_FAIL;
USER_PANIC_ERR(err, "could not alloc find_descendants_result_msg_st");
}
msg_st->queue_elem.cont = find_descendants_result_send_cont;
msg_st->st = st;
if (err_is_ok(err)) {
err = has_descendants ? SYS_ERR_OK : SYS_ERR_CAP_NOT_FOUND;
}
msg_st->status = err;
err = capsend_target(from, (struct msg_queue_elem*)msg_st);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "could not enqueue find_descendants_result msg");
}
}
示例6: ipi_alloc_notify_reply_cont
static void ipi_alloc_notify_reply_cont(struct monitor_binding *b,
uintptr_t state,
struct capref notify_cap,
errval_t reterr)
{
errval_t err =
b->tx_vtbl.ipi_alloc_notify_reply(b, NOP_CONT, state,
notify_cap, reterr);
if(err_is_fail(err)) {
if (err_no(err) == FLOUNDER_ERR_TX_BUSY) {
struct monitor_state *st = b->st;
struct ipi_alloc_notify_reply_state *me =
malloc(sizeof(struct ipi_alloc_notify_reply_state));
assert(me != NULL);
me->args.state = state;
me->args.notify = notify_cap;
me->args.err = reterr;
me->elem.cont = ipi_alloc_notify_reply_handler;
err = monitor_enqueue_send(b, &st->queue,
get_default_waitset(), &me->elem.queue);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "monitor_enqueue_send failed");
}
return;
}
USER_PANIC_ERR(err, "sending reply");
}
assert(err_is_ok(err));
}
示例7: ms_multiboot_cap_request
static void ms_multiboot_cap_request(struct monitor_binding *b, cslot_t slot)
{
errval_t err1, err2;
struct capref cap = {
.cnode = cnode_module,
.slot = slot,
};
// Call frame_identify to check if cap exists
struct frame_identity id;
err1 = invoke_frame_identify(cap, &id);
if (err_is_fail(err1)) {
err2 = b->tx_vtbl.multiboot_cap_reply(b, NOP_CONT, NULL_CAP, err1);
} else {
err2 = b->tx_vtbl.multiboot_cap_reply(b, NOP_CONT, cap, err1);
}
if (err_is_fail(err2)) {
if (err_no(err2) == FLOUNDER_ERR_TX_BUSY) {
struct monitor_state *mon_state = b->st;
struct multiboot_cap_state *ms =
malloc(sizeof(struct multiboot_cap_state));
assert(ms);
ms->slot = slot;
ms->elem.cont = ms_multiboot_cap_request_handler;
err1 = monitor_enqueue_send(b, &mon_state->queue,
get_default_waitset(), &ms->elem.queue);
if (err_is_fail(err1)) {
USER_PANIC_ERR(err1, "monitor_enqueue_send failed");
}
} else {
USER_PANIC_ERR(err2, "sending multiboot_cap_reply failed");
}
}
}
示例8: get_io_cap
static void get_io_cap(struct monitor_blocking_binding *b)
{
// XXX: We should not just hand out this cap to everyone
// who requests it. There is currently no way to determine
// if the client is a valid recipient
errval_t err;
struct capref src = {
.cnode = cnode_task,
.slot = TASKCN_SLOT_IO
};
err = b->tx_vtbl.get_io_cap_response(b, NOP_CONT, src,
SYS_ERR_OK);
if (err_is_fail(err)) {
if (err_no(err) == FLOUNDER_ERR_TX_BUSY) {
err = b->register_send(b, get_default_waitset(),
MKCONT((void (*)(void *))get_io_cap, b));
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "register_send failed");
}
}
USER_PANIC_ERR(err, "sending get_io_cap_response failed");
}
}
示例9: main
int main(int argc,
char **argv)
{
errval_t err;
debug_printf("Inter Card Transfer Test started.\n");
coreid_t core = 2;
char *name = "k1om/sbin/xeon_phi_inter";
xphi_dom_id_t domid0;
err = xeon_phi_client_spawn(0, core, name, NULL, NULL_CAP, &domid0);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "could not send the spawn message");
}
xphi_dom_id_t domid1;
err = xeon_phi_client_spawn(1, core, name, NULL, NULL_CAP, &domid1);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "could not send the spawn message");
}
debug_printf("Inter Card Transfer Test: Main Loop\n");
messages_handler_loop();
debug_printf("Terminated.\n");
}
示例10: spawn_child
static errval_t spawn_child(int rfd)
{
errval_t err;
char *argv[2] = { "net-test", NULL };
domainid_t new_domain = -1;
coreid_t core = 0;
struct capref fdcap;
err = spawn_setup_fds(&fdcap, rfd);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "spawn_setup_fds");
}
struct capref inheritcn_cap;
err = alloc_inheritcn_with_caps(&inheritcn_cap, fdcap, NULL_CAP, NULL_CAP);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to setup inheritcn");
}
err = spawn_program_with_caps(core, argv[0], argv, NULL, inheritcn_cap,
NULL_CAP, SPAWN_FLAGS_NEW_DOMAIN, &new_domain);
if (err_is_fail(err)) {
DEBUG_ERR(err, "failed spawn on core %d", core);
return err;
}
return SYS_ERR_OK;
}
示例11: run_worker
static int run_worker(coreid_t mycore)
{
errval_t err;
trace_event(TRACE_SUBSYS_MEMTEST, TRACE_EVENT_MEMTEST_WAIT, 0);
err = ns_barrier_worker((int)mycore, "mem_bench_ready");
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "barrier_worker failed");
}
trace_event(TRACE_SUBSYS_MEMTEST, TRACE_EVENT_MEMTEST_RUN, 0);
run_benchmark(mycore, MAX_REQUESTS);
trace_event(TRACE_SUBSYS_MEMTEST, TRACE_EVENT_MEMTEST_WAIT, 0);
err = ns_barrier_worker((int)mycore, "mem_bench_finished");
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "barrier_worker failed");
}
trace_event(TRACE_SUBSYS_MEMTEST, TRACE_EVENT_MEMTEST_DONE, 0);
return EXIT_SUCCESS;
}
示例12: alloc_iref_reply_cont
static void alloc_iref_reply_cont(struct monitor_binding *b,
uintptr_t service_id,
iref_t iref, errval_t reterr)
{
errval_t err;
err = b->tx_vtbl.alloc_iref_reply(b, NOP_CONT, service_id, iref, reterr);
if (err_is_fail(err)) {
if(err_no(err) == FLOUNDER_ERR_TX_BUSY) {
struct alloc_iref_reply_state *me =
malloc(sizeof(struct alloc_iref_reply_state));
assert(me != NULL);
struct monitor_state *ist = b->st;
assert(ist != NULL);
me->args.service_id = service_id;
me->args.iref = iref;
me->args.err = reterr;
me->b = b;
me->elem.cont = alloc_iref_reply_handler;
err = monitor_enqueue_send(b, &ist->queue,
get_default_waitset(), &me->elem.queue);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "monitor_enqueue_send failed");
}
return;
}
USER_PANIC_ERR(err, "reply failed");
}
}
示例13: send_message_client
// send single message over TCP connection
int send_message_client(void *msg, size_t len)
{
err_t err;
// printf("send_message(pcb: %p, msg: %p, len: %d)\n",
// pcb, msg, (int)len);
if (len > 0) {
assert(tcp_sndbuf(client_pcb) >= len);
err = tcp_write(client_pcb, msg, len, TCP_WRITE_FLAG_COPY);
if (err != ERR_OK) {
USER_PANIC_ERR(err, "tcp_write failed in send_message");
return -1;
}
}
// FIXME: Do I need this?
err = tcp_output(client_pcb);
if (err != ERR_OK) {
USER_PANIC_ERR(err, "tcp_write failed in send_message");
return -1;
}
// printf("done send_message()\n");
return 0;
} // end function: send_message_client
示例14: export_cb
static void export_cb(void *st, errval_t err, iref_t iref)
{
size_t size = 0;
char *service_name = NULL;
char *driver_name = (char *) st;
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "Exporting basic interface failed.\n");
}
// build service name as driver_name.SERVICE_SUFFIX
size = snprintf(NULL, 0, "%s.%s", driver_name, SERVICE_SUFFIX);
service_name = (char *) malloc(size + 1);
if (service_name == NULL) {
USER_PANIC("Error allocating memory.");
}
snprintf(service_name, size + 1, "%s.%s", driver_name, SERVICE_SUFFIX);
SERIAL_DEBUG("About to register basic interface '%s' at nameservice.\n",
service_name);
// register basic serial driver service at nameservice
err = nameservice_register(service_name, iref);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "Registering basic interface at "
"nameserver failed.");
}
free(service_name);
}
示例15: export_cb
static void export_cb(void *st, errval_t err, iref_t iref)
{
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "export failed");
}
// construct name
char namebuf[32];
size_t len = snprintf(namebuf, sizeof(namebuf), "%s.%d", SERVICE_BASENAME,
my_core_id);
assert(len < sizeof(namebuf));
namebuf[sizeof(namebuf) - 1] = '\0';
// register this iref with the name service
err = nameservice_register(namebuf, iref);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "nameservice_register failed");
}
#if !defined(USE_KALUGA_DVM) || defined(__arm__) || defined(__scc__) || defined(__k1om__)
// let the master know we are ready
err = nsb_register_n(my_core_id, SERVICE_BASENAME);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "nsb_register_n failed");
}
// wait for boot to finish
err = nsb_wait(ALL_SPAWNDS_UP);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed ns barrier wait for %s", ALL_SPAWNDS_UP);
}
// debug_printf("got \"%s\", continuing\n", ALL_SPAWNDS_UP);
#endif
}