14 #include "alert_handler_regs.h"
19 if (alert_handler == NULL) {
35 *index_out = ALERT_HANDLER_INTR_COMMON_CLASSA_BIT;
38 *index_out = ALERT_HANDLER_INTR_COMMON_CLASSB_BIT;
41 *index_out = ALERT_HANDLER_INTR_COMMON_CLASSC_BIT;
44 *index_out = ALERT_HANDLER_INTR_COMMON_CLASSD_BIT;
64 if (alert_handler == NULL || type == NULL ||
69 *type = irq_types[irq];
78 if (alert_handler == NULL || snapshot == NULL) {
82 *snapshot = mmio_region_read32(
83 alert_handler->
base_addr, (ptrdiff_t)ALERT_HANDLER_INTR_STATE_REG_OFFSET);
92 if (alert_handler == NULL) {
96 mmio_region_write32(alert_handler->
base_addr,
97 (ptrdiff_t)ALERT_HANDLER_INTR_STATE_REG_OFFSET, snapshot);
106 if (alert_handler == NULL || is_pending == NULL) {
111 if (!alert_handler_get_irq_bit_index(irq, &index)) {
115 uint32_t intr_state_reg = mmio_region_read32(
116 alert_handler->
base_addr, (ptrdiff_t)ALERT_HANDLER_INTR_STATE_REG_OFFSET);
126 if (alert_handler == NULL) {
131 mmio_region_write32(alert_handler->
base_addr,
132 (ptrdiff_t)ALERT_HANDLER_INTR_STATE_REG_OFFSET,
141 if (alert_handler == NULL) {
146 if (!alert_handler_get_irq_bit_index(irq, &index)) {
152 mmio_region_write32(alert_handler->
base_addr,
153 (ptrdiff_t)ALERT_HANDLER_INTR_STATE_REG_OFFSET,
163 if (alert_handler == NULL) {
168 if (!alert_handler_get_irq_bit_index(irq, &index)) {
173 mmio_region_write32(alert_handler->
base_addr,
174 (ptrdiff_t)ALERT_HANDLER_INTR_TEST_REG_OFFSET,
184 if (alert_handler == NULL || state == NULL) {
189 if (!alert_handler_get_irq_bit_index(irq, &index)) {
193 uint32_t intr_enable_reg =
194 mmio_region_read32(alert_handler->
base_addr,
195 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET);
207 if (alert_handler == NULL) {
212 if (!alert_handler_get_irq_bit_index(irq, &index)) {
216 uint32_t intr_enable_reg =
217 mmio_region_read32(alert_handler->
base_addr,
218 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET);
222 mmio_region_write32(alert_handler->
base_addr,
223 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET,
233 if (alert_handler == NULL) {
238 if (snapshot != NULL) {
240 mmio_region_read32(alert_handler->
base_addr,
241 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET);
245 mmio_region_write32(alert_handler->
base_addr,
246 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET, 0u);
255 if (alert_handler == NULL || snapshot == NULL) {
259 mmio_region_write32(alert_handler->
base_addr,
260 (ptrdiff_t)ALERT_HANDLER_INTR_ENABLE_REG_OFFSET,