Power: The condition register should be set or cleared upon a system call

return to indicate success or failure.
This commit is contained in:
Timothy M. Jones 2010-07-22 18:54:37 +01:00
parent 607f519800
commit 97d245278d
2 changed files with 13 additions and 1 deletions

View file

@ -44,7 +44,12 @@ const char * const miscRegName[NUM_MISCREGS] = {
};
BitUnion32(Cr)
Bitfield<31,28> cr0;
SubBitUnion(cr0, 31, 28)
Bitfield<31> lt;
Bitfield<30> gt;
Bitfield<29> eq;
Bitfield<28> so;
EndSubBitUnion(cr0)
Bitfield<27,24> cr1;
EndBitUnion(Cr)

View file

@ -284,5 +284,12 @@ void
PowerLiveProcess::setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value)
{
Cr cr = tc->readIntReg(INTREG_CR);
if (return_value.successful()) {
cr.cr0.so = 0;
} else {
cr.cr0.so = 1;
}
tc->setIntReg(INTREG_CR, cr);
tc->setIntReg(ReturnValueReg, return_value.value());
}