SPM: Refine the get_irq_line_for_signal function
This patch moves the signal bit check from calller to
get_irq_line_for_signal().
The check should have been included in the function.
Change-Id: Ic2b850ecc02ed3ce6477781cfcf213b5aa202db7
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.c b/secure_fw/spm/cmsis_psa/spm_ipc.c
index 188c75f..b64cd1d 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.c
@@ -25,7 +25,6 @@
#include "tfm_rpc.h"
#include "tfm_core_trustzone.h"
#include "tfm_list.h"
-#include "tfm_hal_isolation.h"
#include "tfm_pools.h"
#include "region.h"
#include "region_defs.h"
@@ -878,6 +877,10 @@
{
size_t i;
+ if (!tfm_is_one_bit_set(signal)) {
+ return -1;
+ }
+
for (i = 0; i < tfm_core_irq_signals_count; ++i) {
if (tfm_core_irq_signals[i].partition_id == partition_id &&
tfm_core_irq_signals[i].signal_value == signal) {
@@ -895,11 +898,6 @@
int32_t irq_line = 0;
struct partition_t *partition = NULL;
- /* It is a fatal error if passed signal indicates more than one signals. */
- if (!tfm_is_one_bit_set(irq_signal)) {
- tfm_core_panic();
- }
-
partition = tfm_spm_get_running_partition();
if (!partition) {
tfm_core_panic();
@@ -921,11 +919,6 @@
int32_t irq_line = 0;
struct partition_t *partition = NULL;
- /* It is a fatal error if passed signal indicates more than one signals. */
- if (!tfm_is_one_bit_set(irq_signal)) {
- tfm_core_panic();
- }
-
partition = tfm_spm_get_running_partition();
if (!partition) {
tfm_core_panic();