[BACK]Return to bus.h CVS log [TXT][DIR] Up to [local] / funnyos / sys

Annotation of funnyos/sys/bus.h, Revision 1.4

1.1       init        1: /*
1.4     ! init        2:  * $Id: bus.h,v 1.3 2007/10/16 18:31:07 init Exp $
1.1       init        3:  */
                      4: #ifndef _SYS_BUS_H
                      5: #define _SYS_BUS_H
                      6:
                      7: #include <sys/device.h>
                      8:
                      9: /*
1.2       init       10:  * Each bus (bus driver instance) has its own bus_handle.
                     11:  * Device drivers attached to bus aquire bus_handle to perform all bus i/o.
1.1       init       12:  */
1.2       init       13: struct bus_handle {
1.4     ! init       14:        struct device *bh_ownerdevp;    /* device that owns this handler XXX kill that it is ugly */
1.3       init       15:        uint8_t         (*bus_read_1)(void *ddp, uint32_t addr);
                     16:        uint16_t        (*bus_read_2)(void *ddp, uint32_t addr);
                     17:        uint32_t        (*bus_read_4)(void *ddp, uint32_t addr);
                     18:        int             (*bus_write_1)(void *ddp, uint32_t addr, uint8_t data);
                     19:        int             (*bus_write_2)(void *ddp, uint32_t addr, uint16_t data);
                     20:        int             (*bus_write_4)(void *ddp, uint32_t addr, uint32_t data);
1.1       init       21:        /* XXX DMA related stuff */
                     22: };
                     23:
                     24: #define bus_read_1(dev, addr) ((struct busops *)dev->dv_devdata)->bus_read_1(dev, addr)
                     25:
                     26: #define bus_write_1(dev, addr, data) ((struct busops *)dev->dv_devdata)->bus_write_1(dev, addr, data)
                     27:
                     28: #endif /* _SYS_BUS_H */

CVSweb