blob: 792ede9132ebcc398231b0e6aee77c566280fbd5 [file] [log] [blame]
dp-arma97bd892016-08-15 10:35:54 +01001/*
Govindraj Rajaeee28e72023-08-01 15:52:40 -05002 * Copyright (c) 2016-2018, Arm Limited and Contributors. All rights reserved.
dp-arma97bd892016-08-15 10:35:54 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
dp-arma97bd892016-08-15 10:35:54 +01005 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef PMF_ASM_MACROS_S
8#define PMF_ASM_MACROS_S
dp-arma97bd892016-08-15 10:35:54 +01009
10#define PMF_TS_SIZE 8
11
12 /*
dp-armb28965e2016-09-08 11:51:49 +010013 * This macro calculates the address of the per-cpu timestamp
14 * for the given service name and local timestamp id.
dp-arma97bd892016-08-15 10:35:54 +010015 * Clobbers: x0 - x9
16 */
Antonio Nino Diazf0b14cf2018-10-04 09:55:23 +010017 .macro pmf_calc_timestamp_addr _name, _tid
dp-arma97bd892016-08-15 10:35:54 +010018 mov x9, x30
19 bl plat_my_core_pos
20 mov x30, x9
Soby Mathewfcaf1bd2018-10-12 16:40:28 +010021 adr x2, __PMF_PERCPU_TIMESTAMP_END__
22 adr x1, __PMF_TIMESTAMP_START__
23 sub x1, x2, x1
dp-arma97bd892016-08-15 10:35:54 +010024 mov x2, #(\_tid * PMF_TS_SIZE)
25 madd x0, x0, x1, x2
Soby Mathewfcaf1bd2018-10-12 16:40:28 +010026 adr x1, pmf_ts_mem_\_name
dp-arma97bd892016-08-15 10:35:54 +010027 add x0, x0, x1
28 .endm
29
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000030#endif /* PMF_ASM_MACROS_S */