Example #1
0
int netif_event_wait(spdid_t spdid, struct cos_array *d)
{
	int ret_sz = 0;

	/* if (!cos_argreg_arr_intern(d)) return -EINVAL; */
	/* if (d->sz < MTU) return -EINVAL; */

	interrupt_wait();
	NET_LOCK_TAKE();
	if (interrupt_process(d->mem, d->sz, &ret_sz)) BUG();
	NET_LOCK_RELEASE();
	d->sz = ret_sz;

	return 0;
}
Example #2
0
File: netif.c Project: songjiguo/C3
int netif_event_wait(spdid_t spdid, char *mem, int sz)
{
	int ret_sz = 0;

	if (sz < MTU) return -EINVAL;

	/* printc("before %d: I\n", cos_get_thd_id()); */
	/* rdtscll(start); */
	interrupt_wait();
	/* rdtscll(end); */
	/* pnums++; */
	/* avg += end-start; */
	/* if (pnums%100000 == 0) { */
	/* 	printc("pnums %llu avg %llu\n", pnums, avg); */
	/* } */
	/* printc("after %d: I\n", cos_get_thd_id()); */
	NET_LOCK_TAKE();
	if (interrupt_process(mem, sz, &ret_sz)) BUG();
	interrupt_process_cnt++;
	NET_LOCK_RELEASE();

	return ret_sz;
}