Skip to content

Commit a4021da

Browse files
committed
merge architecture interrupt branches together
Each architecture can convert to kobj interrupt interface independently. This is the final result of all architectures fully implementing use of the kobj interrupt interface.
6 parents 5c98b28 + b30d6e7 + 327e3c3 + 71bb274 + 5e000b5 + 0ed2455 commit a4021da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+947
-564
lines changed

sys/arm/allwinner/a10/a10_intc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,21 +366,21 @@ static device_method_t a10_aintc_methods[] = {
366366
DEVMETHOD(device_probe, a10_aintc_probe),
367367
DEVMETHOD(device_attach, a10_aintc_attach),
368368

369+
/* Interrupt event interface */
370+
DEVMETHOD(intr_event_post_filter, a10_intr_post_filter),
371+
DEVMETHOD(intr_event_post_ithread, a10_intr_post_ithread),
372+
DEVMETHOD(intr_event_pre_ithread, a10_intr_pre_ithread),
373+
369374
/* Interrupt controller interface */
370375
DEVMETHOD(pic_disable_intr, a10_intr_disable_intr),
371376
DEVMETHOD(pic_enable_intr, a10_intr_enable_intr),
372377
DEVMETHOD(pic_map_intr, a10_intr_map_intr),
373-
DEVMETHOD(pic_post_filter, a10_intr_post_filter),
374-
DEVMETHOD(pic_post_ithread, a10_intr_post_ithread),
375-
DEVMETHOD(pic_pre_ithread, a10_intr_pre_ithread),
376-
{ 0, 0 }
377-
};
378378

379-
static driver_t a10_aintc_driver = {
380-
"aintc",
381-
a10_aintc_methods,
382-
sizeof(struct a10_aintc_softc),
379+
DEVMETHOD_END
383380
};
384381

382+
PRIVATE_DEFINE_CLASSN(aintc, a10_aintc_driver, a10_aintc_methods,
383+
sizeof(struct a10_aintc_softc), pic_base_class);
384+
385385
EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, 0, 0,
386386
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST);

sys/arm/allwinner/aw_gpio.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,15 +1559,17 @@ static device_method_t aw_gpio_methods[] = {
15591559
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
15601560
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
15611561

1562+
/* Interrupt event interface */
1563+
DEVMETHOD(intr_event_post_filter, aw_gpio_pic_post_filter),
1564+
DEVMETHOD(intr_event_post_ithread, aw_gpio_pic_post_ithread),
1565+
DEVMETHOD(intr_event_pre_ithread, aw_gpio_pic_pre_ithread),
1566+
15621567
/* Interrupt controller interface */
15631568
DEVMETHOD(pic_disable_intr, aw_gpio_pic_disable_intr),
15641569
DEVMETHOD(pic_enable_intr, aw_gpio_pic_enable_intr),
15651570
DEVMETHOD(pic_map_intr, aw_gpio_pic_map_intr),
15661571
DEVMETHOD(pic_setup_intr, aw_gpio_pic_setup_intr),
15671572
DEVMETHOD(pic_teardown_intr, aw_gpio_pic_teardown_intr),
1568-
DEVMETHOD(pic_post_filter, aw_gpio_pic_post_filter),
1569-
DEVMETHOD(pic_post_ithread, aw_gpio_pic_post_ithread),
1570-
DEVMETHOD(pic_pre_ithread, aw_gpio_pic_pre_ithread),
15711573

15721574
/* GPIO protocol */
15731575
DEVMETHOD(gpio_get_bus, aw_gpio_get_bus),
@@ -1592,11 +1594,8 @@ static device_method_t aw_gpio_methods[] = {
15921594
DEVMETHOD_END
15931595
};
15941596

1595-
static driver_t aw_gpio_driver = {
1596-
"gpio",
1597-
aw_gpio_methods,
1598-
sizeof(struct aw_gpio_softc),
1599-
};
1597+
PRIVATE_DEFINE_CLASSN(gpio, aw_gpio_driver, aw_gpio_methods,
1598+
sizeof(struct aw_gpio_softc), pic_base_class);
16001599

16011600
EARLY_DRIVER_MODULE(aw_gpio, simplebus, aw_gpio_driver, 0, 0,
16021601
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);

sys/arm/allwinner/aw_nmi.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,24 +393,23 @@ static device_method_t aw_nmi_methods[] = {
393393
DEVMETHOD(device_probe, aw_nmi_probe),
394394
DEVMETHOD(device_attach, aw_nmi_attach),
395395

396+
/* Interrupt event interface */
397+
DEVMETHOD(intr_event_post_filter, aw_nmi_post_filter),
398+
DEVMETHOD(intr_event_post_ithread, aw_nmi_post_ithread),
399+
DEVMETHOD(intr_event_pre_ithread, aw_nmi_pre_ithread),
400+
396401
/* Interrupt controller interface */
397402
DEVMETHOD(pic_disable_intr, aw_nmi_disable_intr),
398403
DEVMETHOD(pic_enable_intr, aw_nmi_enable_intr),
399404
DEVMETHOD(pic_map_intr, aw_nmi_map_intr),
400405
DEVMETHOD(pic_setup_intr, aw_nmi_setup_intr),
401406
DEVMETHOD(pic_teardown_intr, aw_nmi_teardown_intr),
402-
DEVMETHOD(pic_post_filter, aw_nmi_post_filter),
403-
DEVMETHOD(pic_post_ithread, aw_nmi_post_ithread),
404-
DEVMETHOD(pic_pre_ithread, aw_nmi_pre_ithread),
405407

406-
{0, 0},
408+
DEVMETHOD_END
407409
};
408410

409-
static driver_t aw_nmi_driver = {
410-
"aw_nmi",
411-
aw_nmi_methods,
412-
sizeof(struct aw_nmi_softc),
413-
};
411+
PRIVATE_DEFINE_CLASSN(aw_nmi, aw_nmi_driver, aw_nmi_methods,
412+
sizeof(struct aw_nmi_softc), pic_base_class);
414413

415414
EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver, 0, 0,
416415
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);

