Changeset View
Changeset View
Standalone View
Standalone View
sys/interrupt.h
Show All 31 Lines | |||||
#define _SYS_INTERRUPT_H_ | #define _SYS_INTERRUPT_H_ | ||||
#include <sys/_lock.h> | #include <sys/_lock.h> | ||||
#include <sys/_mutex.h> | #include <sys/_mutex.h> | ||||
#include <sys/ck.h> | #include <sys/ck.h> | ||||
struct intr_event; | struct intr_event; | ||||
struct intr_thread; | struct intr_thread; | ||||
struct epoch; | |||||
struct trapframe; | struct trapframe; | ||||
/* | /* | ||||
* Describe a hardware interrupt handler. | * Describe a hardware interrupt handler. | ||||
* | * | ||||
* Multiple interrupt handlers for a specific event can be chained | * Multiple interrupt handlers for a specific event can be chained | ||||
* together. | * together. | ||||
*/ | */ | ||||
struct intr_handler { | struct intr_handler { | ||||
driver_filter_t *ih_filter; /* Filter handler function. */ | driver_filter_t *ih_filter; /* Filter handler function. */ | ||||
driver_intr_t *ih_handler; /* Threaded handler function. */ | driver_intr_t *ih_handler; /* Threaded handler function. */ | ||||
void *ih_argument; /* Argument to pass to handlers. */ | void *ih_argument; /* Argument to pass to handlers. */ | ||||
struct epoch *ih_epoch; /* Epoch needed by handler. */ | |||||
int ih_flags; | int ih_flags; | ||||
char ih_name[MAXCOMLEN + 1]; /* Name of handler. */ | char ih_name[MAXCOMLEN + 1]; /* Name of handler. */ | ||||
struct intr_event *ih_event; /* Event we are connected to. */ | struct intr_event *ih_event; /* Event we are connected to. */ | ||||
int ih_need; /* Needs service. */ | int ih_need; /* Needs service. */ | ||||
CK_SLIST_ENTRY(intr_handler) ih_next; /* Next handler for this event. */ | CK_SLIST_ENTRY(intr_handler) ih_next; /* Next handler for this event. */ | ||||
u_char ih_pri; /* Priority of this handler. */ | u_char ih_pri; /* Priority of this handler. */ | ||||
}; | }; | ||||
/* Interrupt handle flags kept in ih_flags */ | /* Interrupt handle flags kept in ih_flags */ | ||||
#define IH_NET 0x00000001 /* Network. */ | |||||
#define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ | #define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ | ||||
#define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ | #define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ | ||||
#define IH_DEAD 0x00000008 /* Handler should be removed. */ | #define IH_DEAD 0x00000008 /* Handler should be removed. */ | ||||
#define IH_SUSP 0x00000010 /* Device is powered down. */ | #define IH_SUSP 0x00000010 /* Device is powered down. */ | ||||
#define IH_CHANGED 0x40000000 /* Handler state is changed. */ | #define IH_CHANGED 0x40000000 /* Handler state is changed. */ | ||||
#define IH_MPSAFE 0x80000000 /* Handler does not need Giant. */ | #define IH_MPSAFE 0x80000000 /* Handler does not need Giant. */ | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |