From 68396ea9c0fe4f75ce30b1eba2c44c43c13344bb Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Fri, 24 Jun 2011 13:49:54 -0700 Subject: Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm --- iorange.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 iorange.h (limited to 'iorange.h') diff --git a/iorange.h b/iorange.h new file mode 100644 index 0000000..9783168 --- /dev/null +++ b/iorange.h @@ -0,0 +1,30 @@ +#ifndef IORANGE_H +#define IORANGE_H + +#include + +typedef struct IORange IORange; +typedef struct IORangeOps IORangeOps; + +struct IORangeOps { + void (*read)(IORange *iorange, uint64_t offset, unsigned width, + uint64_t *data); + void (*write)(IORange *iorange, uint64_t offset, unsigned width, + uint64_t data); +}; + +struct IORange { + const IORangeOps *ops; + uint64_t base; + uint64_t len; +}; + +static inline void iorange_init(IORange *iorange, const IORangeOps *ops, + uint64_t base, uint64_t len) +{ + iorange->ops = ops; + iorange->base = base; + iorange->len = len; +} + +#endif -- cgit v1.2.3