1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef _RTE_INTERRUPTS_H_
6 #define _RTE_INTERRUPTS_H_
8 #include <rte_common.h>
13 * The RTE interrupt interface provides functions to register/unregister
14 * callbacks for a specific interrupt.
21 /** Interrupt handle */
22 struct rte_intr_handle;
24 /** Function to be registered for the specific interrupt */
25 typedef void (*rte_intr_callback_fn)(void *cb_arg);
27 #include "rte_eal_interrupts.h"
30 * It registers the callback for the specific interrupt. Multiple
31 * callbacks cal be registered at the same time.
33 * Pointer to the interrupt handle.
37 * address of parameter for callback.
41 * - On failure, a negative value.
43 int rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
44 rte_intr_callback_fn cb, void *cb_arg);
47 * It unregisters the callback according to the specified interrupt handle.
50 * pointer to the interrupt handle.
54 * address of parameter for callback, (void *)-1 means to remove all
55 * registered which has the same callback address.
58 * - On success, return the number of callback entities removed.
59 * - On failure, a negative value.
61 int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
62 rte_intr_callback_fn cb, void *cb_arg);
65 * It enables the interrupt for the specified handle.
68 * pointer to the interrupt handle.
72 * - On failure, a negative value.
74 int rte_intr_enable(const struct rte_intr_handle *intr_handle);
77 * It disables the interrupt for the specified handle.
80 * pointer to the interrupt handle.
84 * - On failure, a negative value.
86 int rte_intr_disable(const struct rte_intr_handle *intr_handle);