sys/arm/allwinner/aw_r_intc.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ aw_r_intc_gicp_map_intr(device_t dev, struct intr_map_data *data,
189189
return (EINVAL);
190190

191191
ret = PIC_MAP_INTR(sc->parent, data, isrcp);
192-
(*isrcp)->isrc_dev = sc->dev;
192+
/* FIXME: Modifying the value of "pic" here is very suspicious, this
193+
** really shouldn't be done though it may work */
194+
(*isrcp)->isrc_event.ie_pic = sc->dev;
193195
return(ret);
194196
}
195197

@@ -243,7 +245,7 @@ aw_r_intc_gicp_pre_ithread(device_t dev, struct intr_irqsrc *isrc)
243245

244246
sc = device_get_softc(dev);
245247

246-
PIC_PRE_ITHREAD(sc->parent, isrc);
248+
INTR_EVENT_PRE_ITHREAD(sc->parent, isrc);
247249
}
248250

249251
static void
@@ -253,7 +255,7 @@ aw_r_intc_gicp_post_ithread(device_t dev, struct intr_irqsrc *isrc)
253255

254256
sc = device_get_softc(dev);
255257

256-
PIC_POST_ITHREAD(sc->parent, isrc);
258+
INTR_EVENT_POST_ITHREAD(sc->parent, isrc);
257259
}
258260

259261
static void
@@ -263,7 +265,7 @@ aw_r_intc_gicp_post_filter(device_t dev, struct intr_irqsrc *isrc)
263265

264266
sc = device_get_softc(dev);
265267

266-
PIC_POST_FILTER(sc->parent, isrc);
268+
INTR_EVENT_POST_FILTER(sc->parent, isrc);
267269
}
268270

