int cnt_init ( struct cnt_pool *pool, unsigned int max, CNT_SOCK_OPT cso_open, CNT_SOCK_OPT cso_exit ) { memset(pool, 0, sizeof(struct cnt_pool)); pool->max = max; pool->use = 0; pool->cso_open = cso_open; pool->cso_exit = cso_exit; free_queue_init(&pool->qlist, sizeof(uintptr_t *), max); assert( cso_open && cso_exit ); return 0; }
void wrapper_input() { uint32_t buf; int word; global_storage_initializer_(); free_queue_init(); while (1) { buf = ahir_packet_get(); receive_packet(buf); // in wrapper_lib.aa // Write out packet to FromFPGA element. write_uintptr("fromfpga_in0", (uint32_t*) buf); } }