From 9fb8af33c40f21becde99fc15db73b1f4d82059c Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Mon, 12 Feb 2018 12:36:17 +0000 Subject: Fix MISRA rule 8.3 in common code Rule 8.3: All declarations of an object or function shall use the same names and type qualifiers. Change-Id: Iff384187c74a598a4e73f350a1893b60e9d16cec Signed-off-by: Roberto Vargas --- include/lib/pmf/pmf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/lib/pmf') diff --git a/include/lib/pmf/pmf.h b/include/lib/pmf/pmf.h index cdff7635..a3d32263 100644 --- a/include/lib/pmf/pmf.h +++ b/include/lib/pmf/pmf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -162,7 +162,7 @@ int pmf_get_timestamp_smc(unsigned int tid, u_register_t mpidr, unsigned int flags, - unsigned long long *ts); + unsigned long long *ts_value); int pmf_setup(void); uintptr_t pmf_smc_handler(unsigned int smc_fid, u_register_t x1, -- cgit v1.2.3 From 1af540ef2a09797c3a22c40c340facd4b2f47c2f Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Mon, 12 Feb 2018 12:36:17 +0000 Subject: Fix MISRA rule 8.4 Part 1 Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined Fixed for: make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all Change-Id: I7c2ad3f5c015411c202605851240d5347e4cc8c7 Signed-off-by: Roberto Vargas --- include/lib/pmf/pmf_helpers.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include/lib/pmf') diff --git a/include/lib/pmf/pmf_helpers.h b/include/lib/pmf/pmf_helpers.h index 9984d691..829ad6cc 100644 --- a/include/lib/pmf/pmf_helpers.h +++ b/include/lib/pmf/pmf_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -45,8 +45,11 @@ typedef struct pmf_svc_desc { /* * Convenience macro to allocate memory for a PMF service. + * + * The extern declaration is there to satisfy MISRA C-2012 rule 8.4. */ #define PMF_ALLOCATE_TIMESTAMP_MEMORY(_name, _total_id) \ + extern unsigned long long pmf_ts_mem_ ## _name[_total_id]; \ unsigned long long pmf_ts_mem_ ## _name[_total_id] \ __aligned(CACHE_WRITEBACK_GRANULE) \ __section("pmf_timestamp_array") \ @@ -60,8 +63,13 @@ typedef struct pmf_svc_desc { /* * Convenience macros for capturing time-stamp. + * + * The extern declaration is there to satisfy MISRA C-2012 rule 8.4. */ #define PMF_DEFINE_CAPTURE_TIMESTAMP(_name, _flags) \ + void pmf_capture_timestamp_ ## _name( \ + unsigned int tid, \ + unsigned long long ts); \ void pmf_capture_timestamp_ ## _name( \ unsigned int tid, \ unsigned long long ts) \ @@ -74,6 +82,9 @@ typedef struct pmf_svc_desc { if ((_flags) & PMF_DUMP_ENABLE) \ __pmf_dump_timestamp(tid, ts); \ } \ + void pmf_capture_timestamp_with_cache_maint_ ## _name( \ + unsigned int tid, \ + unsigned long long ts); \ void pmf_capture_timestamp_with_cache_maint_ ## _name( \ unsigned int tid, \ unsigned long long ts) \ @@ -89,8 +100,12 @@ typedef struct pmf_svc_desc { /* * Convenience macros for retrieving time-stamp. + * + * The extern declaration is there to satisfy MISRA C-2012 rule 8.4. */ #define PMF_DEFINE_GET_TIMESTAMP(_name) \ + unsigned long long pmf_get_timestamp_by_index_ ## _name( \ + unsigned int tid, unsigned int cpuid, unsigned int flags);\ unsigned long long pmf_get_timestamp_by_index_ ## _name( \ unsigned int tid, unsigned int cpuid, unsigned int flags)\ { \ @@ -98,6 +113,8 @@ typedef struct pmf_svc_desc { uintptr_t base_addr = (uintptr_t) pmf_ts_mem_ ## _name; \ return __pmf_get_timestamp(base_addr, tid, cpuid, flags);\ } \ + unsigned long long pmf_get_timestamp_by_mpidr_ ## _name( \ + unsigned int tid, u_register_t mpidr, unsigned int flags);\ unsigned long long pmf_get_timestamp_by_mpidr_ ## _name( \ unsigned int tid, u_register_t mpidr, unsigned int flags)\ { \ -- cgit v1.2.3