Skip to content

Commit

Permalink
CRIS v32: Minor changes to avoid errors in asm-cris/arch-v32/hwregs/r…
Browse files Browse the repository at this point in the history
…eg_rdwr.h

- Add ifdef around macros to read and write hardware registers
- Add parens around REG_READ expression to avoid possible precedence errors.
- Remove useless CVS id tag.
  • Loading branch information
jniax committed Feb 8, 2008
1 parent b8ed6b4 commit 1791f53
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/asm-cris/arch-v32/hwregs/reg_rdwr.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/* $Id: reg_rdwr.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
*
/*
* Read/write register macros used by *_defs.h
*/

#ifndef reg_rdwr_h
#define reg_rdwr_h

#ifndef REG_READ
#define REG_READ(type, addr) (*((volatile type *) (addr)))
#endif

#define REG_READ(type, addr) *((volatile type *) (addr))

#ifndef REG_WRITE
#define REG_WRITE(type, addr, val) \
do { *((volatile type *) (addr)) = (val); } while(0)
#endif

#endif

0 comments on commit 1791f53

Please sign in to comment.