summaryrefslogtreecommitdiff
path: root/fb/fbbits.h
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2006-08-01 13:45:43 -0700
committerAaron Plattner <aplattner@nvidia.com>2006-08-01 13:45:43 -0700
commitee02e647882a4be29e1130bd79904ee79ed6b802 (patch)
treef4a2d76b462019f4ea16a7c2004d257db6684ab6 /fb/fbbits.h
parenta69335dc299be6de8b82ed34de1cb30f1255feb4 (diff)
Wrap libwfb memory access.
Use the READ and WRITE macros to wrap memory accesses that could be in video memory. Add MEMCPY_WRAPPED and MEMSET_WRAPPED macros to wrap memcpy and memset, respectively.
Diffstat (limited to 'fb/fbbits.h')
-rw-r--r--fb/fbbits.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/fb/fbbits.h b/fb/fbbits.h
index e99a297b5..603c02929 100644
--- a/fb/fbbits.h
+++ b/fb/fbbits.h
@@ -42,13 +42,13 @@
#ifdef BITSSTORE
#define STORE(b,x) BITSSTORE(b,x)
#else
-#define STORE(b,x) (*(b) = (x))
+#define STORE(b,x) WRITE((b), (x))
#endif
#ifdef BITSRROP
#define RROP(b,a,x) BITSRROP(b,a,x)
#else
-#define RROP(b,a,x) (*(b) = FbDoRRop (*(b), (a), (x)))
+#define RROP(b,a,x) WRITE((b), FbDoRRop (READ(b), (a), (x)))
#endif
#ifdef BITSUNIT
@@ -545,18 +545,18 @@ ARC (FbBits *dst,
# define WRITE_ADDR4(n) ((n))
#endif
-#define WRITE1(d,n,fg) ((d)[WRITE_ADDR1(n)] = (BITS) (fg))
+#define WRITE1(d,n,fg) WRITE(d + WRITE_ADDR1(n), (BITS) (fg))
#ifdef BITS2
-# define WRITE2(d,n,fg) (*((BITS2 *) &((d)[WRITE_ADDR2(n)])) = (BITS2) (fg))
+# define WRITE2(d,n,fg) WRITE((BITS2 *) &((d)[WRITE_ADDR2(n)]), (BITS2) (fg))
#else
-# define WRITE2(d,n,fg) WRITE1(d,(n)+1,WRITE1(d,n,fg))
+# define WRITE2(d,n,fg) (WRITE1(d,n,fg), WRITE1(d,(n)+1,fg))
#endif
#ifdef BITS4
-# define WRITE4(d,n,fg) (*((BITS4 *) &((d)[WRITE_ADDR4(n)])) = (BITS4) (fg))
+# define WRITE4(d,n,fg) WRITE((BITS4 *) &((d)[WRITE_ADDR4(n)]), (BITS4) (fg))
#else
-# define WRITE4(d,n,fg) WRITE2(d,(n)+2,WRITE2(d,n,fg))
+# define WRITE4(d,n,fg) (WRITE2(d,n,fg), WRITE2(d,(n)+2,fg))
#endif
void
@@ -892,20 +892,20 @@ POLYSEGMENT (DrawablePtr pDrawable,
FbMaskBits (dstX, width, startmask, nmiddle, endmask);
if (startmask)
{
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, startmask);
+ WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, startmask));
dstLine++;
}
if (!andBits)
while (nmiddle--)
- *dstLine++ = xorBits;
+ WRITE(dstLine++, xorBits);
else
while (nmiddle--)
{
- *dstLine = FbDoRRop (*dstLine, andBits, xorBits);
+ WRITE(dstLine, FbDoRRop (READ(dstLine), andBits, xorBits));
dstLine++;
}
if (endmask)
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, endmask);
+ WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, endmask));
}
else
{