In general, I'm fine with ignoring things and hoping it works.  I
think we should probably change the warn to warn_once.

Similarly, some of the syscalls that we're ignoring should probably
have a warning.
Maybe unimplementedFunc should really just be warn_once plus return error?

Any other opinions?

  Nate

> The current ioctl implementation is somewhat BSD-centric.  The few IOCTL
> values being checked have no Linux equivelant.  This changes things to
> just assume that most ioctl's we'll see are tty related and just return
> -ENOTTY.  This is enough for spec2k, though obviously not a good idea in
> the long run.
>
>
> diff -r 5ed84199f337 src/arch/x86/linux/syscalls.cc
> --- a/src/arch/x86/linux/syscalls.cc    Mon Sep 21 23:06:05 2009 -0400
> +++ b/src/arch/x86/linux/syscalls.cc    Mon Sep 21 23:16:41 2009 -0400
> @@ -244,7 +244,7 @@
>     /*  13 */ SyscallDesc("rt_sigaction", unimplementedFunc),
>     /*  14 */ SyscallDesc("rt_sigprocmask", ignoreFunc),
>     /*  15 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
> -    /*  16 */ SyscallDesc("ioctl", unimplementedFunc),
> +    /*  16 */ SyscallDesc("ioctl", ioctlFunc<X86Linux64>),
>     /*  17 */ SyscallDesc("pread64", unimplementedFunc),
>     /*  18 */ SyscallDesc("pwrite64", unimplementedFunc),
>     /*  19 */ SyscallDesc("readv", unimplementedFunc),
> @@ -561,7 +561,7 @@
>     /*  51 */ SyscallDesc("acct", unimplementedFunc),
>     /*  52 */ SyscallDesc("umount2", unimplementedFunc),
>     /*  53 */ SyscallDesc("lock", unimplementedFunc),
> -    /*  54 */ SyscallDesc("ioctl", unimplementedFunc),
> +    /*  54 */ SyscallDesc("ioctl", ioctlFunc<X86Linux32>),
>     /*  55 */ SyscallDesc("fcntl", unimplementedFunc),
>     /*  56 */ SyscallDesc("mpx", unimplementedFunc),
>     /*  57 */ SyscallDesc("setpgid", unimplementedFunc),
> diff -r 5ed84199f337 src/sim/syscall_emul.hh
> --- a/src/sim/syscall_emul.hh   Mon Sep 21 23:06:05 2009 -0400
> +++ b/src/sim/syscall_emul.hh   Mon Sep 21 23:16:41 2009 -0400
> @@ -486,19 +486,11 @@
>     }
>
>     switch (req) {
> -      case OS::TIOCISATTY_:
> -      case OS::TIOCGETP_:
> -      case OS::TIOCSETP_:
> -      case OS::TIOCSETN_:
> -      case OS::TIOCSETC_:
> -      case OS::TIOCGETC_:
> -      case OS::TIOCGETS_:
> -      case OS::TIOCGETA_:
> -        return -ENOTTY;
>
>       default:
> -        fatal("Unsupported ioctl call: ioctl(%d, 0x%x, ...) @ 0x%llx\n",
> +        warn("Unsupported ioctl call: ioctl(%d, 0x%x, ...) @ 0x%llx\n",
>               fd, req, tc->readPC());
> +        return -ENOTTY;
>     }
>  }
>
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>
>
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to