4c5b14f93bd66fd4106eeb5775e4a8ba2a1eb600
2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
10 #include <smccc_helpers.h>
13 * This function is responsible for handling all PMF SMC calls.
15 uintptr_t pmf_smc_handler(unsigned int smc_fid
,
25 unsigned long long ts_value
;
27 if (((smc_fid
>> FUNCID_CC_SHIFT
) & FUNCID_CC_MASK
) == SMC_32
) {
33 if (smc_fid
== PMF_SMC_GET_TIMESTAMP_32
) {
35 * Return error code and the captured
36 * time-stamp to the caller.
38 * x1 - x2 --> time-stamp value.
40 rc
= pmf_get_timestamp_smc((unsigned int)x1
, x2
,
41 (unsigned int)x3
, &ts_value
);
42 SMC_RET3(handle
, rc
, (uint32_t)ts_value
,
43 (uint32_t)(ts_value
>> 32));
46 if (smc_fid
== PMF_SMC_GET_TIMESTAMP_64
) {
48 * Return error code and the captured
49 * time-stamp to the caller.
51 * x1 --> time-stamp value.
53 rc
= pmf_get_timestamp_smc((unsigned int)x1
, x2
,
54 (unsigned int)x3
, &ts_value
);
55 SMC_RET2(handle
, rc
, ts_value
);
59 WARN("Unimplemented PMF Call: 0x%x \n", smc_fid
);
60 SMC_RET1(handle
, SMC_UNK
);