14 #include "pattgen_regs.h"
18 if (pattgen == NULL) {
29 if (pattgen == NULL) {
36 alert_idx = PATTGEN_ALERT_TEST_FATAL_FAULT_BIT;
44 (ptrdiff_t)PATTGEN_ALERT_TEST_REG_OFFSET, alert_test_reg);
56 *index_out = PATTGEN_INTR_COMMON_DONE_CH0_BIT;
59 *index_out = PATTGEN_INTR_COMMON_DONE_CH1_BIT;
81 *type = irq_types[irq];
89 if (pattgen == NULL || snapshot == NULL) {
93 *snapshot = mmio_region_read32(pattgen->
base_addr,
94 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET);
102 if (pattgen == NULL) {
107 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, snapshot);
116 if (pattgen == NULL || is_pending == NULL) {
121 if (!pattgen_get_irq_bit_index(irq, &index)) {
125 uint32_t intr_state_reg = mmio_region_read32(
126 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET);
135 if (pattgen == NULL) {
141 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, UINT32_MAX);
149 if (pattgen == NULL) {
154 if (!pattgen_get_irq_bit_index(irq, &index)) {
161 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, intr_state_reg);
169 if (pattgen == NULL) {
174 if (!pattgen_get_irq_bit_index(irq, &index)) {
180 (ptrdiff_t)PATTGEN_INTR_TEST_REG_OFFSET, intr_test_reg);
189 if (pattgen == NULL || state == NULL) {
194 if (!pattgen_get_irq_bit_index(irq, &index)) {
198 uint32_t intr_enable_reg = mmio_region_read32(
199 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
211 if (pattgen == NULL) {
216 if (!pattgen_get_irq_bit_index(irq, &index)) {
220 uint32_t intr_enable_reg = mmio_region_read32(
221 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
226 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET,
235 if (pattgen == NULL) {
240 if (snapshot != NULL) {
241 *snapshot = mmio_region_read32(pattgen->
base_addr,
242 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
247 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET, 0u);
256 if (pattgen == NULL || snapshot == NULL) {
261 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET, *snapshot);