Core: Rename services to partitions in SPM

To get closer to the terminology used in PSA, the symbols that in the
current TF-M terminology refer to services, should be changed to refer
to partitions. This commit does this renaming in SPM, and also updates
files that reference the changed symbols.

Change-Id: Id76f179846cbc11c600a5e72d15b99afc379d1fd
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/secure_fw/spm/spm_api.h b/secure_fw/spm/spm_api.h
index 92263f7..ca4994c 100644
--- a/secure_fw/spm/spm_api.h
+++ b/secure_fw/spm/spm_api.h
@@ -14,229 +14,231 @@
 
 enum spm_err_t {
     SPM_ERR_OK = 0,
-    SPM_ERR_SERV_DB_NOT_INIT,
-    SPM_ERR_SERV_ALREADY_ACTIVE,
-    SPM_ERR_SERV_NOT_AVAILABLE,
+    SPM_ERR_PARTITION_DB_NOT_INIT,
+    SPM_ERR_PARTITION_ALREADY_ACTIVE,
+    SPM_ERR_PARTITION_NOT_AVAILABLE,
     SPM_ERR_INVALID_CONFIG,
 };
 
 enum spm_part_state_t {
-    SPM_PART_STATE_UNINIT = 0,
-    SPM_PART_STATE_IDLE,
-    SPM_PART_STATE_RUNNING,
-    SPM_PART_STATE_SUSPENDED,
-    SPM_PART_STATE_BLOCKED,
-    SPM_PART_STATE_CLOSED,
+    SPM_PARTITION_STATE_UNINIT = 0,
+    SPM_PARTITION_STATE_IDLE,
+    SPM_PARTITION_STATE_RUNNING,
+    SPM_PARTITION_STATE_SUSPENDED,
+    SPM_PARTITION_STATE_BLOCKED,
+    SPM_PARTITION_STATE_CLOSED
 };
 
 /**
- * \brief Configure isolated sandbox for a service
+ * \brief Configure isolated sandbox for a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
  * \return Error code \ref spm_err_t
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-enum spm_err_t tfm_spm_service_sandbox_config(uint32_t service_id);
+enum spm_err_t tfm_spm_partition_sandbox_config(uint32_t partition_id);
 
 /**
- * \brief Deconfigure sandbox for a service
+ * \brief Deconfigure sandbox for a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
  * \return Error code \ref spm_err_t
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-enum spm_err_t tfm_spm_service_sandbox_deconfig(uint32_t service_id);
+enum spm_err_t tfm_spm_partition_sandbox_deconfig(uint32_t partition_id);
 
 /**
  * \brief Get saved stack pointer for a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
  * \return Stack pointer value
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_stack(uint32_t service_id);
+uint32_t tfm_spm_partition_get_stack(uint32_t partition_id);
 
 /**
- * \brief Get bottom of stack region for a service
+ * \brief Get bottom of stack region for a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
  * \return Stack region bottom value
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_stack_bottom(uint32_t service_id);
+uint32_t tfm_spm_partition_get_stack_bottom(uint32_t partition_id);
 
 /**
- * \brief Get top of stack region for a service
+ * \brief Get top of stack region for a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
  * \return Stack region top value
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_stack_top(uint32_t service_id);
+uint32_t tfm_spm_partition_get_stack_top(uint32_t partition_id);
 
 /**
- * \brief Get the current state of a service
+ * \brief Get the current state of a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \return The state of the specified service
+ * \return The state of the specified partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  * \note The returned value has the value set of \ref spm_part_state_t.
  */
-uint32_t tfm_spm_service_get_state(uint32_t service_id);
+uint32_t tfm_spm_partition_get_state(uint32_t partition_id);
 
 /**
- * \brief Get the Id of the caller of the service given
+ * \brief Get the Id of the caller of the partition given
  *
- * \param[in] service_id     Service id to get the caller of
+ * \param[in] partition_id     Partition id to get the caller of
  *
- * \return The Id of the caller service
+ * \return The Id of the caller partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_caller_service_id(uint32_t service_id);
+uint32_t tfm_spm_partition_get_caller_partition_id(uint32_t partition_id);
 
 /**
- * \brief Get the original PSP of the service
+ * \brief Get the original PSP of the partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \return The original PSP of the service
+ * \return The original PSP of the partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_orig_psp(uint32_t service_id);
+uint32_t tfm_spm_partition_get_orig_psp(uint32_t partition_id);
 
 /**
- * \brief Get the original PSP limit of the service
+ * \brief Get the original PSP limit of the partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \return The original PSP limit of the service
+ * \return The original PSP limit of the partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_orig_psplim(uint32_t service_id);
+uint32_t tfm_spm_partition_get_orig_psplim(uint32_t partition_id);
 
 /**
- * \brief Get the original link register value of the service
+ * \brief Get the original link register value of the partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \return The original link register value of the service
+ * \return The original link register value of the partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-uint32_t tfm_spm_service_get_orig_lr(uint32_t service_id);
+uint32_t tfm_spm_partition_get_orig_lr(uint32_t partition_id);
 
 /**
- * \brief Get the buffer share region of the service
+ * \brief Get the buffer share region of the partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \return The buffer share region of the service
+ * \return The buffer share region of the partition
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  * \note The returned value has the value set of \ref tfm_buffer_share_region_e
  */
