On Fri, Feb 27, 2009 at 9:34 AM, Gabe Black <[email protected]> wrote:
> changeset d35d2b28df38 in /z/repo/m5
> details: http://repo.m5sim.org/m5?cmd=changeset;node=d35d2b28df38
> description:
>        X86: Add a class to support 32 bit x86 linux process.
>
> diff -r 2b989b925c9c -r d35d2b28df38 src/arch/x86/linux/process.cc
> --- a/src/arch/x86/linux/process.cc     Thu Feb 26 19:29:17 2009 -0500
> +++ b/src/arch/x86/linux/process.cc     Fri Feb 27 09:21:14 2009 -0800
> @@ -72,26 +72,17 @@
>  SyscallDesc*
>  X86LinuxProcess::getDesc(int callnum)
>  {
> -    if (callnum < 0 || callnum > Num_Syscall_Descs)
> +    if (callnum < 0 || callnum >= Num_Syscall_Descs)
>         return NULL;
>     return &syscallDescs[callnum];
>  }

Looks like this bug is there in all of the ISAs... I just fixed it and
am running regressions now.  Just a reminder that if you do see
something that looks like it might be a problem in more than one place
to at least give us a heads up about it.

>
> -X86LinuxProcess::X86LinuxProcess(LiveProcessParams * params,
> +X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params,
>         ObjectFile *objFile)
> -    : X86LiveProcess(params, objFile),
> -    Num_Syscall_Descs(273)
> +    : X86LinuxProcess(params, objFile, syscallDescs, 273)
>  {}
[...]
> +I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params,
> +        ObjectFile *objFile)
> +    : X86LinuxProcess(params, objFile, syscallDescs, 324)
> +{}

Why the magic numbers (273, 324)?  I see that the automatic
calculation in other ISAs isn't feasible here because you've got the
syscalls in a separate file... but I don't see the benefit in
splitting them out, since now process.cc only has about a half dozen
lines of actual code in it, particularly when the price you pay is
having to use arbitrary constants like this.

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

Reply via email to