[Mplayer-cvslog] CVS: main/vidix/drivers cyberblade_regs.h,1.2,1.3 pm3_regs.h,1.1,1.2
Moritz Bunkus CVS
mosu at mplayerhq.hu
Wed Jan 15 12:16:36 CET 2003
Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var/tmp.root/cvs-serv14644/vidix/drivers
Modified Files:
cyberblade_regs.h pm3_regs.h
Log Message:
bunkus: Encapsulated arguments to #define in ( ... ) so that the #defines can be safely used like functions: mydef(flag ? val1 : val2)
Index: cyberblade_regs.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/cyberblade_regs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cyberblade_regs.h 3 Jan 2003 12:26:17 -0000 1.2
+++ cyberblade_regs.h 15 Jan 2003 11:16:33 -0000 1.3
@@ -129,10 +129,10 @@
int HACKBUCKET12345678; /* Horrible hack to work around cache/speed issue */
-#define INB(addr) (HACKBUCKET12345678=*(cyberblade_reg_base+addr))
-#define INW(addr) (HACKBUCKET12345678=*(unsigned short *)(cyberblade_reg_base+addr))
-#define OUTB(addr,val) (*(cyberblade_reg_base+addr)=(val))
-#define OUTW(addr,val) (*(unsigned short *)(cyberblade_reg_base+addr)=(val))
+#define INB(addr) (HACKBUCKET12345678=*(cyberblade_reg_base+(addr)))
+#define INW(addr) (HACKBUCKET12345678=*(unsigned short *)(cyberblade_reg_base+(addr)))
+#define OUTB(addr,val) (*(cyberblade_reg_base+(addr))=(val))
+#define OUTW(addr,val) (*(unsigned short *)(cyberblade_reg_base+(addr))=(val))
#define SRINB(reg) (OUTB(0x3c4,reg), INB(0x3c5))
#define SROUTB(reg,val) (OUTW(0x3c4,((val)<<8)|(reg)))
Index: pm3_regs.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/pm3_regs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pm3_regs.h 31 May 2002 23:17:43 -0000 1.1
+++ pm3_regs.h 15 Jan 2003 11:16:33 -0000 1.2
@@ -1060,10 +1060,10 @@
extern void *pm3_reg_base;
#define WRITE_REG(offset,val) \
- *(volatile unsigned long *)(((unsigned char *)(pm3_reg_base)) + offset) = (val)
+ *(volatile unsigned long *)(((unsigned char *)(pm3_reg_base)) + (offset)) = (val)
#define READ_REG(offset) \
- *(volatile unsigned long *)(((unsigned char *)(pm3_reg_base)) + offset)
+ *(volatile unsigned long *)(((unsigned char *)(pm3_reg_base)) + (offset))
#define UPDATE_SET_REG(offset,val) \
{ \
@@ -1094,8 +1094,8 @@
#define RAMDAC_SET_INDEX(index) \
{ \
- SLOW_WRITE_REG (PM3RD_IndexHigh,(index>>8)&0xff); \
- SLOW_WRITE_REG (PM3RD_IndexLow,index&0xff); \
+ SLOW_WRITE_REG (PM3RD_IndexHigh,((index)>>8)&0xff); \
+ SLOW_WRITE_REG (PM3RD_IndexLow,(index)&0xff); \
}
#define RAMDAC_SET_REG(index, data) \
More information about the MPlayer-cvslog
mailing list