Software APIs
isr_testutils.h
Go to the documentation of this file.
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5#ifndef OPENTITAN_SW_DEVICE_LIB_TESTING_AUTOGEN_ISR_TESTUTILS_H_
6#define OPENTITAN_SW_DEVICE_LIB_TESTING_AUTOGEN_ISR_TESTUTILS_H_
7
8// THIS FILE HAS BEEN GENERATED, DO NOT EDIT MANUALLY. COMMAND:
9// util/autogen_testutils.py
10
11/**
12 * @file
13 * @brief Default ISRs for each IP
14 */
15
16#include "sw/device/lib/dif/autogen/dif_aon_timer_autogen.h"
17#include "sw/device/lib/dif/autogen/dif_flash_ctrl_autogen.h"
18#include "sw/device/lib/dif/autogen/dif_gpio_autogen.h"
19#include "sw/device/lib/dif/autogen/dif_pwrmgr_autogen.h"
20#include "sw/device/lib/dif/autogen/dif_rv_timer_autogen.h"
21#include "sw/device/lib/dif/autogen/dif_spi_device_autogen.h"
22#include "sw/device/lib/dif/autogen/dif_spi_host_autogen.h"
23#include "sw/device/lib/dif/autogen/dif_uart_autogen.h"
24#include "sw/device/lib/dif/autogen/dif_usbdev_autogen.h"
26
28
29/**
30 * A handle to a PLIC ISR context struct.
31 */
32typedef struct plic_isr_ctx {
33 /**
34 * A handle to a rv_plic.
35 */
37 /**
38 * The HART ID associated with the PLIC (correspond to a PLIC "target").
39 */
40 uint32_t hart_id;
42
43/**
44 * A handle to a aon_timer ISR context struct.
45 */
46typedef struct aon_timer_isr_ctx {
47 /**
48 * A handle to a aon_timer.
49 */
51 /**
52 * The PLIC IRQ ID where this aon_timer instance's IRQs start.
53 */
55 /**
56 * The aon_timer IRQ that is expected to be encountered in the ISR.
57 */
58 dif_aon_timer_irq_t expected_irq;
59 /**
60 * Whether or not a single IRQ is expected to be encountered in the ISR.
61 */
62 bool is_only_irq;
64
65/**
66 * A handle to a flash_ctrl ISR context struct.
67 */
68typedef struct flash_ctrl_isr_ctx {
69 /**
70 * A handle to a flash_ctrl.
71 */
73 /**
74 * The PLIC IRQ ID where this flash_ctrl instance's IRQs start.
75 */
77 /**
78 * The flash_ctrl IRQ that is expected to be encountered in the ISR.
79 */
80 dif_flash_ctrl_irq_t expected_irq;
81 /**
82 * Whether or not a single IRQ is expected to be encountered in the ISR.
83 */
84 bool is_only_irq;
86
87/**
88 * A handle to a gpio ISR context struct.
89 */
90typedef struct gpio_isr_ctx {
91 /**
92 * A handle to a gpio.
93 */
95 /**
96 * The PLIC IRQ ID where this gpio instance's IRQs start.
97 */
99 /**
100 * The gpio IRQ that is expected to be encountered in the ISR.
101 */
102 dif_gpio_irq_t expected_irq;
103 /**
104 * Whether or not a single IRQ is expected to be encountered in the ISR.
105 */
106 bool is_only_irq;
108
109/**
110 * A handle to a pwrmgr ISR context struct.
111 */
112typedef struct pwrmgr_isr_ctx {
113 /**
114 * A handle to a pwrmgr.
115 */
117 /**
118 * The PLIC IRQ ID where this pwrmgr instance's IRQs start.
119 */
121 /**
122 * The pwrmgr IRQ that is expected to be encountered in the ISR.
123 */
124 dif_pwrmgr_irq_t expected_irq;
125 /**
126 * Whether or not a single IRQ is expected to be encountered in the ISR.
127 */
128 bool is_only_irq;
130
131/**
132 * A handle to a rv_timer ISR context struct.
133 */
134typedef struct rv_timer_isr_ctx {
135 /**
136 * A handle to a rv_timer.
137 */
139 /**
140 * The PLIC IRQ ID where this rv_timer instance's IRQs start.
141 */
143 /**
144 * The rv_timer IRQ that is expected to be encountered in the ISR.
145 */
146 dif_rv_timer_irq_t expected_irq;
147 /**
148 * Whether or not a single IRQ is expected to be encountered in the ISR.
149 */
150 bool is_only_irq;
152
153/**
154 * A handle to a spi_device ISR context struct.
155 */
156typedef struct spi_device_isr_ctx {
157 /**
158 * A handle to a spi_device.
159 */
161 /**
162 * The PLIC IRQ ID where this spi_device instance's IRQs start.
163 */
165 /**
166 * The spi_device IRQ that is expected to be encountered in the ISR.
167 */
168 dif_spi_device_irq_t expected_irq;
169 /**
170 * Whether or not a single IRQ is expected to be encountered in the ISR.
171 */
172 bool is_only_irq;
174
175/**
176 * A handle to a spi_host ISR context struct.
177 */
178typedef struct spi_host_isr_ctx {
179 /**
180 * A handle to a spi_host.
181 */
183 /**
184 * The PLIC IRQ ID where this spi_host instance's IRQs start.
185 */
187 /**
188 * The spi_host IRQ that is expected to be encountered in the ISR.
189 */
190 dif_spi_host_irq_t expected_irq;
191 /**
192 * Whether or not a single IRQ is expected to be encountered in the ISR.
193 */
194 bool is_only_irq;
196
197/**
198 * A handle to a uart ISR context struct.
199 */
200typedef struct uart_isr_ctx {
201 /**
202 * A handle to a uart.
203 */
205 /**
206 * The PLIC IRQ ID where this uart instance's IRQs start.
207 */
209 /**
210 * The uart IRQ that is expected to be encountered in the ISR.
211 */
212 dif_uart_irq_t expected_irq;
213 /**
214 * Whether or not a single IRQ is expected to be encountered in the ISR.
215 */
216 bool is_only_irq;
218
219/**
220 * A handle to a usbdev ISR context struct.
221 */
222typedef struct usbdev_isr_ctx {
223 /**
224 * A handle to a usbdev.
225 */
227 /**
228 * The PLIC IRQ ID where this usbdev instance's IRQs start.
229 */
231 /**
232 * The usbdev IRQ that is expected to be encountered in the ISR.
233 */
234 dif_usbdev_irq_t expected_irq;
235 /**
236 * Whether or not a single IRQ is expected to be encountered in the ISR.
237 */
238 bool is_only_irq;
240
241/**
242 * Services an aon_timer IRQ.
243 *
244 * @param plic_ctx A PLIC ISR context handle.
245 * @param aon_timer_ctx A(n) aon_timer ISR context handle.
246 * @param[out] peripheral_serviced Out param for the peripheral that was
247 * serviced.
248 * @param[out] irq_serviced Out param for the IRQ that was serviced.
249 */
251 plic_isr_ctx_t plic_ctx, aon_timer_isr_ctx_t aon_timer_ctx,
252 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
253 dif_aon_timer_irq_t *irq_serviced);
254
255/**
256 * Services an flash_ctrl IRQ.
257 *
258 * @param plic_ctx A PLIC ISR context handle.
259 * @param flash_ctrl_ctx A(n) flash_ctrl ISR context handle.
260 * @param mute_status_irq set to true to disable the serviced status type IRQ.
261 * @param[out] peripheral_serviced Out param for the peripheral that was
262 * serviced.
263 * @param[out] irq_serviced Out param for the IRQ that was serviced.
264 */
266 plic_isr_ctx_t plic_ctx, flash_ctrl_isr_ctx_t flash_ctrl_ctx,
267 bool mute_status_irq,
268 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
269 dif_flash_ctrl_irq_t *irq_serviced);
270
271/**
272 * Services an gpio IRQ.
273 *
274 * @param plic_ctx A PLIC ISR context handle.
275 * @param gpio_ctx A(n) gpio ISR context handle.
276 * @param[out] peripheral_serviced Out param for the peripheral that was
277 * serviced.
278 * @param[out] irq_serviced Out param for the IRQ that was serviced.
279 */
281 plic_isr_ctx_t plic_ctx, gpio_isr_ctx_t gpio_ctx,
282 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
283 dif_gpio_irq_t *irq_serviced);
284
285/**
286 * Services an pwrmgr IRQ.
287 *
288 * @param plic_ctx A PLIC ISR context handle.
289 * @param pwrmgr_ctx A(n) pwrmgr ISR context handle.
290 * @param[out] peripheral_serviced Out param for the peripheral that was
291 * serviced.
292 * @param[out] irq_serviced Out param for the IRQ that was serviced.
293 */
295 plic_isr_ctx_t plic_ctx, pwrmgr_isr_ctx_t pwrmgr_ctx,
296 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
297 dif_pwrmgr_irq_t *irq_serviced);
298
299/**
300 * Services an rv_timer IRQ.
301 *
302 * @param plic_ctx A PLIC ISR context handle.
303 * @param rv_timer_ctx A(n) rv_timer ISR context handle.
304 * @param[out] peripheral_serviced Out param for the peripheral that was
305 * serviced.
306 * @param[out] irq_serviced Out param for the IRQ that was serviced.
307 */
309 plic_isr_ctx_t plic_ctx, rv_timer_isr_ctx_t rv_timer_ctx,
310 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
311 dif_rv_timer_irq_t *irq_serviced);
312
313/**
314 * Services an spi_device IRQ.
315 *
316 * @param plic_ctx A PLIC ISR context handle.
317 * @param spi_device_ctx A(n) spi_device ISR context handle.
318 * @param mute_status_irq set to true to disable the serviced status type IRQ.
319 * @param[out] peripheral_serviced Out param for the peripheral that was
320 * serviced.
321 * @param[out] irq_serviced Out param for the IRQ that was serviced.
322 */
324 plic_isr_ctx_t plic_ctx, spi_device_isr_ctx_t spi_device_ctx,
325 bool mute_status_irq,
326 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
327 dif_spi_device_irq_t *irq_serviced);
328
329/**
330 * Services an spi_host IRQ.
331 *
332 * @param plic_ctx A PLIC ISR context handle.
333 * @param spi_host_ctx A(n) spi_host ISR context handle.
334 * @param mute_status_irq set to true to disable the serviced status type IRQ.
335 * @param[out] peripheral_serviced Out param for the peripheral that was
336 * serviced.
337 * @param[out] irq_serviced Out param for the IRQ that was serviced.
338 */
340 plic_isr_ctx_t plic_ctx, spi_host_isr_ctx_t spi_host_ctx,
341 bool mute_status_irq,
342 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
343 dif_spi_host_irq_t *irq_serviced);
344
345/**
346 * Services an uart IRQ.
347 *
348 * @param plic_ctx A PLIC ISR context handle.
349 * @param uart_ctx A(n) uart ISR context handle.
350 * @param mute_status_irq set to true to disable the serviced status type IRQ.
351 * @param[out] peripheral_serviced Out param for the peripheral that was
352 * serviced.
353 * @param[out] irq_serviced Out param for the IRQ that was serviced.
354 */
356 plic_isr_ctx_t plic_ctx, uart_isr_ctx_t uart_ctx, bool mute_status_irq,
357 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
358 dif_uart_irq_t *irq_serviced);
359
360/**
361 * Services an usbdev IRQ.
362 *
363 * @param plic_ctx A PLIC ISR context handle.
364 * @param usbdev_ctx A(n) usbdev ISR context handle.
365 * @param mute_status_irq set to true to disable the serviced status type IRQ.
366 * @param[out] peripheral_serviced Out param for the peripheral that was
367 * serviced.
368 * @param[out] irq_serviced Out param for the IRQ that was serviced.
369 */
371 plic_isr_ctx_t plic_ctx, usbdev_isr_ctx_t usbdev_ctx, bool mute_status_irq,
372 top_englishbreakfast_plic_peripheral_t *peripheral_serviced,
373 dif_usbdev_irq_t *irq_serviced);
374
375#endif // OPENTITAN_SW_DEVICE_LIB_TESTING_AUTOGEN_ISR_TESTUTILS_H_