diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-02-14 15:04:29 +0000 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2018-02-20 09:05:17 +0000 |
commit | 31c31e5fc59e738e8dc5f47e2a3ba4aa8c73634c (patch) | |
tree | ca07f69ac245c2919ad020d494128233559212b3 | |
parent | d08bc0d1013b6aa939ea1f701ae34e45da8e8246 (diff) |
Redefine SMC_UNKNOWN as -1 instead of 0xFFFFFFFF
According to the SMC Calling Convention (ARM DEN0028B):
The Unknown SMC Function Identifier is a sign-extended value of
(-1) that is returned in R0, W0 or X0 register.
The value wasn't sign-extended because it was defined as a 32-bit
unsigned value (0xffffffff).
SMC_PREEMPTED has been redefined as -2 for the same reason.
Change-Id: I4f2e0250a20bc6c996bf491bcd8b153a354f7f98
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r-- | include/common/test_helpers.h | 4 | ||||
-rw-r--r-- | include/runtime_services/secure_el1_payloads/tsp.h | 30 | ||||
-rw-r--r-- | include/runtime_services/smc.h | 30 |
3 files changed, 8 insertions, 56 deletions
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h index 5a1c593..058a5dd 100644 --- a/include/common/test_helpers.h +++ b/include/common/test_helpers.h @@ -72,7 +72,7 @@ smc_ret_values smc_ret = tftf_smc(&version_smc); \ uint32_t version = smc_ret.ret0; \ \ - if (version == SMC_UNKNOWN) { \ + if (version == (uint32_t) SMC_UNKNOWN) { \ tftf_testcase_printf("SPM not detected.\n"); \ return TEST_RESULT_SKIPPED; \ } \ @@ -84,7 +84,7 @@ smc_ret_values smc_ret = tftf_smc(&version_smc); \ uint32_t version = smc_ret.ret0; \ \ - if (version == SMC_UNKNOWN) { \ + if (version == (uint32_t) SMC_UNKNOWN) { \ tftf_testcase_printf("SPM not detected.\n"); \ return TEST_RESULT_SKIPPED; \ } \ diff --git a/include/runtime_services/secure_el1_payloads/tsp.h b/include/runtime_services/secure_el1_payloads/tsp.h index da875e7..0214fe8 100644 --- a/include/runtime_services/secure_el1_payloads/tsp.h +++ b/include/runtime_services/secure_el1_payloads/tsp.h @@ -1,31 +1,7 @@ /* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of ARM nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ /* @@ -75,7 +51,7 @@ static const uuid_t tsp_uuid = { */ #define TSP_FID_ABORT TSP_FAST_FID(0x3001) -#define TSP_SMC_PREEMPTED 0xfffffffe +#define TSP_SMC_PREEMPTED -2 /* * Total number of function IDs implemented for services offered to NS clients. diff --git a/include/runtime_services/smc.h b/include/runtime_services/smc.h index 2ce2da5..c83dea3 100644 --- a/include/runtime_services/smc.h +++ b/include/runtime_services/smc.h @@ -1,31 +1,7 @@ /* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of ARM nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __SMC_H__ @@ -36,7 +12,7 @@ #define MAKE_SMCCC_VERSION(_major, _minor) (((_major) << 16) | (_minor)) -#define SMC_UNKNOWN 0xffffffff +#define SMC_UNKNOWN -1 /******************************************************************************* * Bit definitions inside the function id as per the SMC calling convention |