test_ipc_isr.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <xtensa/coreasm.h>
  7. #include <xtensa/corebits.h>
  8. #include <xtensa/config/system.h>
  9. #include <xtensa/hal.h>
  10. /* esp_test_ipc_isr_asm(void *arg)
  11. *
  12. * It should be called by the CALLX0 command from the handler of High-priority interrupt.
  13. * Only these registers [a2, a3, a4] can be used here.
  14. */
  15. .section .iram1, "ax"
  16. .align 4
  17. .global esp_test_ipc_isr_asm
  18. .type esp_test_ipc_isr_asm, @function
  19. // Args:
  20. // a2 - void* arg
  21. esp_test_ipc_isr_asm:
  22. movi a3, 0xa5a5
  23. s32i a3, a2, 0
  24. ret
  25. /* esp_test_ipc_isr_get_other_core_id(void *arg)
  26. *
  27. * this function puts the core_id of the other CPU in the arg.
  28. * use only a2, a3 and a4 regs here.
  29. */
  30. .section .iram1, "ax"
  31. .align 4
  32. .global esp_test_ipc_isr_get_other_core_id
  33. .type esp_test_ipc_isr_get_other_core_id, @function
  34. // Args:
  35. // a2 - void* arg
  36. esp_test_ipc_isr_get_other_core_id:
  37. rsr.prid a3
  38. extui a3, a3, 13, 1
  39. s32i a3, a2, 0
  40. ret
  41. /* esp_test_ipc_isr_get_cycle_count_other_cpu(void *arg)
  42. *
  43. * this function puts CCOUNT of the other CPU in the arg.
  44. * use only a2, a3 and a4 regs here.
  45. */
  46. .section .iram1, "ax"
  47. .align 4
  48. .global esp_test_ipc_isr_get_cycle_count_other_cpu
  49. .type esp_test_ipc_isr_get_cycle_count_other_cpu, @function
  50. // Args:
  51. // a2 - void* arg
  52. esp_test_ipc_isr_get_cycle_count_other_cpu:
  53. rsr.ccount a3
  54. s32i a3, a2, 0
  55. ret