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

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

1.1       init        1: /*
1.2     ! init        2:  * $Id: bus.h,v 1.1.1.1 2007/10/16 08:41:05 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.1       init       14:        uint8_t         (*bus_read_1)(struct device *devp, uint32_t addr);
                     15:        uint16_t        (*bus_read_2)(struct device *devp, uint32_t addr);
                     16:        uint32_t        (*bus_read_4)(struct device *devp, uint32_t addr);
                     17:        int             (*bus_write_1)(struct device *devp, uint32_t addr, uint8_t data);
                     18:        int             (*bus_write_2)(struct device *devp, uint32_t addr, uint16_t data);
                     19:        int             (*bus_write_4)(struct device *devp, uint32_t addr, uint32_t data);
                     20:        /* XXX DMA related stuff */
                     21: };
                     22:
                     23: #define bus_read_1(dev, addr) ((struct busops *)dev->dv_devdata)->bus_read_1(dev, addr)
                     24:
                     25: #define bus_write_1(dev, addr, data) ((struct busops *)dev->dv_devdata)->bus_write_1(dev, addr, data)
                     26:
                     27: #endif /* _SYS_BUS_H */

CVSweb