Merge zizzer:/bk/linux into zower.eecs.umich.edu:/z/hsul/work/bk/linux
[gem5.git] / sim / syscall_emul.hh
index 1031b0823a153dc5143882665d0c6cb603c1f67a..b425ef83c6d2c73b13d6300712757853eebaed75 100644 (file)
@@ -141,9 +141,9 @@ class TypedBufferArg : public BaseBufferArg
     operator T*() { return (T *)bufPtr; }
 
     // dereference operators
-    Toperator*()      { return *((T *)bufPtr); }
+    T &operator*()      { return *((T *)bufPtr); }
     T* operator->()     { return (T *)bufPtr; }
-    Toperator[](int i) { return ((T *)bufPtr)[i]; }
+    T &operator[](int i) { return ((T *)bufPtr)[i]; }
 };
 
 //////////////////////////////////////////////////////////////////////
@@ -191,6 +191,12 @@ int munmapFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc);
 /// Target gethostname() handler.
 int gethostnameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc);
 
+/// Target unlink() handler.
+int unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc);
+
+/// Target rename() handler.
+int renameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc);
+
 //////////////////////////////////////////////////////////////////////
 //
 // The following emulation functions are generic, but need to be
@@ -223,10 +229,12 @@ ioctlFunc(SyscallDesc *desc, int callnum, Process *process,
       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, ...)\n", fd, req);
+        fatal("Unsupported ioctl call: ioctl(%d, 0x%x, ...) @ 0x%llx\n", fd, req, xc->readPC());
     }
 }