1 /*
2  * Copyright (c) 2024, Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/drivers/interrupt_controller/riscv_clic.h>
9 #include <hal/nrf_vpr_clic.h>
10 
riscv_clic_irq_enable(uint32_t irq)11 void riscv_clic_irq_enable(uint32_t irq)
12 {
13 	nrf_vpr_clic_int_enable_set(NRF_VPRCLIC, irq, true);
14 }
15 
riscv_clic_irq_disable(uint32_t irq)16 void riscv_clic_irq_disable(uint32_t irq)
17 {
18 	nrf_vpr_clic_int_enable_set(NRF_VPRCLIC, irq, false);
19 }
20 
riscv_clic_irq_is_enabled(uint32_t irq)21 int riscv_clic_irq_is_enabled(uint32_t irq)
22 {
23 	return nrf_vpr_clic_int_enable_check(NRF_VPRCLIC, irq);
24 }
25 
riscv_clic_irq_priority_set(uint32_t irq,uint32_t pri,uint32_t flags)26 void riscv_clic_irq_priority_set(uint32_t irq, uint32_t pri, uint32_t flags)
27 {
28 	nrf_vpr_clic_int_priority_set(NRF_VPRCLIC, irq, NRF_VPR_CLIC_INT_TO_PRIO(pri));
29 }
30 
riscv_clic_irq_set_pending(uint32_t irq)31 void riscv_clic_irq_set_pending(uint32_t irq)
32 {
33 	nrf_vpr_clic_int_pending_set(NRF_VPRCLIC, irq);
34 }
35