No functional changes.
Change-Id: I64abd72026082218a40b1a4b8f7dc26ff2478ba6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
#include <cassert.h>
#include <pmf_helpers.h>
+#include <utils_def.h>
/*
* Constants used for/by PMF services.
*/
-#define PMF_ARM_TIF_IMPL_ID 0x41
+#define PMF_ARM_TIF_IMPL_ID U(0x41)
#define PMF_TID_SHIFT 0
-#define PMF_TID_MASK (0xFF << PMF_TID_SHIFT)
+#define PMF_TID_MASK (U(0xFF) << PMF_TID_SHIFT)
#define PMF_SVC_ID_SHIFT 10
-#define PMF_SVC_ID_MASK (0x3F << PMF_SVC_ID_SHIFT)
+#define PMF_SVC_ID_MASK (U(0x3F) << PMF_SVC_ID_SHIFT)
#define PMF_IMPL_ID_SHIFT 24
-#define PMF_IMPL_ID_MASK (0xFFU << PMF_IMPL_ID_SHIFT)
+#define PMF_IMPL_ID_MASK (U(0xFF) << PMF_IMPL_ID_SHIFT)
/*
* Flags passed to PMF_REGISTER_SERVICE
/*
* Defines for PMF SMC function ids.
*/
-#define PMF_SMC_GET_TIMESTAMP_32 0x82000010u
-#define PMF_SMC_GET_TIMESTAMP_64 0xC2000010u
+#define PMF_SMC_GET_TIMESTAMP_32 U(0x82000010)
+#define PMF_SMC_GET_TIMESTAMP_64 U(0xC2000010)
#define PMF_NUM_SMC_CALLS 2
/*
* The macros below are used to identify
* PMF calls from the SMC function ID.
*/
-#define PMF_FID_MASK 0xffe0u
-#define PMF_FID_VALUE 0u
+#define PMF_FID_MASK U(0xffe0)
+#define PMF_FID_VALUE U(0)
#define is_pmf_fid(_fid) (((_fid) & PMF_FID_MASK) == PMF_FID_VALUE)
/* Following are the supported PMF service IDs */
#include <assert.h>
#include <bl_common.h>
#include <platform.h>
-#include <pmf.h>
#include <stddef.h>
#include <stdint.h>
IMPORT_SYM(uintptr_t, __PMF_SVC_DESCS_START__, PMF_SVC_DESCS_START);
IMPORT_SYM(uintptr_t, __PMF_SVC_DESCS_END__, PMF_SVC_DESCS_END);
IMPORT_SYM(uintptr_t, __PMF_PERCPU_TIMESTAMP_END__, PMF_PERCPU_TIMESTAMP_END);
-IMPORT_SYM(intptr_t, __PMF_TIMESTAMP_START__, PMF_TIMESTAMP_ARRAY_START);
+IMPORT_SYM(uintptr_t, __PMF_TIMESTAMP_START__, PMF_TIMESTAMP_ARRAY_START);
#define PMF_PERCPU_TIMESTAMP_SIZE (PMF_PERCPU_TIMESTAMP_END - PMF_TIMESTAMP_ARRAY_START)
pmf_svc_descs = (pmf_svc_desc_t *) PMF_SVC_DESCS_START;
for (ii = 0; ii < pmf_svc_descs_num; ii++) {
- assert(pmf_svc_descs[ii].get_ts);
+ assert(pmf_svc_descs[ii].get_ts != NULL);
/*
* Call the initialization routine for this
* PMF service, if it is defined.
*/
- if (pmf_svc_descs[ii].init) {
+ if (pmf_svc_descs[ii].init != NULL) {
rc = pmf_svc_descs[ii].init();
- if (rc) {
+ if (rc != 0) {
WARN("Could not initialize PMF"
"service %s - skipping \n",
pmf_svc_descs[ii].name);
if (pmf_num_services == 0)
return NULL;
- assert(pmf_svc_descs);
+ assert(pmf_svc_descs != NULL);
do {
mid = (low + high) / 2;
unsigned long long *ts_value)
{
pmf_svc_desc_t *svc_desc;
- assert(ts_value);
+ assert(ts_value != NULL);
/* Search for registered service. */
svc_desc = get_service(tid);
unsigned long long *ts_addr = (unsigned long long *)calc_ts_addr(base_addr,
tid, cpuid);
- if (flags & PMF_CACHE_MAINT)
+ if ((flags & PMF_CACHE_MAINT) != 0U)
inv_dcache_range((uintptr_t)ts_addr, sizeof(unsigned long long));
return *ts_addr;
* x0 --> error code.
* x1 - x2 --> time-stamp value.
*/
- rc = pmf_get_timestamp_smc(x1, x2, x3, &ts_value);
+ rc = pmf_get_timestamp_smc((unsigned int)x1, x2,
+ (unsigned int)x3, &ts_value);
SMC_RET3(handle, rc, (uint32_t)ts_value,
(uint32_t)(ts_value >> 32));
}
* x0 --> error code.
* x1 --> time-stamp value.
*/
- rc = pmf_get_timestamp_smc(x1, x2, x3, &ts_value);
+ rc = pmf_get_timestamp_smc((unsigned int)x1, x2,
+ (unsigned int)x3, &ts_value);
SMC_RET2(handle, rc, ts_value);
}
}