refactor: boot order list to use list.h
The boot order list is built using the list.h helper.
The structure list_entry uses the same type to point
to the nodes of the list. The root of the list doesn't
have any data. Any other node shall be part of a vCPU
structure whose data is returned via CONTAINER_OF
structure.
The list implementation is circular. As such, root is
also the end of the list. The last node points to the
beginning(i.e. vcpu.next_boot.next is root entry).
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Idbfaa293c74e71b989133d5828803c958855d25a
diff --git a/inc/hf/vcpu.h b/inc/hf/vcpu.h
index 91dd30f..91f168c 100644
--- a/inc/hf/vcpu.h
+++ b/inc/hf/vcpu.h
@@ -12,6 +12,7 @@
#include "hf/addr.h"
#include "hf/interrupt_desc.h"
+#include "hf/list.h"
#include "hf/spinlock.h"
#include "vmapi/hf/ffa.h"
@@ -230,7 +231,8 @@
/** Save direct response message args to be resumed later. */
struct ffa_value direct_resp_ffa_value;
- struct vcpu *next_boot;
+ /* List entry pointing to the next vCPU in the boot order list. */
+ struct list_entry boot_list_node;
};
/** Encapsulates a vCPU whose lock is held. */
@@ -262,6 +264,7 @@
void vcpu_update_boot(struct vcpu *vcpu);
struct vcpu *vcpu_get_boot_vcpu(void);
+struct vcpu *vcpu_get_next_boot(struct vcpu *vcpu);
static inline bool vcpu_is_virt_interrupt_enabled(struct interrupts *interrupts,
uint32_t intid)