Search
lxdream.org :: lxdream :: r474:a0345bf296ed
lxdream 0.9.1
released Jun 29
Download Now
changeset474:a0345bf296ed
parent473:bbbeca9ccf13
child475:49841795db97
authornkeynes
dateWed Oct 31 09:05:44 2007 +0000 (12 years ago)
Add convenience MMIO_ADDR macro
src/mmio.h
1.1 --- a/src/mmio.h Wed Oct 31 09:05:13 2007 +0000
1.2 +++ b/src/mmio.h Wed Oct 31 09:05:44 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: mmio.h,v 1.6 2006-06-27 11:02:46 nkeynes Exp $
1.6 + * $Id: mmio.h,v 1.7 2007-10-31 09:05:44 nkeynes Exp $
1.7 *
1.8 * mmio.h defines a complicated batch of macros used to build up the
1.9 * memory-mapped I/O regions in a reasonably readable fashion.
1.10 @@ -70,6 +70,7 @@
1.11 #define MMIO_READ( id, r ) *((int32_t *)(mmio_region_##id.mem + (r)))
1.12 #define MMIO_READF( id, r ) *((float *)(mmio_region_##id.mem + (r)))
1.13 #define MMIO_WRITE( id, r, v ) *((int32_t *)(mmio_region_##id.mem + (r))) = (v)
1.14 +#define MMIO_ADDR( id, r) ((int32_t *)(mmio_region_##id.mem + (r)))
1.15 #define MMIO_REG( id, r ) ((int32_t *)(mmio_region_##id.mem + (r)))
1.16 #define MMIO_REGID( mid, r ) (mmio_region_##mid.index[(r)>>2] != NULL ? \
1.17 mmio_region_##mid.index[(r)>>2]->id : "<UNDEF>" )
.