aboutsummaryrefslogtreecommitdiff
path: root/src/target/smp.h
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-12-16 01:59:14 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2022-02-14 15:10:10 +0000
commit16cc853bcfbcc8dba6eadd91b434c05387034c0a (patch)
treecee31fec1a5bb238ab7d1e9b0170edbfdfc2ffa2 /src/target/smp.h
parent5ab74bde06541ce199390ead348a3e107ee9c0f4 (diff)
downloadriscv-openocd-16cc853bcfbcc8dba6eadd91b434c05387034c0a.zip
riscv-openocd-16cc853bcfbcc8dba6eadd91b434c05387034c0a.tar.gz
riscv-openocd-16cc853bcfbcc8dba6eadd91b434c05387034c0a.tar.bz2
target/smp: use a struct list_head to hold the smp targets
Instead of reinventing a simply linked list, reuse the list helper for the list of targets in a smp cluster. Using the existing helper, that implements a double linked list, makes trivial going through the list in reverse order. Change-Id: Ib36ad2955f15cd2a601b0b9e36ca6d948b12d00f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6783 Tested-by: jenkins
Diffstat (limited to 'src/target/smp.h')
-rw-r--r--src/target/smp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/target/smp.h b/src/target/smp.h
index 3338240..46fc55f 100644
--- a/src/target/smp.h
+++ b/src/target/smp.h
@@ -19,10 +19,11 @@
#ifndef OPENOCD_TARGET_SMP_H
#define OPENOCD_TARGET_SMP_H
+#include <helper/list.h>
#include "server/server.h"
#define foreach_smp_target(pos, head) \
- for (pos = head; (pos); pos = pos->next)
+ list_for_each_entry(pos, head, lh)
extern const struct command_registration smp_command_handlers[];