Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/intr.h
Show All 23 Lines | |||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _SYS_INTR_H_ | #ifndef _SYS_INTR_H_ | ||||
#define _SYS_INTR_H_ | #define _SYS_INTR_H_ | ||||
nwhitehorn: Is it worth having a block like this here? This might fix accidental includes like I noticed… | |||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#define INTR_IRQ_INVALID 0xFFFFFFFF | #define INTR_IRQ_INVALID 0xFFFFFFFF | ||||
enum intr_map_data_type { | |||||
INTR_MAP_DATA_ACPI = 0, | |||||
INTR_MAP_DATA_FDT, | |||||
INTR_MAP_DATA_GPIO, | |||||
INTR_MAP_DATA_MSI, | |||||
/* Placeholders for platform specific types */ | |||||
INTR_MAP_DATA_PLAT_1 = 1000, | |||||
INTR_MAP_DATA_PLAT_2, | |||||
INTR_MAP_DATA_PLAT_3, | |||||
INTR_MAP_DATA_PLAT_4, | |||||
INTR_MAP_DATA_PLAT_5, | |||||
}; | |||||
struct intr_map_data { | |||||
size_t len; | |||||
enum intr_map_data_type type; | |||||
}; | |||||
struct intr_map_data_msi { | |||||
struct intr_map_data hdr; | |||||
struct intr_irqsrc *isrc; | |||||
}; | |||||
Not Done Inline ActionsThanks for moving this to intr.h! nwhitehorn: Thanks for moving this to intr.h! | |||||
#ifdef notyet | #ifdef notyet | ||||
#define INTR_SOLO INTR_MD1 | #define INTR_SOLO INTR_MD1 | ||||
typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); | typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); | ||||
#else | #else | ||||
typedef int intr_irq_filter_t(void *arg); | typedef int intr_irq_filter_t(void *arg); | ||||
#endif | #endif | ||||
typedef int intr_child_irq_filter_t(void *arg, uintptr_t irq); | typedef int intr_child_irq_filter_t(void *arg, uintptr_t irq); | ||||
Show All 38 Lines | |||||
int intr_pic_deregister(device_t, intptr_t); | int intr_pic_deregister(device_t, intptr_t); | ||||
int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); | int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); | ||||
struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *, | struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *, | ||||
intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); | intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); | ||||
extern device_t intr_irq_root_dev; | extern device_t intr_irq_root_dev; | ||||
/* Intr interface for BUS. */ | /* Intr interface for BUS. */ | ||||
int intr_map_irq(device_t, intptr_t, struct intr_map_data *, u_int *); | |||||
int intr_alloc_irq(device_t, struct resource *); | int intr_activate_irq(device_t, struct resource *); | ||||
int intr_release_irq(device_t, struct resource *); | int intr_deactivate_irq(device_t, struct resource *); | ||||
int intr_setup_irq(device_t, struct resource *, driver_filter_t, driver_intr_t, | int intr_setup_irq(device_t, struct resource *, driver_filter_t, driver_intr_t, | ||||
void *, int, void **); | void *, int, void **); | ||||
int intr_teardown_irq(device_t, struct resource *, void *); | int intr_teardown_irq(device_t, struct resource *, void *); | ||||
int intr_describe_irq(device_t, struct resource *, void *, const char *); | int intr_describe_irq(device_t, struct resource *, void *, const char *); | ||||
int intr_child_irq_handler(struct intr_pic *, uintptr_t); | int intr_child_irq_handler(struct intr_pic *, uintptr_t); | ||||
/* Intr resources mapping. */ | |||||
struct intr_map_data *intr_alloc_map_data(enum intr_map_data_type, size_t, int); | |||||
void intr_free_intr_map_data(struct intr_map_data *); | |||||
u_int intr_map_irq(device_t, intptr_t, struct intr_map_data *); | |||||
void intr_unmap_irq(u_int ); | |||||
u_int intr_map_clone_irq(u_int ); | |||||
/* MSI/MSI-X handling */ | /* MSI/MSI-X handling */ | ||||
int intr_msi_register(device_t, intptr_t); | int intr_msi_register(device_t, intptr_t); | ||||
int intr_alloc_msi(device_t, device_t, intptr_t, int, int, int *); | int intr_alloc_msi(device_t, device_t, intptr_t, int, int, int *); | ||||
int intr_release_msi(device_t, device_t, intptr_t, int, int *); | int intr_release_msi(device_t, device_t, intptr_t, int, int *); | ||||
int intr_map_msi(device_t, device_t, intptr_t, int, uint64_t *, uint32_t *); | int intr_map_msi(device_t, device_t, intptr_t, int, uint64_t *, uint32_t *); | ||||
int intr_alloc_msix(device_t, device_t, intptr_t, int *); | int intr_alloc_msix(device_t, device_t, intptr_t, int *); | ||||
int intr_release_msix(device_t, device_t, intptr_t, int); | int intr_release_msix(device_t, device_t, intptr_t, int); | ||||
Show All 20 Lines |
Is it worth having a block like this here? This might fix accidental includes like I noticed above.
#ifndef INTRNG
#error Need INTRNG for this file
#endif