=================================================================== RCS file: /cvs/funnyos/sys/bus.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- funnyos/sys/bus.h 2007/10/16 20:57:54 1.4 +++ funnyos/sys/bus.h 2007/10/16 21:40:47 1.5 @@ -1,5 +1,5 @@ /* - * $Id: bus.h,v 1.4 2007/10/16 19:57:54 init Exp $ + * $Id: bus.h,v 1.5 2007/10/16 20:40:47 init Exp $ */ #ifndef _SYS_BUS_H #define _SYS_BUS_H @@ -11,7 +11,7 @@ * Device drivers attached to bus aquire bus_handle to perform all bus i/o. */ struct bus_handle { - struct device *bh_ownerdevp; /* device that owns this handler XXX kill that it is ugly */ + struct device *bh_ownerdd; /* devdata of device that owns this handler XXX kill that it is ugly */ uint8_t (*bus_read_1)(void *ddp, uint32_t addr); uint16_t (*bus_read_2)(void *ddp, uint32_t addr); uint32_t (*bus_read_4)(void *ddp, uint32_t addr); @@ -21,8 +21,12 @@ /* XXX DMA related stuff */ }; -#define bus_read_1(dev, addr) ((struct busops *)dev->dv_devdata)->bus_read_1(dev, addr) -#define bus_write_1(dev, addr, data) ((struct busops *)dev->dv_devdata)->bus_write_1(dev, addr, data) +uint8_t bus_read_1(struct bus_handle *bhp, uint32_t addr); +uint16_t bus_read_2(struct bus_handle *bhp, uint32_t addr); +uint32_t bus_read_4(struct bus_handle *bhp, uint32_t addr); +int bus_write_1(struct bus_handle *bhp, uint32_t addr, uint8_t data); +int bus_write_2(struct bus_handle *bhp, uint32_t addr, uint16_t data); +int bus_write_4(struct bus_handle *bhp, uint32_t addr, uint32_t data); #endif /* _SYS_BUS_H */