Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_intr.c
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
#ifdef SMP | #ifdef SMP | ||||
#ifdef EARLY_AP_STARTUP | #ifdef EARLY_AP_STARTUP | ||||
static bool irq_assign_cpu = true; | static bool irq_assign_cpu = true; | ||||
#else | #else | ||||
static bool irq_assign_cpu = false; | static bool irq_assign_cpu = false; | ||||
#endif | #endif | ||||
#endif | #endif | ||||
int intr_nirq = NIRQ; | u_int intr_nirq = NIRQ; | ||||
SYSCTL_UINT(_machdep, OID_AUTO, nirq, CTLFLAG_RDTUN, &intr_nirq, 0, | SYSCTL_UINT(_machdep, OID_AUTO, nirq, CTLFLAG_RDTUN, &intr_nirq, 0, | ||||
"Number of IRQs"); | "Number of IRQs"); | ||||
/* Data for MI statistics reporting. */ | /* Data for MI statistics reporting. */ | ||||
u_long *intrcnt; | u_long *intrcnt; | ||||
char *intrnames; | char *intrnames; | ||||
size_t sintrcnt; | size_t sintrcnt; | ||||
size_t sintrnames; | size_t sintrnames; | ||||
static u_int intrcnt_index; | static u_int intrcnt_index; | ||||
static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); | static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); | ||||
static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); | static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); | ||||
static struct intr_map_data * intr_map_get_map_data(u_int res_id); | static struct intr_map_data * intr_map_get_map_data(u_int res_id); | ||||
static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, | static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, | ||||
struct intr_map_data **data); | struct intr_map_data **data); | ||||
/* | /* | ||||
* Interrupt framework initialization routine. | * Interrupt framework initialization routine. | ||||
*/ | */ | ||||
static void | static void | ||||
intr_irq_init(void *dummy __unused) | intr_irq_init(void *dummy __unused) | ||||
{ | { | ||||
int intrcnt_count; | u_int intrcnt_count; | ||||
SLIST_INIT(&pic_list); | SLIST_INIT(&pic_list); | ||||
mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF); | mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF); | ||||
mtx_init(&isrc_table_lock, "intr isrc table", NULL, MTX_DEF); | mtx_init(&isrc_table_lock, "intr isrc table", NULL, MTX_DEF); | ||||
/* | /* | ||||
* - 2 counters for each I/O interrupt. | * - 2 counters for each I/O interrupt. | ||||
▲ Show 20 Lines • Show All 1,393 Lines • ▼ Show 20 Lines | struct intr_map_entry | ||||
struct intr_map_data *map_data; | struct intr_map_data *map_data; | ||||
struct intr_irqsrc *isrc; | struct intr_irqsrc *isrc; | ||||
/* XXX TODO DISCONECTED PICs */ | /* XXX TODO DISCONECTED PICs */ | ||||
/*int flags */ | /*int flags */ | ||||
}; | }; | ||||
/* XXX Convert irq_map[] to dynamicaly expandable one. */ | /* XXX Convert irq_map[] to dynamicaly expandable one. */ | ||||
static struct intr_map_entry **irq_map; | static struct intr_map_entry **irq_map; | ||||
static int irq_map_count; | static u_int irq_map_count; | ||||
static int irq_map_first_free_idx; | static u_int irq_map_first_free_idx; | ||||
static struct mtx irq_map_lock; | static struct mtx irq_map_lock; | ||||
static struct intr_irqsrc * | static struct intr_irqsrc * | ||||
intr_map_get_isrc(u_int res_id) | intr_map_get_isrc(u_int res_id) | ||||
{ | { | ||||
struct intr_irqsrc *isrc; | struct intr_irqsrc *isrc; | ||||
isrc = NULL; | isrc = NULL; | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |