Ali Saidi wrote:
> I believe that the rules are as follows (from some google searches,
> but I couldn't find a definitive list):
> 64 bit arch/app -- Do nothing special
> 32 bit arch/app -- 64 bit values are aligned evenly with the exception
> of x86 and ARM OABI (which we don't support and don't intend to).
>
So what do we have that fits into the 2nd category? There's 32 bit SPARC
and ARM, but what else? I'll take care of those too.
> Assuming that is the case, all of the other OSes should have something
> like the following. If we support two endians for a given architecture
> (which we don't at the moment) the stitching together will have have
> to take that into account.
>
> For some reason I feel that the getSyscallArg should be templated on
> the size. Either machine bytes (actually something similar), or 64bits
> (if the argument is always 64 bits).
>
I can see where you're coming from, but I don't think it'd end up being
as clean syntactically. You're welcome to prove me wrong of course.
> uint64_t
> ArmLiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width)
> {
> assert(width == 32 || width == 64);
> assert(i < NumArgumentRegs);
> // Align index to even argument register
> if (width == 64 && index % 2)
> index++;
> uint64_t arg = (uint64_t)tc->readIntReg(index) << 32 | tc-
> >readIntReg(index+1);
> index += 2;
> return retVal;
> }
>
That looks like it'd do it.
Gabe
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev