Platform: IOCTL for platform-specific services

Introduce new API function in HAL and a new generic platform
service to provide the means for platforms to implement proprietary
functions using a uniform framework and a single secure entry point.

Change-Id: I72ddbb3342ae851fe9851ccb27a54c8f4322b01f
Signed-off-by: Miklos Balint <miklos.balint@arm.com>
diff --git a/platform/include/tfm_platform_system.h b/platform/include/tfm_platform_system.h
index 411be49..8ad22b1 100644
--- a/platform/include/tfm_platform_system.h
+++ b/platform/include/tfm_platform_system.h
@@ -12,9 +12,9 @@
  *       target.
  */
 
-#include "tfm_plat_defs.h"
 #include "psa_client.h"
 #include "tfm_plat_defs.h"
+#include "tfm_platform_api.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -29,21 +29,19 @@
 void tfm_platform_hal_system_reset(void);
 
 /*!
- * \brief Performs pin services of the platform
+ * \brief Performs a platform-specific service
  *
- * \param[in]     in_vec     Pointer to in_vec array, which contains input
- *                           arguments for the pin service
- * \param[in]     num_invec  Number of elements in in_vec array
- * \param[in,out] out_vec    Pointer out_vec array, which contains output data
- *                           of the pin service
- * \param[in]     num_outvec Number of elements in out_vec array
+ * \param[in]  request      Request identifier (valid values vary
+ *                          based on the platform)
+ * \param[in]  in_vec       Input buffer to the requested service (or NULL)
+ * \param[out] out_vec      Output buffer to the requested service (or NULL)
  *
- * \return Returns values as specified by the \ref tfm_plat_err_t
+ * \return Returns values as specified by the \ref tfm_platform_err_t
  */
 TFM_LINK_SET_OBJECT_IN_PARTITION_SECTION("TFM_SP_PLATFORM")
-enum tfm_plat_err_t
-tfm_platform_hal_pin_service(const psa_invec  *in_vec,  uint32_t num_invec,
-                             const psa_outvec *out_vec, uint32_t num_outvec);
+enum tfm_platform_err_t tfm_platform_hal_ioctl(tfm_platform_ioctl_req_t request,
+                                               psa_invec *in_vec,
+                                               psa_outvec *out_vec);
 
 #ifdef __cplusplus
 }