void e1000n_polling_loop(struct waitset *ws) #endif { #ifndef LIBRARY struct waitset *ws = get_default_waitset(); #endif errval_t err; /* INITDEBUG("eventloop()\n"); */ while (1) { err = event_dispatch_non_block(ws); #ifdef LIBRARY check_for_free_txbufs(); #else do_pending_work_for_all(); #endif if(!use_interrupts) { check_for_new_packets(0); /* check_for_new_packets(1); */ check_for_free_txbufs(); } #ifdef LIBRARY break; #endif } }
static void eventloop_ints(void) { struct waitset *ws; INITDEBUG("eventloop_ints()\n"); ws = get_default_waitset(); while (1) { event_dispatch(ws); do_pending_work_for_all(); } }
static __attribute__((unused)) void handle_single_event_nonblock(struct waitset *ws) { errval_t err; while (1) { do_pending_work_for_all(); err = event_dispatch_non_block(ws); // nonblocking for polling mode if (err != LIB_ERR_NO_EVENT && err_is_fail(err)) { ETHERSRV_DEBUG("Error in event_dispatch_non_block, returned %d\n", (unsigned int)err); // There should be a serious panic and failure here USER_PANIC_ERR(err, "event_dispatch_non_block failed in handle_single_event\n"); break; } else { // Successfully handled the event return; } } // end while: infinite } // end function: handle_single_event_nonblock