2016-08-15 10:35:54 +01:00
|
|
|
/*
|
2018-10-04 09:55:23 +01:00
|
|
|
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
|
2016-08-15 10:35:54 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2016-08-15 10:35:54 +01:00
|
|
|
*/
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#ifndef PMF_ASM_MACROS_S
|
|
|
|
#define PMF_ASM_MACROS_S
|
2016-08-15 10:35:54 +01:00
|
|
|
|
|
|
|
#define PMF_TS_SIZE 8
|
|
|
|
|
|
|
|
/*
|
2016-09-08 11:51:49 +01:00
|
|
|
* This macro calculates the address of the per-cpu timestamp
|
|
|
|
* for the given service name and local timestamp id.
|
2016-08-15 10:35:54 +01:00
|
|
|
* Clobbers: x0 - x9
|
|
|
|
*/
|
2018-10-04 09:55:23 +01:00
|
|
|
.macro pmf_calc_timestamp_addr _name, _tid
|
2016-08-15 10:35:54 +01:00
|
|
|
mov x9, x30
|
|
|
|
bl plat_my_core_pos
|
|
|
|
mov x30, x9
|
2018-10-12 16:40:28 +01:00
|
|
|
adr x2, __PMF_PERCPU_TIMESTAMP_END__
|
|
|
|
adr x1, __PMF_TIMESTAMP_START__
|
|
|
|
sub x1, x2, x1
|
2016-08-15 10:35:54 +01:00
|
|
|
mov x2, #(\_tid * PMF_TS_SIZE)
|
|
|
|
madd x0, x0, x1, x2
|
2018-10-12 16:40:28 +01:00
|
|
|
adr x1, pmf_ts_mem_\_name
|
2016-08-15 10:35:54 +01:00
|
|
|
add x0, x0, x1
|
|
|
|
.endm
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#endif /* PMF_ASM_MACROS_S */
|