diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2023-03-02 18:57:52 -0800 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2023-03-07 20:44:08 +0000 |
commit | 7ea0c33deffbbfc6b378f51503139aaa036322d6 (patch) | |
tree | 26a9d3f54ddc31d706147b59932459b4aed8f60a /gdbstub/user.c | |
parent | 589a58672e044c0415e70f018393c8406cdd5c49 (diff) |
gdbstub: introduce gdb_get_max_cpus
This is needed for handling vcont packets as the way of calculating
max cpus vhanges between user and softmmu mode.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230302190846.2593720-17-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-17-richard.henderson@linaro.org>
Diffstat (limited to 'gdbstub/user.c')
-rw-r--r-- | gdbstub/user.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gdbstub/user.c b/gdbstub/user.c index 92663d971c..e10988a62b 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -394,6 +394,23 @@ int gdb_target_memory_rw_debug(CPUState *cpu, hwaddr addr, } /* + * cpu helpers + */ + +unsigned int gdb_get_max_cpus(void) +{ + CPUState *cpu; + unsigned int max_cpus = 1; + + CPU_FOREACH(cpu) { + max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus; + } + + return max_cpus; +} + + +/* * Break/Watch point helpers */ |