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/cactus/cactus_def.h b/spm/cactus/cactus_def.h
index ef813d2..13b5dac 100644
--- a/spm/cactus/cactus_def.h
+++ b/spm/cactus/cactus_def.h
@@ -52,6 +52,8 @@
#define CACTUS_PRINT_MAGIC U(1)
/* Return a magic number unique to Cactus */
#define CACTUS_GET_MAGIC U(2)
+/* Sleep for a number of milliseconds */
+#define CACTUS_SLEEP_MS U(3)
#define CACTUS_MAGIC_NUMBER U(0x12481369)
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c
index bfbfa48..a062ef0 100644
--- a/spm/cactus/cactus_main.c
+++ b/spm/cactus/cactus_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>
#include <std_svc.h>
@@ -70,6 +71,11 @@
ret0 = SPRT_SUCCESS;
break;
+ case CACTUS_SLEEP_MS:
+ sp_sleep(message->args[2]);
+ ret0 = SPRT_SUCCESS;
+ break;
+
default:
NOTICE("Cactus: Unhandled Service ID 0x%x\n",
(unsigned int)message->args[1]);