summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-04-04 17:08:32 +0100
committerKostya Porotchkin <kostap@marvell.com>2018-04-15 14:12:25 +0300
commit2f4ff033090a09fca6b1041982e1a4924f571f6f (patch)
tree1260b5df4b51221fd7367ab802e60de06bba9446
parent31af8ba0b5e1b04f31352a4a7051e64be39cc463 (diff)
tspd:FWU:Fix usage of SMC_RET0
SMC_RET0 should only be used when the SMC code works as a function that returns void. If the code of the SMC uses SMC_RET1 to return a value to signify success and doesn't return anything in case of an error (or the other way around) SMC_RET1 should always be used to return clearly identifiable values. This patch fixes two cases in which the code used SMC_RET0 instead of SMC_RET1. It also introduces the define SMC_OK to use when an SMC must return a value to tell that it succeeded, the same way as SMC_UNK is used in case of failure. Change-Id: Ie4278b51559e4262aced13bbde4e844023270582 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/52567 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
-rw-r--r--bl1/bl1_fwu.c2
-rw-r--r--include/lib/smcc.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/bl1/bl1_fwu.c b/bl1/bl1_fwu.c
index f3338051..f913944d 100644
--- a/bl1/bl1_fwu.c
+++ b/bl1/bl1_fwu.c
@@ -108,7 +108,7 @@ register_t bl1_fwu_smc_handler(unsigned int smc_fid,
break;
}
- SMC_RET0(handle);
+ SMC_RET1(handle, SMC_UNK);
}
/*******************************************************************************
diff --git a/include/lib/smcc.h b/include/lib/smcc.h
index c415ba10..7bd9ce39 100644
--- a/include/lib/smcc.h
+++ b/include/lib/smcc.h
@@ -56,6 +56,7 @@
#define SMC_64 1
#define SMC_32 0
+#define SMC_OK 0
#define SMC_UNK 0xffffffff
#define SMC_TYPE_FAST 1
#define SMC_TYPE_STD 0