summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2005-02-12 20:37:07 +0000
committerMichel Dänzer <michel@daenzer.net>2005-02-12 20:37:07 +0000
commit37cbb521d3ab8d96a8fcc0199424c0ddc70f0435 (patch)
treea7e9f67e2a6438f227953ce036b204f4f38a54eb /src/mesa/drivers/dri
parent2752177ade76f36229dda8da42948b173bdf08bc (diff)
MMIO endianness fixes for Radeon drivers.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/common/mmio.h5
-rw-r--r--src/mesa/drivers/dri/radeon/server/radeon_macros.h12
2 files changed, 5 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/common/mmio.h b/src/mesa/drivers/dri/common/mmio.h
index a9bdce42bf..d9fa3dec5f 100644
--- a/src/mesa/drivers/dri/common/mmio.h
+++ b/src/mesa/drivers/dri/common/mmio.h
@@ -38,12 +38,11 @@
static __inline__ u_int32_t
read_MMIO_LE32( volatile void * base, unsigned long offset )
{
- volatile void * p = ((volatile char *) base) + offset;
u_int32_t val;
-
+
__asm__ __volatile__( "lwbrx %0, %1, %2 ; eieio"
: "=r" (val)
- : "b" (base), "r" (offset), "m" (p) );
+ : "b" (base), "r" (offset) );
return val;
}
diff --git a/src/mesa/drivers/dri/radeon/server/radeon_macros.h b/src/mesa/drivers/dri/radeon/server/radeon_macros.h
index 11e80a6d00..8e0ca3411c 100644
--- a/src/mesa/drivers/dri/radeon/server/radeon_macros.h
+++ b/src/mesa/drivers/dri/radeon/server/radeon_macros.h
@@ -40,28 +40,22 @@
#ifndef _RADEON_MACROS_H_
#define _RADEON_MACROS_H_
-
+#include <mmio.h>
# define MMIO_IN8(base, offset) \
*(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN16(base, offset) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset))
# define MMIO_IN32(base, offset) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset))
+ read_MMIO_LE32(base, addr)
# define MMIO_OUT8(base, offset, val) \
*(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT16(base, offset, val) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
# define MMIO_OUT32(base, offset, val) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
+ *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = CPU_TO_LE32(val)
/* Memory mapped register access macros */
#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
-#define INREG16(addr) MMIO_IN16(RADEONMMIO, addr)
#define INREG(addr) MMIO_IN32(RADEONMMIO, addr)
#define OUTREG8(addr, val) MMIO_OUT8(RADEONMMIO, addr, val)
-#define OUTREG16(addr, val) MMIO_OUT16(RADEONMMIO, addr, val)
#define OUTREG(addr, val) MMIO_OUT32(RADEONMMIO, addr, val)
#define ADDRREG(addr) ((volatile GLuint *)(pointer)(RADEONMMIO + (addr)))