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

Diff for /funnyos/sys/bus.h between version 1.3 and 1.7

version 1.3, 2007/10/16 19:31:07 version 1.7, 2007/10/25 20:58:47
Line 4 
Line 4 
 #ifndef _SYS_BUS_H  #ifndef _SYS_BUS_H
 #define _SYS_BUS_H  #define _SYS_BUS_H
   
 #include <sys/device.h>  #include <sys/types.h>
   
 /*  /*
  * Each bus (bus driver instance) has its own bus_handle.   * Each bus (bus driver instance) has its own bus_handle.
  * Device drivers attached to bus aquire bus_handle to perform all bus i/o.   * Device drivers attached to bus aquire bus_handle to perform all bus i/o.
  */   */
 struct bus_handle {  struct bus_handle {
           void *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);          uint8_t         (*bus_read_1)(void *ddp, uint32_t addr);
         uint16_t        (*bus_read_2)(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);          uint32_t        (*bus_read_4)(void *ddp, uint32_t addr);
Line 20 
Line 21 
         /* XXX DMA related stuff */          /* 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 */  #endif /* _SYS_BUS_H */

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

CVSweb