From 97b8aa52bba602d5babe225983f7e4c7cb4d7492 Mon Sep 17 00:00:00 2001 From: Jeff Hartmann Date: Fri, 10 Aug 2001 16:29:21 +0000 Subject: Commit Keith Owens kernel Makefile changes, merge and commit alpha patch set from Jay Estabrook (sans some mga modifications which broke other arch's.) --- linux/mga_drv.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'linux/mga_drv.h') 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 -- cgit v1.2.3