X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/6e940195253552fad1d2e5d3516af55de85008f3..39b5d600dedf02a61b8b1213f9fdaaee4b8292e0:/sys/sys/bus.h diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 8004bcf2ef..a4a36316da 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/bus.h,v 1.30.2.5 2004/03/17 17:54:25 njl Exp $ - * $DragonFly: src/sys/sys/bus.h,v 1.12 2004/05/05 16:57:11 hmp Exp $ + * $DragonFly: src/sys/sys/bus.h,v 1.17 2005/10/28 03:25:57 dillon Exp $ */ #ifndef _SYS_BUS_H_ @@ -34,6 +34,7 @@ #include #include +#include /* * Forward declarations @@ -46,29 +47,14 @@ typedef struct devclass *devclass_t; typedef void driver_intr_t(void*); /* - * We define this in terms of bits because some devices may belong - * to multiple classes (and therefore need to be included in - * multiple interrupt masks, which is what this really serves to - * indicate. Buses which do interrupt remapping will want to - * change their type to reflect what sort of devices are underneath. + * Interrupt features mask. Note that DragonFly no longer implements + * INTR_TYPE_* flags. */ -enum intr_type { - INTR_TYPE_TTY = 1, - INTR_TYPE_BIO = 2, - INTR_TYPE_NET = 4, - INTR_TYPE_CAM = 8, - INTR_TYPE_MISC = 16, - INTR_TYPE_CLK = 32, - INTR_TYPE_AV = 64, - INTR_FAST = 128, - INTR_EXCL = 256, - INTR_MPSAFE = 512, - INTR_ENTROPY = 1024 -}; - -#define INTR_TYPE_MASK (INTR_TYPE_TTY|INTR_TYPE_BIO|INTR_TYPE_NET|\ - INTR_TYPE_CAM|INTR_TYPE_MISC|INTR_TYPE_CLK|\ - INTR_TYPE_AV) +#define INTR_FAST 0x0080 +#define INTR_EXCL 0x0100 +#define INTR_MPSAFE 0x0200 +#define INTR_ENTROPY 0x0400 +#define INTR_NOPOLL 0x0800 /* interrupt cannot be polled (e.g. ata) */ enum intr_trigger { INTR_TRIGGER_CONFORM = 0, @@ -174,7 +160,6 @@ int resource_list_print_type(struct resource_list *rl, * The root bus, to which all top-level busses are attached. */ extern device_t root_bus; -extern devclass_t root_devclass; void root_bus_configure(void); /* @@ -198,11 +183,16 @@ int bus_generic_child_present(device_t dev, device_t child); int bus_generic_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int bus_generic_detach(device_t dev); +int bus_generic_disable_intr(device_t dev, device_t child, void *cookie); void bus_generic_driver_added(device_t dev, driver_t *driver); +void bus_generic_enable_intr(device_t dev, device_t child, void *cookie); int bus_print_child_header(device_t dev, device_t child); int bus_print_child_footer(device_t dev, device_t child); int bus_generic_print_child(device_t dev, device_t child); +int bus_generic_identify(driver_t *driver, device_t parent); +int bus_generic_identify_sameunit(driver_t *driver, device_t parent); int bus_generic_probe(device_t dev); +int bus_generic_probe_hack(device_t dev); int bus_generic_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); int bus_generic_release_resource(device_t bus, device_t child, @@ -210,7 +200,8 @@ int bus_generic_release_resource(device_t bus, device_t child, int bus_generic_resume(device_t dev); int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, - driver_intr_t *intr, void *arg, void **cookiep); + driver_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer); int bus_generic_shutdown(device_t dev); int bus_generic_suspend(device_t dev); int bus_generic_teardown_intr(device_t dev, device_t child, @@ -240,10 +231,13 @@ int bus_activate_resource(device_t dev, int type, int rid, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); +int bus_disable_intr(device_t dev, void *cookie); +void bus_enable_intr(device_t dev, void *cookie); int bus_release_resource(device_t dev, int type, int rid, struct resource *r); int bus_setup_intr(device_t dev, struct resource *r, int flags, - driver_intr_t handler, void *arg, void **cookiep); + driver_intr_t handler, void *arg, + void **cookiep, lwkt_serialize_t serializer); int bus_teardown_intr(device_t dev, struct resource *r, void *cookie); int bus_set_resource(device_t dev, int type, int rid, u_long start, u_long count);