From 31d6eb076c317d3c69b8eab120f2128935ab443f Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 10 Jun 2024 17:32:40 +0200 Subject: [PATCH] Add unknown subsystem state for nOS-V breakdown It will appear when the emulator knows that a thread is running in the CPU, but no subsystem has been entered yet. This is common a instrumentation level lower than 3 in nOS-V. --- src/emu/nosv/breakdown.c | 6 +++--- src/emu/nosv/nosv_priv.h | 1 + src/emu/nosv/setup.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emu/nosv/breakdown.c b/src/emu/nosv/breakdown.c index 2a3d81b..da23448 100644 --- a/src/emu/nosv/breakdown.c +++ b/src/emu/nosv/breakdown.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ #include "breakdown.h" @@ -181,8 +181,8 @@ connect_cpu(struct bay *bay, struct nosv_cpu *mcpu) return -1; } - /* TODO what do we emit on null? */ - mux_set_default(&bcpu->mux0, value_int64(666)); + /* Emit unknown subsystem on NULL */ + mux_set_default(&bcpu->mux0, value_int64(ST_UNKNOWN_SS)); /* Connect mux 1 using idle as select */ if (mux_init(&bcpu->mux1, bay, idle, tri, select_idle, 2) != 0) { diff --git a/src/emu/nosv/nosv_priv.h b/src/emu/nosv/nosv_priv.h index 29edd61..48d4de3 100644 --- a/src/emu/nosv/nosv_priv.h +++ b/src/emu/nosv/nosv_priv.h @@ -24,6 +24,7 @@ enum nosv_chan { }; enum nosv_ss_values { + ST_UNKNOWN_SS = 2, ST_SCHED_HUNGRY = 6, ST_SCHED_SERVING, ST_SCHED_SUBMITTING, diff --git a/src/emu/nosv/setup.c b/src/emu/nosv/setup.c index 5539e5c..4618cef 100644 --- a/src/emu/nosv/setup.c +++ b/src/emu/nosv/setup.c @@ -141,6 +141,7 @@ static const char *pcf_prefix[CH_MAX] = { }; static const struct pcf_value_label nosv_ss_values[] = { + { ST_UNKNOWN_SS, "Unknown subsystem" }, { ST_SCHED_HUNGRY, "Scheduler: Hungry" }, { ST_SCHED_SERVING, "Scheduler: Serving" }, { ST_SCHED_SUBMITTING, "Scheduler: Submitting" },