test: endpoint can yield cycles under RTM_FFA_DIR_REQ
An endpoint can yield CPU cycles received from a VM or SP
through a direct request message.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I69c773b1397fb8ad3639b0b9f2a7196b5d1e9c0f
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index b029819..d5d9f34 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -120,12 +120,23 @@
}
/**
- * Hints that the vCPU is willing to yield its current use of the physical CPU.
- * This call always returns FFA_SUCCESS.
+ * Hints that the vCPU is willing to yield its current use of the physical CPU
+ * and intends to be resumed at the expiration of the timeout.
+ */
+static inline struct ffa_value ffa_yield_timeout(uint32_t timeout_low,
+ uint32_t timeout_high)
+{
+ return ffa_call((struct ffa_value){.func = FFA_YIELD_32,
+ .arg2 = timeout_low,
+ .arg3 = timeout_high});
+}
+
+/**
+ * Relinquish the current physical CPU cycles back.
*/
static inline struct ffa_value ffa_yield(void)
{
- return ffa_call((struct ffa_value){.func = FFA_YIELD_32});
+ return ffa_yield_timeout(0, 0);
}
/**