--- trunk/src/include/device.h 2007/10/08 16:18:38 12 +++ trunk/src/include/device.h 2007/10/08 16:19:23 20 @@ -28,12 +28,13 @@ * SUCH DAMAGE. * * - * $Id: device.h,v 1.9 2005/08/05 09:11:49 debug Exp $ + * $Id: device.h,v 1.14 2005/11/22 16:26:38 debug Exp $ * * Device registry. (See device.c for more info.) */ #include "misc.h" +#include "bus_pci.h" struct machine; @@ -43,10 +44,12 @@ char *name2; /* e.g. "secondary serial port" */ uint64_t addr; /* Device base address */ + uint64_t addr2; /* Secondary address (optional) */ uint64_t len; int irq_nr; int in_use; int addr_mult; + int pci_little_endian; void *return_ptr; }; @@ -56,6 +59,12 @@ int (*initf)(struct devinit *); }; +struct pci_entry { + char *name; + void (*initf)(struct machine *, struct memory *, + struct pci_device *); +}; + /* autodev.c: (built automatically in the devices/ directory): */ void autodev_init(void); @@ -68,5 +77,10 @@ void device_set_exit_on_error(int exit_on_error); void device_init(void); +/* PCI stuff: (TODO: move somewhere else?) */ +int pci_register(char *name, void (*initf)(struct machine *, struct memory *, + struct pci_device *)); +void (*pci_lookup_initf(char *name))(struct machine *machine, + struct memory *mem, struct pci_device *pd); -#endif /* CONSOLE_H */ +#endif /* DEVICE_H */