dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 1 | /* |
Govindraj Raja | eee28e7 | 2023-08-01 15:52:40 -0500 | [diff] [blame] | 2 | * Copyright (c) 2016-2018, Arm Limited and Contributors. All rights reserved. |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef PMF_ASM_MACROS_S |
| 8 | #define PMF_ASM_MACROS_S |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 9 | |
| 10 | #define PMF_TS_SIZE 8 |
| 11 | |
| 12 | /* |
dp-arm | b28965e | 2016-09-08 11:51:49 +0100 | [diff] [blame] | 13 | * This macro calculates the address of the per-cpu timestamp |
| 14 | * for the given service name and local timestamp id. |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 15 | * Clobbers: x0 - x9 |
| 16 | */ |
Antonio Nino Diaz | f0b14cf | 2018-10-04 09:55:23 +0100 | [diff] [blame] | 17 | .macro pmf_calc_timestamp_addr _name, _tid |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 18 | mov x9, x30 |
| 19 | bl plat_my_core_pos |
| 20 | mov x30, x9 |
Soby Mathew | fcaf1bd | 2018-10-12 16:40:28 +0100 | [diff] [blame] | 21 | adr x2, __PMF_PERCPU_TIMESTAMP_END__ |
| 22 | adr x1, __PMF_TIMESTAMP_START__ |
| 23 | sub x1, x2, x1 |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 24 | mov x2, #(\_tid * PMF_TS_SIZE) |
| 25 | madd x0, x0, x1, x2 |
Soby Mathew | fcaf1bd | 2018-10-12 16:40:28 +0100 | [diff] [blame] | 26 | adr x1, pmf_ts_mem_\_name |
dp-arm | a97bd89 | 2016-08-15 10:35:54 +0100 | [diff] [blame] | 27 | add x0, x0, x1 |
| 28 | .endm |
| 29 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 30 | #endif /* PMF_ASM_MACROS_S */ |