Fixed assembler constraints for lwbrx and lhbrx

The biosemu on bimini had some problems with newer versions of GCC ... I saw
on a couple of websites that for lwbrx and lhbrx, the assembler constraint
"Z" should be used instead of "r". This seems to fix the hang.
This commit is contained in:
Thomas Huth 2011-12-20 18:53:08 +01:00
parent deb63aa40e
commit 1d328fe603
1 changed files with 4 additions and 2 deletions

View File

@ -121,7 +121,8 @@ static inline uint32_t
in32le(void *addr)
{
uint32_t val;
asm volatile ("lwbrx %0, 0, %1":"=r" (val):"r"(addr));
const uint32_t *zaddr = addr;
asm volatile ("lwbrx %0, %y1" : "=r"(val) : "Z"(*zaddr));
return val;
}
@ -135,7 +136,8 @@ static inline uint16_t
in16le(void *addr)
{
uint16_t val;
asm volatile ("lhbrx %0, 0, %1":"=r" (val):"r"(addr));
const uint16_t *zaddr = addr;
asm volatile ("lhbrx %0, %y1" : "=r"(val) : "Z"(*zaddr));
return val;
}