cactus: ivy: Add sleep service
This service sleeps for a number of milliseconds.
Change-Id: Ib7f17142d22c8313dedc5f8037874bacbf8ed5f4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/spm/ivy/ivy_def.h b/spm/ivy/ivy_def.h
index 11eeacf..729c46d 100644
--- a/spm/ivy/ivy_def.h
+++ b/spm/ivy/ivy_def.h
@@ -41,6 +41,8 @@
#define IVY_PRINT_MAGIC U(1001)
/* Return a magic number unique to IVY */
#define IVY_GET_MAGIC U(1002)
+/* Sleep for a number of milliseconds */
+#define IVY_SLEEP_MS U(1003)
#define IVY_MAGIC_NUMBER U(0x97531842)
diff --git a/spm/ivy/ivy_main.c b/spm/ivy/ivy_main.c
index cd81e88..1f1c5e4 100644
--- a/spm/ivy/ivy_main.c
+++ b/spm/ivy/ivy_main.c
@@ -12,6 +12,7 @@
#include <pl011.h>
#include <plat_arm.h>
#include <platform_def.h>
+#include <sp_helpers.h>
#include <sprt_client.h>
#include <sprt_svc.h>
@@ -64,6 +65,11 @@
ret0 = SPRT_SUCCESS;
break;
+ case IVY_SLEEP_MS:
+ sp_sleep(message->args[2]);
+ ret0 = SPRT_SUCCESS;
+ break;
+
default:
NOTICE("IVY: Unhandled Service ID 0x%x\n",
(unsigned int)message->args[1]);