summaryrefslogtreecommitdiff
path: root/linux/mga_drv.h
diff options
context:
space:
mode:
authorJeff Hartmann <jhartmann@valinux.com>2001-08-10 16:29:21 +0000
committerJeff Hartmann <jhartmann@valinux.com>2001-08-10 16:29:21 +0000
commit97b8aa52bba602d5babe225983f7e4c7cb4d7492 (patch)
tree922882797ea335549c01849c4dd2cdc350938be0 /linux/mga_drv.h
parentb6923b39539c34c2a589197def5eee72a9d719bf (diff)
Commit Keith Owens kernel Makefile changes, merge and commit alpha patch
set from Jay Estabrook (sans some mga modifications which broke other arch's.)
Diffstat (limited to 'linux/mga_drv.h')
-rw-r--r--linux/mga_drv.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/linux/mga_drv.h b/linux/mga_drv.h
index bb3d21b4..ba2602e7 100644
--- a/linux/mga_drv.h
+++ b/linux/mga_drv.h
@@ -145,14 +145,28 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv );
#define mga_flush_write_combine() mb()
-#define MGA_BASE( reg ) ((u32)(dev_priv->mmio->handle))
+#define MGA_BASE( reg ) ((unsigned long)(dev_priv->mmio->handle))
#define MGA_ADDR( reg ) (MGA_BASE(reg) + reg)
#define MGA_DEREF( reg ) *(volatile u32 *)MGA_ADDR( reg )
+#define MGA_DEREF8( reg ) *(volatile u8 *)MGA_ADDR( reg )
+
+#ifdef __alpha__
+#define MGA_READ( reg ) (_MGA_READ((u32 *)MGA_ADDR(reg)))
+#define MGA_WRITE( reg, val ) do { wmb(); MGA_DEREF( reg ) = val; } while (0)
+#define MGA_WRITE8( reg, val ) do { wmb(); MGA_DEREF8( reg ) = val; } while (0)
+
+static inline u32 _MGA_READ(u32 *addr)
+{
+ mb();
+ return *(volatile u32 *)addr;
+}
+
+#else
#define MGA_READ( reg ) MGA_DEREF( reg )
#define MGA_WRITE( reg, val ) do { MGA_DEREF( reg ) = val; } while (0)
-#define MGA_DEREF8( reg ) *(volatile u8 *)MGA_ADDR( reg )
#define MGA_WRITE8( reg, val ) do { MGA_DEREF8( reg ) = val; } while (0)
+#endif
#define DWGREG0 0x1c00
#define DWGREG0_END 0x1dff