1/*
2 * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <xtensa/coreasm.h>
8#include <xtensa/corebits.h>
9#include <xtensa/config/system.h>
10#include <xtensa/hal.h>
11
12/* esp_ipc_isr_waiting_for_finish_cmd(void* finish_cmd)
13 *
14 * It should be called by the CALLX0 command from the handler of High-priority interrupt.
15 * Only these registers [a2, a3, a4] can be used here.
16 */
17    .section    .iram1, "ax"
18    .align      4
19    .global     esp_ipc_isr_waiting_for_finish_cmd
20    .type       esp_ipc_isr_waiting_for_finish_cmd, @function
21// Args:
22// a2 - finish_cmd (pointer on esp_ipc_isr_finish_cmd)
23esp_ipc_isr_waiting_for_finish_cmd:
24    /* waiting for the finish command */
25.check_finish_cmd:
26    memw
27    l32i    a3, a2, 0
28    beqz    a3, .check_finish_cmd
29    ret
30