Introduce vcpu_lock_both
Create vcpu_lock_both acquiring two vCPU locks and storing in a common
two_vcpu_locked structure.
Change-Id: I65cc22d33c9707a9c3c67e22cdc3ad4b01bee53a
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/inc/hf/vcpu.h b/inc/hf/vcpu.h
index 834f87f..6d12679 100644
--- a/inc/hf/vcpu.h
+++ b/inc/hf/vcpu.h
@@ -84,7 +84,14 @@
struct vcpu *vcpu;
};
+/** Container for two vcpu_locked structures. */
+struct two_vcpu_locked {
+ struct vcpu_locked vcpu1;
+ struct vcpu_locked vcpu2;
+};
+
struct vcpu_locked vcpu_lock(struct vcpu *vcpu);
+struct two_vcpu_locked vcpu_lock_both(struct vcpu *vcpu1, struct vcpu *vcpu2);
void vcpu_unlock(struct vcpu_locked *locked);
void vcpu_init(struct vcpu *vcpu, struct vm *vm);
void vcpu_on(struct vcpu_locked vcpu, ipaddr_t entry, uintreg_t arg);