-uint32_t tfm_spm_service_get_share(uint32_t service_id);
+uint32_t tfm_spm_partition_get_share(uint32_t partition_id);
 
 /**
- * \brief Returns the id of the service that has running state
+ * \brief Returns the id of the partition that has running state
  *
- * \return The Id of the service with the running state, if there is any set.
+ * \return The Id of the partition with the running state, if there is any set.
  *         0 otherwise.
  */
-uint32_t tfm_spm_service_get_running_service_id(void);
+uint32_t tfm_spm_partition_get_running_partition_id(void);
 
 /**
- * \brief Save stack pointer for service in database
+ * \brief Save stack pointer for partition in database
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] stack_ptr      Stack pointer to be stored
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-void tfm_spm_service_set_stack(uint32_t service_id, uint32_t stack_ptr);
+void tfm_spm_partition_set_stack(uint32_t partition_id, uint32_t stack_ptr);
 
 /**
- * \brief Set the current state of a service
+ * \brief Set the current state of a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] state          The state to be set
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  * \note The \ref state has to have the value set of \ref spm_part_state_t.
  */
-void tfm_spm_service_set_state(uint32_t service_id, uint32_t state);
+void tfm_spm_partition_set_state(uint32_t partition_id, uint32_t state);
 
 /**
- * \brief Set the caller service Id for a given service
+ * \brief Set the caller partition Id for a given partition
  *
- * \param[in] service_id         Service id
- * \param[in] caller_service_id  The Id of the caller service
+ * \param[in] partition_id         Partition id
+ * \param[in] caller_partition_id  The Id of the caller partition
  *
- * \note This function doesn't check if any of the service_ids is valid.
+ * \note This function doesn't check if any of the partition_ids is valid.
  */
-void tfm_spm_service_set_caller_service_id(uint32_t service_id,
-                                           uint32_t caller_service_id);
+void tfm_spm_partition_set_caller_partition_id(uint32_t partition_id,
+                                           uint32_t caller_partition_id);
 
 /**
- * \brief Set the original PSP value of a service
+ * \brief Set the original PSP value of a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] orig_psp       The PSP value to set
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-void tfm_spm_service_set_orig_psp(uint32_t service_id, uint32_t orig_psp);
+void tfm_spm_partition_set_orig_psp(uint32_t partition_id, uint32_t orig_psp);
 
 /**
- * \brief Set the original PSP limit value of a service
+ * \brief Set the original PSP limit value of a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] orig_psplim    The PSP limit value to set
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-void tfm_spm_service_set_orig_psplim(uint32_t service_id, uint32_t orig_psplim);
+void tfm_spm_partition_set_orig_psplim(uint32_t partition_id,
+                                       uint32_t orig_psplim);
 
 /**
- * \brief Set the original link register value of a service
+ * \brief Set the original link register value of a partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] orig_lr        The link register value to set
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-void tfm_spm_service_set_orig_lr(uint32_t service_id, uint32_t orig_lr);
+void tfm_spm_partition_set_orig_lr(uint32_t partition_id, uint32_t orig_lr);
 
 /**
- * \brief Set the buffer share region of the service
+ * \brief Set the buffer share region of the partition
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  * \param[in] share          The buffer share region to be set
  *
  * \return Error code \ref spm_err_t
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  * \note share has to have the value set of \ref tfm_buffer_share_region_e
  */
-enum spm_err_t tfm_spm_service_set_share(uint32_t service_id, uint32_t share);
+enum spm_err_t tfm_spm_partition_set_share(uint32_t partition_id,
+                                           uint32_t share);
 
 /**
- * \brief Initialize service database
+ * \brief Initialize partition database
  *
  * \return Error code \ref spm_err_t
  */
@@ -250,19 +252,19 @@
 enum spm_err_t tfm_spm_mpu_init(void);
 
 /**
- * \brief Execute service init function
+ * \brief Execute partition init function
  *
  * \return Error code \ref spm_err_t
  */
-enum spm_err_t tfm_spm_service_init(void);
+enum spm_err_t tfm_spm_partition_init(void);
 
 /**
- * \brief Clears the context info from the database for a service.
+ * \brief Clears the context info from the database for a partition.
  *
- * \param[in] service_id     Service id
+ * \param[in] partition_id     Partition id
  *
- * \note This function doesn't check if service_id is valid.
+ * \note This function doesn't check if partition_id is valid.
  */
-void tfm_spm_service_cleanup_context(uint32_t service_id);
+void tfm_spm_partition_cleanup_context(uint32_t partition_id);
 
 #endif /*__SPM_API_H__ */