|
From: Florian K. <fl...@ei...> - 2015-04-08 09:46:07
|
On 08.04.2015 11:15, Julian Seward wrote:
>
>> Isn't there also a correctness issue with the status quo? You might get
>> a false result by comparing a SysRes from a pipe call with a SysRes from
>> a non-pipe call.
>
> That is true, but that is not a mips-specific problem -- it applies to all
> targets. You need to know that two SysRess came from the same syscall
> before comparing them.
Oh, you are right. Is equality of sycall numbers ensured today when we
do an sr_EQ? I briefly looked at the code and the single use of sr_EQ is
in eq_SyscallStatus which again is called once. Perhaps system call
numbers in that context are guaranteed to be the same, but it is not
obvious to me.
Which then raises the question of whether the system call number should
be added to SysRes for all archs (and maintained properly) and taken
into consideration in sr_EQ.
Perhaps:
typedef
struct {
UWord _sysno;
UWord _val
#if defined(VGA_mips32) || defined(VGA_mips64)
Bool _valEx;
#endif
}
SysRes;
static inline Bool sr_EQ ( SysRes sr1, SysRes sr2 ) {
return sr1._sysno == sr2._sysno // <----<< new
&& sr1._val == sr2._val
&& sr1._isError == sr2._isError
#if defined(VGA_mips32) || defined(VGA_mips64)
&& (sr1._sysno != _NR_pipe || sr1._valEx == sr2._valEx)
#endif
;
}
Florian
|