269271
static device_method_t aw_r_intc_gicp_methods[] = {
@@ -272,6 +274,11 @@ static device_method_t aw_r_intc_gicp_methods[] = {
272274
DEVMETHOD(device_attach, aw_r_intc_gicp_attach),
273275
DEVMETHOD(device_detach, aw_r_intc_gicp_detach),
274276

277+
/* Interrupt event interface */
278+
DEVMETHOD(intr_event_post_filter, aw_r_intc_gicp_post_filter),
279+
DEVMETHOD(intr_event_post_ithread, aw_r_intc_gicp_post_ithread),
280+
DEVMETHOD(intr_event_pre_ithread, aw_r_intc_gicp_pre_ithread),
281+
275282
/* Interrupt controller interface */
276283
DEVMETHOD(pic_activate_intr, aw_r_intc_gicp_activate_intr),
277284
DEVMETHOD(pic_disable_intr, aw_r_intc_gicp_disable_intr),
@@ -280,18 +287,13 @@ static device_method_t aw_r_intc_gicp_methods[] = {
280287
DEVMETHOD(pic_deactivate_intr, aw_r_intc_gicp_deactivate_intr),
281288
DEVMETHOD(pic_setup_intr, aw_r_intc_gicp_setup_intr),
282289
DEVMETHOD(pic_teardown_intr, aw_r_intc_gicp_teardown_intr),
283-
DEVMETHOD(pic_post_filter, aw_r_intc_gicp_post_filter),
284-
DEVMETHOD(pic_post_ithread, aw_r_intc_gicp_post_ithread),
285-
DEVMETHOD(pic_pre_ithread, aw_r_intc_gicp_pre_ithread),
286290

287291
DEVMETHOD_END
288292
};
289293

290-
static driver_t aw_r_intc_gicp_driver = {
291-
"aw_r_intc_gicp",
292-
aw_r_intc_gicp_methods,
293-
sizeof(struct aw_r_intc_gicp_softc),
294-
};
294+
PRIVATE_DEFINE_CLASSN(aw_r_intc_gicp, aw_r_intc_gicp_driver,
295+
aw_r_intc_gicp_methods, sizeof(struct aw_r_intc_gicp_softc),
296+
pic_base_class);
295297

296298
EARLY_DRIVER_MODULE(aw_r_intc_gicp, simplebus, aw_r_intc_gicp_driver, 0, 0,
297299
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);

sys/arm/arm/gic.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,15 +1243,17 @@ static device_method_t arm_gic_methods[] = {
12431243
DEVMETHOD(bus_read_ivar, arm_gic_read_ivar),
12441244
DEVMETHOD(bus_write_ivar, arm_gic_write_ivar),
12451245

1246+
/* Interrupt event interface */
1247+
DEVMETHOD(intr_event_post_filter, arm_gic_post_filter),
1248+
DEVMETHOD(intr_event_post_ithread, arm_gic_post_ithread),
1249+
DEVMETHOD(intr_event_pre_ithread, arm_gic_pre_ithread),
1250+
12461251
/* Interrupt controller interface */
12471252
DEVMETHOD(pic_disable_intr, arm_gic_disable_intr),
12481253
DEVMETHOD(pic_enable_intr, arm_gic_enable_intr),
12491254
DEVMETHOD(pic_map_intr, arm_gic_map_intr),
12501255
DEVMETHOD(pic_setup_intr, arm_gic_setup_intr),
12511256
DEVMETHOD(pic_teardown_intr, arm_gic_teardown_intr),
1252-
DEVMETHOD(pic_post_filter, arm_gic_post_filter),
1253-
DEVMETHOD(pic_post_ithread, arm_gic_post_ithread),
1254-
DEVMETHOD(pic_pre_ithread, arm_gic_pre_ithread),
12551257
#ifdef SMP
12561258
DEVMETHOD(pic_bind_intr, arm_gic_bind_intr),
12571259
DEVMETHOD(pic_init_secondary, arm_gic_init_secondary),
@@ -1269,11 +1271,11 @@ static device_method_t arm_gic_methods[] = {
12691271
DEVMETHOD(gic_db_show, arm_gic_db_show),
12701272
#endif
12711273

1272-
{ 0, 0 }
1274+
DEVMETHOD_END
12731275
};
12741276

1275-
DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods,
1276-
sizeof(struct arm_gic_softc));
1277+
PUBLIC_DEFINE_CLASSN(gic, arm_gic_driver, arm_gic_methods,
1278+
sizeof(struct arm_gic_softc), pic_base_class);
12771279

12781280
#ifdef DDB
12791281
DB_SHOW_COMMAND_FLAGS(gic, db_show_gic, CS_OWN)

sys/arm/broadcom/bcm2835/bcm2835_gpio.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,13 +1336,15 @@ static device_method_t bcm_gpio_methods[] = {
13361336
DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set),
13371337
DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle),
13381338

1339+
/* Interrupt event interface */
1340+
DEVMETHOD(intr_event_post_filter, bcm_gpio_pic_post_filter),
1341+
DEVMETHOD(intr_event_post_ithread, bcm_gpio_pic_post_ithread),
1342+
DEVMETHOD(intr_event_pre_ithread, bcm_gpio_pic_pre_ithread),
1343+
13391344
/* Interrupt controller interface */
13401345
DEVMETHOD(pic_disable_intr, bcm_gpio_pic_disable_intr),
13411346
DEVMETHOD(pic_enable_intr, bcm_gpio_pic_enable_intr),
13421347
DEVMETHOD(pic_map_intr, bcm_gpio_pic_map_intr),
1343-
DEVMETHOD(pic_post_filter, bcm_gpio_pic_post_filter),
1344-
DEVMETHOD(pic_post_ithread, bcm_gpio_pic_post_ithread),
1345-
DEVMETHOD(pic_pre_ithread, bcm_gpio_pic_pre_ithread),
13461348
DEVMETHOD(pic_setup_intr, bcm_gpio_pic_setup_intr),
13471349
DEVMETHOD(pic_teardown_intr, bcm_gpio_pic_teardown_intr),
13481350

@@ -1355,11 +1357,8 @@ static device_method_t bcm_gpio_methods[] = {
13551357
DEVMETHOD_END
13561358
};
13571359

1358-
static driver_t bcm_gpio_driver = {
1359-
"gpio",
1360-
bcm_gpio_methods,
1361-
sizeof(struct bcm_gpio_softc),
1362-
};
1360+
PRIVATE_DEFINE_CLASSN(gpio, bcm_gpio_driver, bcm_gpio_methods,
1361+
sizeof(struct bcm_gpio_softc), pic_base_class);
13631362

13641363
EARLY_DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, 0, 0,
13651364
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);

