{
int ret=RC_OK;
struct ext_module_list_s *ml=NULL;
-
+
if(!mod)
{
eprintf("Invalid arguments\n");
eprintf("Can't load library %s\n", libdylib_last_error());
goto out;
}
-
+
if(!libdylib_find(lib, "litex_sim_ext_module_init"))
{
ret = RC_ERROR;
struct session_s *s = (struct session_s*)arg;
char buffer[1024];
ssize_t read_len;
-
+
int i;
-
+
read_len = read(fd, buffer, 1024);
for(i = 0; i < read_len; i++)
{
{
struct session_s *s = (struct session_s*)ctx;
struct timeval tv = {1, 0};
-
+
s->fd = fd;
s->ev = event_new(base, fd, EV_READ | EV_PERSIST , event_handler, s);
- event_add(s->ev, &tv);
+ event_add(s->ev, &tv);
}
static void
fprintf(stderr, "Invalid port selected!\n");
goto out;
}
-
+
s=(struct session_s*)malloc(sizeof(struct session_s));
if(!s) {
ret = RC_NOENMEM;
eprintf("Can't bind port %d\n!\n", port);
goto out;
}
- evconnlistener_set_error_cb(listener, accept_error_cb);
-
+ evconnlistener_set_error_cb(listener, accept_error_cb);
+
out:
*sess=(void*)s;
return ret;
litex_sim_module_pads_get(pads, "source_valid", (void**)&s->tx_valid);
litex_sim_module_pads_get(pads, "source_ready", (void**)&s->tx_ready);
}
-
+
if(!strcmp(plist->name, "sys_clk"))
litex_sim_module_pads_get(pads, "sys_clk", (void**)&s->sys_clk);
out:
return ret;
-
+
}
static int serial2tcp_tick(void *sess)
{
char c;
int ret = RC_OK;
-
+
struct session_s *s = (struct session_s*)sess;
if(*s->sys_clk == 0)
return RC_OK;
goto out;
}
}
-
+
*s->rx_valid=0;
if(s->datalen) {
*s->rx=s->databuf[s->data_start];
s->datalen--;
*s->rx_valid=1;
}
-
+
out:
return ret;
}
json_object *obj;
json_object *name;
json_object *index;
-
+
struct interface_s *t_iface=NULL;
if(!interface || !iface)
eprintf("Invalid argument\n");
goto out;
}
-
+
if(!json_object_is_type(interface, json_type_array))
{
ret=RC_JSERROR;
static int module_list_free(struct module_s *mod)
{
- int ret=RC_OK;
+ int ret=RC_OK;
struct module_s *mnext;
int i;
while(mod)
tickfirst=NULL;
json_object_object_get_ex(tobj, "tickfirst", &tickfirst);
-
+
if(m)
{
goto out;
}
len = 0;
-
+
while(m->iface[len++].name);
m->niface= len-1;
m->name = strdup(json_object_get_string(name));