2021-04-13 06:39:04 +08:00
|
|
|
/* Copyright 2021 Espressif Systems (Shanghai) PTE LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <offsets.h>
|
2022-05-09 19:56:13 +08:00
|
|
|
#include <zephyr/toolchain.h>
|
2021-04-13 06:39:04 +08:00
|
|
|
|
|
|
|
/* Exports */
|
|
|
|
GTEXT(__soc_is_irq)
|
|
|
|
GTEXT(__soc_handle_irq)
|
2021-08-30 21:04:34 +08:00
|
|
|
GTEXT(soc_intr_get_next_source)
|
2021-04-13 06:39:04 +08:00
|
|
|
|
|
|
|
SECTION_FUNC(exception.other, __soc_is_irq)
|
|
|
|
csrr a0, mcause
|
|
|
|
srli a0, a0, 31
|
|
|
|
ret
|
|
|
|
|
|
|
|
SECTION_FUNC(exception.other, __soc_handle_irq)
|
2021-08-30 21:04:34 +08:00
|
|
|
addi sp, sp,-4
|
|
|
|
sw ra, 0x00(sp)
|
|
|
|
la t1, soc_intr_get_next_source
|
2021-12-14 22:46:42 +08:00
|
|
|
jalr ra, t1, 0
|
2021-08-30 21:04:34 +08:00
|
|
|
lw ra, 0x00(sp)
|
|
|
|
addi sp, sp, 4
|
2021-04-13 06:39:04 +08:00
|
|
|
ret
|