[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/18] gdbstub: deal with _cpus_ object instead of _cpu-clust
From: |
Damien Hedde |
Subject: |
[RFC PATCH 05/18] gdbstub: deal with _cpus_ object instead of _cpu-cluster_ |
Date: |
Wed, 30 Mar 2022 14:56:26 +0200 |
The gdbstub will only handle _cpus_ object having set
the _is_cluster_ flag.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
gdbstub.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index c8375e3c3f..0b3e943f95 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -38,7 +38,7 @@
#include "monitor/monitor.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
-#include "hw/cpu/cluster.h"
+#include "hw/cpu/cpus.h"
#include "hw/boards.h"
#endif
@@ -3458,9 +3458,10 @@ static const TypeInfo char_gdb_type_info = {
static int find_cpu_clusters(Object *child, void *opaque)
{
- if (object_dynamic_cast(child, TYPE_CPU_CLUSTER)) {
+ if (object_dynamic_cast(child, TYPE_CPUS) &&
+ CPUS(child)->is_cluster) {
GDBState *s = (GDBState *) opaque;
- CPUClusterState *cluster = CPU_CLUSTER(child);
+ CpusState *cluster = CPUS(child);
GDBProcess *process;
s->processes = g_renew(GDBProcess, s->processes, ++s->process_num);
@@ -3472,8 +3473,9 @@ static int find_cpu_clusters(Object *child, void *opaque)
* runtime, we enforce here that the machine does not use a cluster ID
* that would lead to PID 0.
*/
- assert(cluster->cluster_id != UINT32_MAX);
- process->pid = cluster->cluster_id + 1;
+ assert(cluster->cluster_index >= 0 &&
+ cluster->cluster_index < UINT32_MAX);
+ process->pid = cluster->cluster_index + 1;
process->attached = false;
process->target_xml[0] = '\0';
--
2.35.1
- [RFC PATCH 00/18] user-creatable cpu clusters, Damien Hedde, 2022/03/30
- [RFC PATCH 02/18] hw/cpu/cpus: introduce _cpus_ device, Damien Hedde, 2022/03/30
- [RFC PATCH 03/18] hw/cpu/cpus: prepare to handle cpu clusters, Damien Hedde, 2022/03/30
- [RFC PATCH 06/18] hw/cpu/cluster: remove cluster_id now that gdbstub is updated, Damien Hedde, 2022/03/30
- [RFC PATCH 04/18] hw/cpu/cluster: make _cpu-cluster_ a subclass of _cpus_, Damien Hedde, 2022/03/30
- [RFC PATCH 07/18] hw/cpu/cpus: add a common start-powered-off property, Damien Hedde, 2022/03/30
- [RFC PATCH 01/18] define MAX_CLUSTERS in cpu.h instead of cluster.h, Damien Hedde, 2022/03/30
- [RFC PATCH 08/18] hw/arm/arm_cpus: add arm_cpus device, Damien Hedde, 2022/03/30
- [RFC PATCH 05/18] gdbstub: deal with _cpus_ object instead of _cpu-cluster_,
Damien Hedde <=
- [RFC PATCH 09/18] hw/arm/xlnx-zynqmp: convert cpu clusters to arm_cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 10/18] hw/riscv/riscv_hart: prepare transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 11/18] hw/riscv: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 13/18] hw/riscv/spike: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 15/18] hw/riscv/sifive_uµchip_pfsoc: apply riscv_hart_array update, Damien Hedde, 2022/03/30
- [RFC PATCH 16/18] hw/riscv: update remaining machines due to riscv_hart_array update, Damien Hedde, 2022/03/30
- [RFC PATCH 14/18] hw/riscv/riscv_hart: use cpus as base class, Damien Hedde, 2022/03/30
- [RFC PATCH 17/18] hw/riscv/riscv_hart: remove temporary features, Damien Hedde, 2022/03/30
- [RFC PATCH 18/18] add myself as reviewer of the newly added _cpus_, Damien Hedde, 2022/03/30
- [RFC PATCH 12/18] hw/riscv/virt: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30