Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.6' into 2.7
Browse files Browse the repository at this point in the history
Conflicts:
	src/rtapi/sim_rtapi_app.cc (renamed to uspace_rtapi_app.cc)
  • Loading branch information
SebKuzminsky committed Sep 10, 2015
2 parents 99e68e5 + b4eb195 commit 84b3873
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/rtapi/uspace_rtapi_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,31 @@ static int do_load_cmd(string name, vector<string> args) {
void *module = modules[name] = dlopen(what, RTLD_GLOBAL | RTLD_NOW);
if(!module) {
rtapi_print_msg(RTAPI_MSG_ERR, "%s: dlopen: %s\n", name.c_str(), dlerror());
modules.erase(name);
return -1;
}
/// XXX handle arguments
int (*start)(void) = DLSYM<int(*)(void)>(module, "rtapi_app_main");
if(!start) {
rtapi_print_msg(RTAPI_MSG_ERR, "%s: dlsym: %s\n", name.c_str(), dlerror());
dlclose(module);
modules.erase(name);
return -1;
}
int result;

result = do_comp_args(module, args);
if(result < 0) { dlclose(module); return -1; }
if(result < 0) {
dlclose(module);
modules.erase(name);
return -1;
}

if ((result=start()) < 0) {
rtapi_print_msg(RTAPI_MSG_ERR, "%s: rtapi_app_main: %s (%d)\n",
name.c_str(), strerror(-result), result);
dlclose(module);
modules.erase(name);
return result;
} else {
instance_count ++;
Expand Down
2 changes: 2 additions & 0 deletions tests/loadrt.2/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
and2.0 or2.0 streamer.0
and2.0.in0 and2.0.in1 and2.0.out or2.0.in0 or2.0.in1 or2.0.out streamer.0.curr-depth streamer.0.empty streamer.0.enable streamer.0.pin.0 streamer.0.underruns
7 changes: 7 additions & 0 deletions tests/loadrt.2/loadrt.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
loadrt or2
loadrt streamer # this fails, streamer needs depth= and cfg= params
loadrt streamer depth=10 cfg=f # this should work
loadrt and2

list funct
list pin
4 changes: 4 additions & 0 deletions tests/loadrt.2/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

halrun -k loadrt.hal || true

0 comments on commit 84b3873

Please sign in to comment.