Set tr mux output to unknown subsystem on NULL
This commit is contained in:
parent
a827113c2a
commit
1582a60522
@ -114,6 +114,23 @@ select_tr(struct mux *mux, struct value value, struct mux_input **input)
|
|||||||
in_body = 0;
|
in_body = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!in_body) {
|
||||||
|
/* Only select ss if not NULL */
|
||||||
|
struct value ss;
|
||||||
|
struct mux_input *ssinput = mux_get_input(mux, 0);
|
||||||
|
if (chan_read(ssinput->chan, &ss) != 0) {
|
||||||
|
err("chan_read failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't select anything, so the default output is shown */
|
||||||
|
if (ss.type == VALUE_NULL) {
|
||||||
|
dbg("not selecting anything");
|
||||||
|
*input = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int64_t i = in_body;
|
int64_t i = in_body;
|
||||||
char *inputs[] = { "subsystem", "task_type" };
|
char *inputs[] = { "subsystem", "task_type" };
|
||||||
dbg("selecting input %ld (%s)", i, inputs[i]);
|
dbg("selecting input %ld (%s)", i, inputs[i]);
|
||||||
@ -125,7 +142,8 @@ select_tr(struct mux *mux, struct value value, struct mux_input **input)
|
|||||||
static int
|
static int
|
||||||
select_idle(struct mux *mux, struct value value, struct mux_input **input)
|
select_idle(struct mux *mux, struct value value, struct mux_input **input)
|
||||||
{
|
{
|
||||||
dbg("value is %s", value_str(value));
|
dbg("selecting tri output for value %s", value_str(value));
|
||||||
|
|
||||||
if (value.type == VALUE_INT64 && value.i == ST_WORKER_IDLE) {
|
if (value.type == VALUE_INT64 && value.i == ST_WORKER_IDLE) {
|
||||||
dbg("selecting input 1 (idle)");
|
dbg("selecting input 1 (idle)");
|
||||||
*input = mux_get_input(mux, 1);
|
*input = mux_get_input(mux, 1);
|
||||||
@ -165,6 +183,9 @@ connect_cpu(struct bay *bay, struct nanos6_cpu *mcpu)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Emit unknown subsystem on NULL */
|
||||||
|
mux_set_default(&bcpu->mux0, value_int64(ST_UNKNOWN_SS));
|
||||||
|
|
||||||
/* Connect mux 1 using idle as select */
|
/* Connect mux 1 using idle as select */
|
||||||
if (mux_init(&bcpu->mux1, bay, idle, tri, select_idle, 2) != 0) {
|
if (mux_init(&bcpu->mux1, bay, idle, tri, select_idle, 2) != 0) {
|
||||||
err("mux_init failed");
|
err("mux_init failed");
|
||||||
|
Loading…
Reference in New Issue
Block a user