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
This commit is contained in:
@@ -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[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user