summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2012-11-09 14:29:15 +0800
committerThomas Chou <thomas@wytron.com.tw>2012-11-10 19:45:58 +0800
commit4f63bfb68945ce5ebf0a819152014ba0f88f76ff (patch)
tree5e1c3175755bd2ce3badb6329738339650f27b94
parent59852d03867108217fe88e3bfc3e1e9cedfe63c5 (diff)
nios2: use builtin functions for control registers access
The commit 51926d5ee0be029fb45f10f42756df97279f8ad3 COMMON: Use __stringify() instead of rest of implementations forgot to update the wrctl funtion, and causes compilation error. But there are builtin functions for control registers access in nios2 comipiler. It is convenient to use them instead. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Cc: Marek Vasut <marex@denx.de>
-rw-r--r--include/nios2.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/include/nios2.h b/include/nios2.h
index df8126a66e..cbca0dc01f 100644
--- a/include/nios2.h
+++ b/include/nios2.h
@@ -24,8 +24,6 @@
#ifndef __NIOS2_H__
#define __NIOS2_H__
-#include <linux/stringify.h>
-
/*------------------------------------------------------------------------
* Control registers -- use with wrctl() & rdctl()
*----------------------------------------------------------------------*/
@@ -39,14 +37,8 @@
* Access to control regs
*----------------------------------------------------------------------*/
-#define rdctl(reg)\
- ({unsigned int val;\
- asm volatile("rdctl %0, ctl" __stringify(reg) \
- : "=r" (val) ); val;})
-
-#define wrctl(reg,val)\
- asm volatile( "wrctl ctl" _str_(reg) ",%0"\
- : : "r" (val))
+#define rdctl(reg) __builtin_rdctl(reg)
+#define wrctl(reg, val) __builtin_wrctl(reg, val)
/*------------------------------------------------------------------------
* Control reg bit masks