File: [local] / funnyos / sys / bus.h (download)
Revision 1.1.1.1 (vendor branch), Tue Oct 16 08:41:05 2007 UTC (16 years, 8 months ago) by init
Branch: nbrk
CVS Tags: init Changes since 1.1: +0 -0 lines
Initial import of funnyos; still much more work to do
|
/*
* $Id: bus.h,v 1.1.1.1 2007/10/16 08:41:05 init Exp $
*/
#ifndef _SYS_BUS_H
#define _SYS_BUS_H
#include <sys/device.h>
/*
* Bus operations.
*/
struct busops {
uint8_t (*bus_read_1)(struct device *devp, uint32_t addr);
uint16_t (*bus_read_2)(struct device *devp, uint32_t addr);
uint32_t (*bus_read_4)(struct device *devp, uint32_t addr);
int (*bus_write_1)(struct device *devp, uint32_t addr, uint8_t data);
int (*bus_write_2)(struct device *devp, uint32_t addr, uint16_t data);
int (*bus_write_4)(struct device *devp, uint32_t addr, uint32_t data);
/* 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)
#endif /* _SYS_BUS_H */