1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #pragma once |
4 | |
5 | #include <mos/types.h> |
6 | |
7 | /** |
8 | * @brief Function pointer type for interrupt handlers |
9 | * @returns true if the interrupt was handled, false otherwise, in which case the interrupt will be passed to the next handler |
10 | */ |
11 | typedef bool (*irq_serve_t)(u32 irq, void *data); |
12 | |
13 | void interrupt_entry(u32 irq); |
14 | |
15 | /** |
16 | * @brief Register an interrupt handler |
17 | * |
18 | * @param irq The interrupt number |
19 | * @param handler The handler function |
20 | * @param data Data to pass to the handler |
21 | */ |
22 | void interrupt_handler_register(u32 irq, irq_serve_t handler, void *data); |
23 | |