Vince Weaver wrote:
>> +    // I'm not sure why, but the length argument is in arg reg 3
>> +    loff_t length = process->getSyscallArg(tc, 3);
>>     
>
> The reason for this is that on various architectures, if you are passing a 
> 64-bit value on a 32-bit architecture, the 64-bit value has to be in an 
> even/odd register pair.  So on calls like ftruncate64 a register is wasted 
> to get this alignment.
>
> I am pretty sure at least ARM and MIPS are like this, and I guess PPC if 
> you needed this fix.  X86 doesn't need this as far as I know, so for x86 
> to use this syscall we'll have to handle this differently.  What would be 
> the cleanest way to do this... an #ifdef ?  ( that's what qemu does) or 
> would there be some sort of OO way to do it?
>
> Vince
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>   

The getSyscallArg function can be defined differently for different
types of processes, typically 32 bit vs. 64 bit. Defining those
differently might do it. It could be more complicated than that if, for
instance, the number of register pairs is dependent on the syscall so
the location of argument n depends on how many pairs that particular
syscall uses before getting to n. In any case, I think the process
object would be a good place for a fix.

Gabe
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to