|
|
| version 1.2, 2003/06/17 04:28:58 | version 1.3, 2003/11/17 00:54:40 |
|---|---|
| Line 24 | Line 24 |
| * SUCH DAMAGE. | * SUCH DAMAGE. |
| * | * |
| * $FreeBSD: src/sys/sys/bus.h,v 1.30.2.4 2002/10/10 15:13:33 jhb Exp $ | * $FreeBSD: src/sys/sys/bus.h,v 1.30.2.4 2002/10/10 15:13:33 jhb Exp $ |
| * $DragonFly: src/sys/sys/bus.h,v 1.1 2003/06/16 06:47:03 dillon Exp $ | * $DragonFly$ |
| */ | */ |
| #ifndef _SYS_BUS_H_ | #ifndef _SYS_BUS_H_ |
| Line 33 | Line 33 |
| #ifdef _KERNEL | #ifdef _KERNEL |
| #include <sys/queue.h> | #include <sys/queue.h> |
| #include <sys/kobj.h> | |
| /* | /* |
| * Forward declarations | * Forward declarations |
| */ | */ |
| typedef struct device *device_t; | typedef struct device *device_t; |
| typedef struct driver driver_t; | typedef struct driver driver_t; |
| typedef struct device_method device_method_t; | |
| typedef struct devclass *devclass_t; | typedef struct devclass *devclass_t; |
| typedef struct device_ops *device_ops_t; | #define device_method_t kobj_method_t |
| typedef struct device_op_desc *device_op_desc_t; | |
| typedef void driver_intr_t(void*); | typedef void driver_intr_t(void*); |
| Line 65 enum intr_type { | Line 64 enum intr_type { |
| typedef int (*devop_t)(void); | typedef int (*devop_t)(void); |
| struct device_method { | |
| device_op_desc_t desc; | |
| devop_t func; | |
| }; | |
| struct driver { | struct driver { |
| const char *name; /* driver name */ | KOBJ_CLASS_FIELDS; |
| device_method_t *methods; /* method table */ | |
| size_t softc; /* size of device softc struct */ | |
| void *priv; /* driver private data */ | void *priv; /* driver private data */ |
| device_ops_t ops; /* compiled method table */ | |
| int refs; /* # devclasses containing driver */ | |
| }; | }; |
| typedef enum device_state { | typedef enum device_state { |
| Line 313 int resource_count(void); | Line 303 int resource_count(void); |
| /* | /* |
| * Shorthand for constructing method tables. | * Shorthand for constructing method tables. |
| */ | */ |
| #define DEVMETHOD(NAME, FUNC) { &NAME##_desc, (devop_t) FUNC } | #define DEVMETHOD KOBJMETHOD |
| /* | /* |
| * Some common device interfaces. | * Some common device interfaces. |