sys/arm/broadcom/bcm2835/bcm2835_intr.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,23 +428,25 @@ bcm_intc_attach(device_t dev)
428428
}
429429

430430
static device_method_t bcm_intc_methods[] = {
431+
/* Device interface */
431432
DEVMETHOD(device_probe, bcm_intc_probe),
432433
DEVMETHOD(device_attach, bcm_intc_attach),
433434

435+
/* Interrupt event interface */
436+
DEVMETHOD(intr_event_post_filter, bcm_intc_post_filter),
437+
DEVMETHOD(intr_event_post_ithread, bcm_intc_post_ithread),
438+
DEVMETHOD(intr_event_pre_ithread, bcm_intc_pre_ithread),
439+
440+
/* Interrupt controller interface */
434441
DEVMETHOD(pic_disable_intr, bcm_intc_disable_intr),
435442
DEVMETHOD(pic_enable_intr, bcm_intc_enable_intr),
436443
DEVMETHOD(pic_map_intr, bcm_intc_map_intr),
437-
DEVMETHOD(pic_post_filter, bcm_intc_post_filter),
438-
DEVMETHOD(pic_post_ithread, bcm_intc_post_ithread),
439-
DEVMETHOD(pic_pre_ithread, bcm_intc_pre_ithread),
440-
{ 0, 0 }
441-
};
442444

443-
static driver_t bcm_intc_driver = {
444-
"intc",
445-
bcm_intc_methods,
446-
sizeof(struct bcm_intc_softc),
445+
DEVMETHOD_END
447446
};
448447

448+
PRIVATE_DEFINE_CLASSN(intc, bcm_intc_driver, bcm_intc_methods,
449+
sizeof(struct bcm_intc_softc), pic_base_class);
450+
449451
EARLY_DRIVER_MODULE(intc, simplebus, bcm_intc_driver, 0, 0,
450452
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);

sys/arm/broadcom/bcm2835/bcm2836.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -723,15 +723,19 @@ bcm_lintc_attach(device_t dev)
723723
}
724724

