Core: Save iovec in SPM database

For each secure service call save the iovec parameters in the
partition's runtime context.
When the secure function is called, the saved iovec arguments are
passed to it on the called partition's stack.

Change-Id: I754dc330db907ce8c16d425ac9c017b53301a6b9
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/secure_fw/spm/spm_db_setup.h b/secure_fw/spm/spm_db_setup.h
index d36f8cf..e1c53d2 100644
--- a/secure_fw/spm/spm_db_setup.h
+++ b/secure_fw/spm/spm_db_setup.h
@@ -65,8 +65,13 @@
 #define PARTITION_INIT_RUNTIME_DATA(data, partition)                \
     do {                                                            \
         data.partition_state      = SPM_PARTITION_STATE_UNINIT;     \
+        /* The top of the stack is reserved for the iovec        */ \
+        /* parameters of the service called. That's why in       */ \
+        /* data.stack_ptr we extract sizeof(struct iovec_args_t) */ \
+        /* from the limit.                                       */ \
         data.stack_ptr            =                                 \
-                PART_REGION_ADDR(partition, _STACK$$ZI$$Limit);     \
+                PART_REGION_ADDR(partition, _STACK$$ZI$$Limit -     \
+                                  sizeof(struct iovec_args_t));     \
     } while (0)
 #endif