Thread (27 messages) flat view 27 messages, 8 authors, 2011-12-01

Re: [PATCH 5/6] powerpc/boot: Add mfdcrx

From: Segher Boessenkool <hidden>
Date: 2011-12-01 22:55:29

quoted
quoted
+#define mfdcrx(rn) \
+	({	\
+		unsigned long rval; \
+		asm volatile("mfdcrx %0,%1" : "=r"(rval) : "g"(rn)); \
+		rval; \
+	})
"g" is never correct on PowerPC, you want "r" here.  You can write
this as a static inline btw, you only need the #define stuff when
there is an "i" constraint involved.
I think you can still use static inlines even when a
constraint is one that requires a compile time constant.
Marking a function inline does not guarantee the compiler will
perform inline substitution on it, which you need here.  I don't
think it's a problem with recent GCC in the context of the Linux
kernel though, if you use __always_inline that is.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help