pmf_asm_macros.S 591 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2019, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PMF_ASM_MACROS_S
  7. #define PMF_ASM_MACROS_S
  8. #define PMF_TS_SIZE 8
  9. /*
  10. * This macro calculates the address of the per-cpu timestamp
  11. * for the given service name and local timestamp id.
  12. * Clobbers: r0 - r4
  13. */
  14. .macro pmf_calc_timestamp_addr _name, _tid
  15. mov r4, lr
  16. bl plat_my_core_pos
  17. mov lr, r4
  18. ldr r1, =__PERCPU_TIMESTAMP_SIZE__
  19. mov r2, #(\_tid * PMF_TS_SIZE)
  20. mla r0, r0, r1, r2
  21. ldr r1, =pmf_ts_mem_\_name
  22. add r0, r0, r1
  23. .endm
  24. #endif /* PMF_ASM_MACROS_S */