
In message 009b01c40baa$a324f2b0$cb01a8c0@xiphos.ca you wrote:
We're doing quite the tag team here.
;-)
The code from Xilinx is as follows...
void XIo_Out32(XIo_Address OutAddress, Xuint32 Value) { __asm__ volatile ("stw %0,0(%1); eieio" : : "r" (Value), "r" (OutAddress)); }
This code is broken. The "r" operand specification sais "a register operand is allowed provided that it is in a general register." Of course R0 is a GPR as well. I think you need to use "m" (any kind of address that the machine supports in general) here:
__asm__ volatile ("stw %0,0(%1); eieio" : : "r" (Value), "m" (OutAddress));
But why? What is it about this C code which causes this sort of thing?
Actually this is no C code, but inline assembler. And yes, it is the code, which uses an inappropriate operand specification.
What constraints should be used? Where is decent, unambiguous documentation
Use "m".
of gcc inline assembler (instead of poorly explained examples)?
The GCC info pages are pretty useful. See File: gcc.info, Node: Simple Constraints,
Thank you Wolfgang for your help so far. Your comments have been very useful.
I'm glad if I could help.
Best regards,
Wolfgang Denk