725725
static device_method_t bcm_lintc_methods[] = {
726+
/* Device interface */
726727
DEVMETHOD(device_probe, bcm_lintc_probe),
727728
DEVMETHOD(device_attach, bcm_lintc_attach),
728729

730+
/* Interrupt event interface */
731+
DEVMETHOD(intr_event_post_filter, bcm_lintc_post_filter),
732+
DEVMETHOD(intr_event_post_ithread, bcm_lintc_post_ithread),
733+
DEVMETHOD(intr_event_pre_ithread, bcm_lintc_pre_ithread),
734+
735+
/* Interrupt controller interface */
729736
DEVMETHOD(pic_disable_intr, bcm_lintc_disable_intr),
730737
DEVMETHOD(pic_enable_intr, bcm_lintc_enable_intr),
731738
DEVMETHOD(pic_map_intr, bcm_lintc_map_intr),
732-
DEVMETHOD(pic_post_filter, bcm_lintc_post_filter),
733-
DEVMETHOD(pic_post_ithread, bcm_lintc_post_ithread),
734-
DEVMETHOD(pic_pre_ithread, bcm_lintc_pre_ithread),
735739
DEVMETHOD(pic_setup_intr, bcm_lintc_setup_intr),
736740
#ifdef SMP
737741
DEVMETHOD(pic_init_secondary, bcm_lintc_init_secondary),
@@ -742,11 +746,8 @@ static device_method_t bcm_lintc_methods[] = {
742746
DEVMETHOD_END
743747
};
744748

745-
static driver_t bcm_lintc_driver = {
746-
"lintc",
747-
bcm_lintc_methods,
748-
sizeof(struct bcm_lintc_softc),
749-
};
749+
PRIVATE_DEFINE_CLASSN(lintc, bcm_lintc_driver, bcm_lintc_methods,
750+
sizeof(struct bcm_lintc_softc), pic_base_class);
750751

751752
EARLY_DRIVER_MODULE(lintc, simplebus, bcm_lintc_driver, 0, 0,
752753
BUS_PASS_INTERRUPT);

sys/arm/freescale/imx/imx_gpio.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,11 @@ static device_method_t imx51_gpio_methods[] = {
917917
DEVMETHOD(device_attach, imx51_gpio_attach),
918918
DEVMETHOD(device_detach, imx51_gpio_detach),
919919

920+
/* Interrupt event interface */
921+
DEVMETHOD(intr_event_post_filter, gpio_pic_post_filter),
922+
DEVMETHOD(intr_event_post_ithread, gpio_pic_post_ithread),
923+
DEVMETHOD(intr_event_pre_ithread, gpio_pic_pre_ithread),
924+
920925
#ifdef INTRNG
921926
/* Bus interface */
922927
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
@@ -928,9 +933,6 @@ static device_method_t imx51_gpio_methods[] = {
928933
DEVMETHOD(pic_map_intr, gpio_pic_map_intr),
929934
DEVMETHOD(pic_setup_intr, gpio_pic_setup_intr),
930935
DEVMETHOD(pic_teardown_intr, gpio_pic_teardown_intr),
931-
DEVMETHOD(pic_post_filter, gpio_pic_post_filter),
932-
DEVMETHOD(pic_post_ithread, gpio_pic_post_ithread),
933-
DEVMETHOD(pic_pre_ithread, gpio_pic_pre_ithread),
934936
#endif
935937

936938
/* OFW methods */
@@ -948,14 +950,12 @@ static device_method_t imx51_gpio_methods[] = {
948950
DEVMETHOD(gpio_pin_toggle, imx51_gpio_pin_toggle),
949951
DEVMETHOD(gpio_pin_access_32, imx51_gpio_pin_access_32),
950952
DEVMETHOD(gpio_pin_config_32, imx51_gpio_pin_config_32),
951-
{0, 0},
952-
};
953953

954-
static driver_t imx51_gpio_driver = {
955-
"gpio",
956-
imx51_gpio_methods,
957-
sizeof(struct imx51_gpio_softc),
954+
DEVMETHOD_END
958955
};
959956

957+
PRIVATE_DEFINE_CLASSN(gpio, imx51_gpio_driver, imx51_gpio_methods,
958+
sizeof(struct imx51_gpio_softc), pic_base_class);
959+
960960
EARLY_DRIVER_MODULE(imx51_gpio, simplebus, imx51_gpio_driver, 0, 0,
961961
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);

0 commit comments

Comments
 (0)