SPARC clean up towards compilability.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 14 Mar 2006 20:59:19 +0000 (15:59 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 14 Mar 2006 20:59:19 +0000 (15:59 -0500)
--HG--
extra : convert_revision : 156670995fa61599e763b002cd70f31f19b108d1

arch/sparc/SConscript
arch/sparc/isa/base.isa
arch/sparc/isa/decoder.isa
arch/sparc/isa/includes.isa
arch/sparc/isa_traits.hh
arch/sparc/linux/process.cc
arch/sparc/linux/process.hh
arch/sparc/process.cc
arch/sparc/process.hh

index edff5821ed229ea3c72d4c8a2eb256440a2d819f..172e4390f7f54b896950e3dd76e0756a76d0e1f4 100644 (file)
@@ -57,8 +57,7 @@ full_system_sources = Split('''
 
 # Syscall emulation (non-full-system) sources
 syscall_emulation_sources = Split('''
-       common_syscall_emul.cc
-       linux_process.cc
+       linux/process.cc
        process.cc
        ''')
 
index 992504369b2c449f7cf3ddf8faf16a1ffd59c9c1..916a9c5a53276d5e4212b91f3c458bfb0b400f08 100644 (file)
@@ -11,7 +11,7 @@ output header {{
             uint8_t v:1;
             uint8_t z:1;
             uint8_t n:1;
-        }
+        };
 
         enum condTest
         {
@@ -31,7 +31,7 @@ output header {{
             Negative=0x6,
             OverflowClear=0xF,
             OverflowSet=0x7
-        }
+        };
 
         /**
          * Base class for all SPARC static instructions.
index eb458211b7dd77617303d06ef7daeebc2ac16d5b..eaf3aab3b4d2b2c71ec79fc70c78ba65a9612f18 100644 (file)
@@ -6,7 +6,7 @@
 decode OP default Trap::unknown({{IllegalInstruction}}) {
 
         0x0: decode OP2 {
-            0x0: Trap::illtrap({{illegal_instruction}});  //ILLTRAP
+            //0x0: Trap::illtrap({{IllegalInstruction}});  //ILLTRAP
             0x1: Branch::bpcc({{
                 switch((CC12 << 1) | CC02)
                 {
index a99018b495e437a0db71ef74c6601959434dd280..860f4657a0e55a7516e398c32072393ffb13ce88 100644 (file)
@@ -10,7 +10,7 @@ output header {{
 
 #include "cpu/static_inst.hh"
 #include "arch/sparc/faults.hh"
-#include "mem/mem_req.hh"  // some constructors use MemReq flags
+#include "mem/request.hh"  // some constructors use MemReq flags
 #include "arch/sparc/isa_traits.hh"
 }};
 
@@ -34,7 +34,7 @@ output exec {{
 #endif
 
 #ifdef FULL_SYSTEM
-//#include "arch/alpha/pseudo_inst.hh"
+//#include "sim/pseudo_inst.hh"
 #endif
 #include "cpu/base.hh"
 #include "cpu/exetrace.hh"
index bd3c35beb7a9845d65f42516fabf28e243ef0f94..3e7800910cd58de8e235b3a4881759800c78b9ba 100644 (file)
 #ifndef __ARCH_SPARC_ISA_TRAITS_HH__
 #define __ARCH_SPARC_ISA_TRAITS_HH__
 
-#include "arch/sparc/faults.hh"
 #include "base/misc.hh"
 #include "config/full_system.hh"
 #include "sim/host.hh"
 
-//This makes sure the big endian versions of certain functions are used.
-namespace BigEndianGuest {}
-using namespace BigEndianGuest;
-
 class ExecContext;
 class FastCPU;
 //class FullCPU;
 class Checkpoint;
 
-#define TARGET_SPARC
-
 class StaticInst;
 class StaticInstPtr;
 
-//namespace EV5
-//{
-//     int DTB_ASN_ASN(uint64_t reg);
-//     int ITB_ASN_ASN(uint64_t reg);
-//}
+namespace BigEndianGuest {}
+
+#if !FULL_SYSTEM
+class SyscallReturn
+{
+  public:
+    template <class T>
+    SyscallReturn(T v, bool s)
+    {
+        retval = (uint64_t)v;
+        success = s;
+    }
+
+    template <class T>
+    SyscallReturn(T v)
+    {
+        success = (v >= 0);
+        retval = (uint64_t)v;
+    }
+
+    ~SyscallReturn() {}
+
+    SyscallReturn& operator=(const SyscallReturn& s)
+    {
+        retval = s.retval;
+        success = s.success;
+        return *this;
+    }
+
+    bool successful() { return success; }
+    uint64_t value() { return retval; }
+
+    private:
+    uint64_t retval;
+    bool success;
+};
+
+#endif
+
 
 namespace SparcISA
 {
+    //This makes sure the big endian versions of certain functions are used.
+    using namespace BigEndianGuest;
+
     typedef uint32_t MachInst;
     typedef uint64_t ExtMachInst;
-    typedef uint8_t  RegIndex;
 
-    const int NumFloatRegs = 32;
+    const int NumIntRegs = 32;
+    const int NumFloatRegs = 64;
     const int NumMiscRegs = 32;
 
-    const int // Maximum trap level
-    const int MaxTL = 4;
-    const int
-    const int // semantically meaningful register indices
+    // semantically meaningful register indices
     const int ZeroReg = 0;     // architecturally meaningful
-    const int // the rest of these depend on the ABI
+    // the rest of these depend on the ABI
     const int StackPointerReg = 14;
     const int ReturnAddressReg = 31; // post call, precall is 15
     const int ReturnValueReg = 8; // Post return, 24 is pre-return.
@@ -82,359 +109,37 @@ namespace SparcISA
     // Some OS syscall sue a second register (o1) to return a second value
     const int SyscallPseudoReturnReg = ArgumentReg1;
 
+    //XXX These numbers are bogus
+    const int MaxInstSrcRegs = 3;
+    const int MaxInstDestRegs = 2;
+
+    typedef uint64_t IntReg;
+
+    // control register file contents
+    typedef uint64_t MiscReg;
+
+    typedef double FloatReg;
+    typedef uint64_t FloatRegBits;
 
     //8K. This value is implmentation specific; and should probably
     //be somewhere else.
     const int LogVMPageSize = 13;
     const int VMPageSize = (1 << LogVMPageSize);
 
+    //Why does both the previous set of constants and this one exist?
+    const int PageShift = 13;
+    const int PageBytes = ULL(1) << PageShift;
 
+    const int BranchPredAddrShiftAmt = 2;
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    typedef uint64_t IntReg;
-
-    class IntRegFile
-    {
-        private:
-          //For right now, let's pretend the register file is static
-          IntReg regs[32];
-        public:
-          IntReg & operator [] (RegIndex index)
-          {
-              //Don't allow indexes outside of the 32 registers
-              index &= 0x1F;
-              return regs[index];
-          }
-    };
+    const int WordBytes = 4;
+    const int HalfwordBytes = 2;
+    const int ByteBytes = 1;
 
     void serialize(std::ostream & os);
 
     void unserialize(Checkpoint *cp, const std::string &section);
 
-    typedef float float32_t;
-    typedef double float64_t;
-    //FIXME This actually usually refers to a 10 byte float, rather than a
-    //16 byte float as required. This data type may have to be emulated.
-    typedef long double float128_t;
-
-    class FloatRegFile
-    {
-      private:
-        //By using the largest data type, we ensure everything
-        //is aligned correctly in memory
-        union
-        {
-            float128_t rawRegs[16];
-            uint64_t regDump[32];
-        };
-        class QuadRegs
-        {
-          private:
-            FloatRegFile * parent;
-          public:
-            QuadRegs(FloatRegFile * p) : parent(p) {;}
-            float128_t & operator [] (RegIndex index)
-            {
-                //Quad floats are index by the single
-                //precision register the start on,
-                //and only 16 should be accessed
-                index = (index >> 2) & 0xF;
-                return parent->rawRegs[index];
-            }
-        };
-        class DoubleRegs
-        {
-          private:
-            FloatRegFile * parent;
-          public:
-            DoubleRegs(FloatRegFile * p) : parent(p) {;}
-            float64_t & operator [] (RegIndex index)
-            {
-                //Double floats are index by the single
-                //precision register the start on,
-                //and only 32 should be accessed
-                index = (index >> 1) & 0x1F;
-                return ((float64_t *)parent->rawRegs)[index];
-            }
-        };
-        class SingleRegs
-        {
-          private:
-            FloatRegFile * parent;
-          public:
-            SingleRegs(FloatRegFile * p) : parent(p) {;}
-            float32_t & operator [] (RegIndex index)
-            {
-                //Only 32 single floats should be accessed
-                index &= 0x1F;
-                return ((float32_t *)parent->rawRegs)[index];
-            }
-        };
-      public:
-        void serialize(std::ostream & os);
-
-        void unserialize(Checkpoint * cp, std::string & section);
-
-        QuadRegs quadRegs;
-        DoubleRegs doubleRegs;
-        SingleRegs singleRegs;
-        FloatRegFile() : quadRegs(this), doubleRegs(this), singleRegs(this)
-        {;}
-    };
-
-    // control register file contents
-    typedef uint64_t MiscReg;
-    // The control registers, broken out into fields
-    class MiscRegFile
-    {
-      private:
-        union
-        {
-            uint16_t pstate;           // Process State Register
-            struct
-            {
-                uint16_t ag:1;         // Alternate Globals
-                uint16_t ie:1;         // Interrupt enable
-                uint16_t priv:1;       // Privelege mode
-                uint16_t am:1;         // Address mask
-                uint16_t pef:1;                // PSTATE enable floating-point
-                uint16_t red:1;                // RED (reset, error, debug) state
-                uint16_t mm:2;         // Memory Model
-                uint16_t tle:1;                // Trap little-endian
-                uint16_t cle:1;                // Current little-endian
-            } pstateFields;
-        };
-        uint64_t tba;          // Trap Base Address
-        union
-        {
-            uint64_t y;                // Y (used in obsolete multiplication)
-            struct
-            {
-                uint64_t value:32;     // The actual value stored in y
-                uint64_t :32;  // reserved bits
-            } yFields;
-        };
-        uint8_t pil;           // Process Interrupt Register
-        uint8_t cwp;           // Current Window Pointer
-        uint16_t tt[MaxTL];    // Trap Type (Type of trap which occured
-                                // on the previous level)
-        union
-        {
-            uint8_t    ccr;            // Condition Code Register
-            struct
-            {
-                union
-                {
-                    uint8_t icc:4;     // 32-bit condition codes
-                    struct
-                    {
-                        uint8_t c:1;   // Carry
-                        uint8_t v:1;   // Overflow
-                        uint8_t z:1;   // Zero
-                        uint8_t n:1;   // Negative
-                    } iccFields;
-                };
-                union
-                {
-                    uint8_t xcc:4;     // 64-bit condition codes
-                    struct
-                    {
-                        uint8_t c:1;   // Carry
-                        uint8_t v:1;   // Overflow
-                        uint8_t z:1;   // Zero
-                        uint8_t n:1;   // Negative
-                    } xccFields;
-                };
-            } ccrFields;
-        };
-        uint8_t asi;           // Address Space Identifier
-        uint8_t tl;            // Trap Level
-        uint64_t tpc[MaxTL];   // Trap Program Counter (value from
-                                // previous trap level)
-        uint64_t tnpc[MaxTL];  // Trap Next Program Counter (value from
-                                // previous trap level)
-        union
-        {
-            uint64_t tstate[MaxTL];    // Trap State
-            struct
-            {
-                //Values are from previous trap level
-                uint64_t cwp:5;                // Current Window Pointer
-                uint64_t :2;   // Reserved bits
-                uint64_t pstate:10;    // Process State
-                uint64_t :6;   // Reserved bits
-                uint64_t asi:8;                // Address Space Identifier
-                uint64_t ccr:8;                // Condition Code Register
-            } tstateFields[MaxTL];
-        };
-        union
-        {
-            uint64_t tick;             // Hardware clock-tick counter
-            struct
-            {
-                uint64_t counter:63;   // Clock-tick count
-                uint64_t npt:1;                // Non-priveleged trap
-            } tickFields;
-        };
-        uint8_t cansave;       // Savable windows
-        uint8_t canrestore;    // Restorable windows
-        uint8_t otherwin;      // Other windows
-        uint8_t cleanwin;      // Clean windows
-        union
-        {
-            uint8_t wstate;            // Window State
-            struct
-            {
-                uint8_t normal:3;      // Bits TT<4:2> are set to on a normal
-                                        // register window trap
-                uint8_t other:3;       // Bits TT<4:2> are set to on an "otherwin"
-                                        // register window trap
-            } wstateFields;
-        };
-        union
-        {
-            uint64_t ver;              // Version
-            struct
-            {
-                uint64_t maxwin:5;     // Max CWP value
-                uint64_t :2;   // Reserved bits
-                uint64_t maxtl:8;      // Maximum trap level
-                uint64_t :8;   // Reserved bits
-                uint64_t mask:8;       // Processor mask set revision number
-                uint64_t impl:16;      // Implementation identification number
-                uint64_t manuf:16;     // Manufacturer code
-            } verFields;
-        };
-        union
-        {
-            uint64_t   fsr;    // Floating-Point State Register
-            struct
-            {
-                union
-                {
-                    uint64_t cexc:5;   // Current excpetion
-                    struct
-                    {
-                        uint64_t nxc:1;                // Inexact
-                        uint64_t dzc:1;                // Divide by zero
-                        uint64_t ufc:1;                // Underflow
-                        uint64_t ofc:1;                // Overflow
-                        uint64_t nvc:1;                // Invalid operand
-                    } cexecFields;
-                };
-                union
-                {
-                    uint64_t aexc:5;           // Accrued exception
-                    struct
-                    {
-                        uint64_t nxc:1;                // Inexact
-                        uint64_t dzc:1;                // Divide by zero
-                        uint64_t ufc:1;                // Underflow
-                        uint64_t ofc:1;                // Overflow
-                        uint64_t nvc:1;                // Invalid operand
-                    } aexecFields;
-                };
-                uint64_t fcc0:2;               // Floating-Point condtion codes
-                uint64_t :1;           // Reserved bits
-                uint64_t qne:1;                        // Deferred trap queue not empty
-                                                // with no queue, it should read 0
-                uint64_t ftt:3;                        // Floating-Point trap type
-                uint64_t ver:3;                        // Version (of the FPU)
-                uint64_t :2;           // Reserved bits
-                uint64_t ns:1;                 // Nonstandard floating point
-                union
-                {
-                    uint64_t tem:5;                    // Trap Enable Mask
-                    struct
-                    {
-                        uint64_t nxm:1;                // Inexact
-                        uint64_t dzm:1;                // Divide by zero
-                        uint64_t ufm:1;                // Underflow
-                        uint64_t ofm:1;                // Overflow
-                        uint64_t nvm:1;                // Invalid operand
-                    } temFields;
-                };
-                uint64_t :2;           // Reserved bits
-                uint64_t rd:2;                 // Rounding direction
-                uint64_t fcc1:2;               // Floating-Point condition codes
-                uint64_t fcc2:2;               // Floating-Point condition codes
-                uint64_t fcc3:2;               // Floating-Point condition codes
-                uint64_t :26;          // Reserved bits
-            } fsrFields;
-        };
-        union
-        {
-            uint8_t            fprs;   // Floating-Point Register State
-            struct
-            {
-                uint8_t dl:1;          // Dirty lower
-                uint8_t du:1;          // Dirty upper
-                uint8_t fef:1;         // FPRS enable floating-Point
-            } fprsFields;
-        };
-
-      public:
-        MiscReg readReg(int misc_reg);
-
-        MiscReg readRegWithEffect(int misc_reg, Fault &fault, ExecContext *xc);
-
-        Fault setReg(int misc_reg, const MiscReg &val);
-
-        Fault setRegWithEffect(int misc_reg, const MiscReg &val,
-                               ExecContext *xc);
-
-        void serialize(std::ostream & os);
-
-        void unserialize(Checkpoint * cp, std::string & section);
-    };
-
-    typedef union
-    {
-        float32_t singReg;
-        float64_t doubReg;
-        float128_t quadReg;
-    } FloatReg;
-
-    typedef union
-    {
-        IntReg  intreg;
-        FloatReg   fpreg;
-        MiscReg ctrlreg;
-    } AnyReg;
-
-    struct RegFile
-    {
-        IntRegFile intRegFile;         // (signed) integer register file
-        FloatRegFile floatRegFile;     // floating point register file
-        MiscRegFile miscRegFile;       // control register file
-
-        Addr pc;               // Program Counter
-        Addr npc;              // Next Program Counter
-        Addr nnpc;
-
-        void serialize(std::ostream &os);
-        void unserialize(Checkpoint *cp, const std::string &section);
-    };
-
     StaticInstPtr decodeInst(MachInst);
 
     // return a no-op instruction... used for instruction fetch faults
@@ -463,65 +168,32 @@ namespace SparcISA
      * @param xc The execution context.
      */
     template <class XC>
+    void zeroRegisters(XC *xc);
+}
+
+#include "arch/sparc/regfile.hh"
+
+namespace SparcISA
+{
 
-    static inline setSyscallReturn(SyscallReturn return_value, RegFile *regs)
+#if !FULL_SYSTEM
+    static inline void setSyscallReturn(SyscallReturn return_value,
+            RegFile *regs)
     {
         // check for error condition.  SPARC syscall convention is to
         // indicate success/failure in reg the carry bit of the ccr
         // and put the return value itself in the standard return value reg ().
         if (return_value.successful()) {
             // no error
-            regs->miscRegFile.ccrFields.iccFields.c = 0;
+            regs->miscRegs.setReg(MISCREG_CCR_ICC_C, 0);
             regs->intRegFile[ReturnValueReg] = return_value.value();
         } else {
             // got an error, return details
-            regs->miscRegFile.ccrFields.iccFields.c = 1;
+            regs->miscRegs.setReg(MISCREG_CCR_ICC_C, 1);
             regs->intRegFile[ReturnValueReg] = -return_value.value();
         }
     }
-};
-
-#if !FULL_SYSTEM
-class SyscallReturn
-{
-  public:
-    template <class T>
-    SyscallReturn(T v, bool s)
-    {
-        retval = (uint64_t)v;
-        success = s;
-    }
-
-    template <class T>
-    SyscallReturn(T v)
-    {
-        success = (v >= 0);
-        retval = (uint64_t)v;
-    }
-
-    ~SyscallReturn() {}
-
-    SyscallReturn& operator=(const SyscallReturn& s)
-    {
-        retval = s.retval;
-        success = s.success;
-        return *this;
-    }
-
-    bool successful() { return success; }
-    uint64_t value() { return retval; }
-
-    private:
-    uint64_t retval;
-    bool success;
-};
-
-#endif
-
-
-#if FULL_SYSTEM
-
-#include "arch/alpha/ev5.hh"
 #endif
+};
 
 #endif // __ARCH_SPARC_ISA_TRAITS_HH__
index fa2a7b9f5f025d3d4efa2cc0b78884734d0103e4..30c786ad39eca20247a94f6a20858b425e5636ba 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "arch/sparc/common_syscall_emul.hh"
 #include "arch/sparc/linux/process.hh"
 #include "arch/sparc/isa_traits.hh"
 
 #include "base/trace.hh"
 #include "cpu/exec_context.hh"
 #include "kern/linux/linux.hh"
-#include "mem/functional/functional.hh"
 
 #include "sim/process.hh"
 #include "sim/syscall_emul.hh"
@@ -55,318 +53,318 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
     strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
     strcpy(name->machine, "sparc");
 
-    name.copyOut(xc->mem);
+    name.copyOut(xc->getMemPort());
     return 0;
 }
 
 SyscallDesc SparcLinuxProcess::syscallDescs[] = {
-    /*  0 */ SyscallDesc("restart_syscall", unimplementedFunc);
-    /*  1 */ SyscallDesc("exit", exitFunc);
-    /*  2 */ SyscallDesc("fork", unimplementedFunc);
-    /*  3 */ SyscallDesc("read", readFunc);
-    /*  4 */ SyscallDesc("write", writeFunc);
-    /*  5 */ SyscallDesc("open", openFunc<Linux>);
-    /*  6 */ SyscallDesc("close", closeFinc);
-    /*  7 */ SyscallDesc("wait4", unimplementedFunc);
-    /*  8 */ SyscallDesc("creat", unimplementedFunc);
-    /*  9 */ SyscallDesc("link", unimplementedFunc);
-    /* 10 */ SyscallDesc("unlink", unlinkFunc);
-    /* 11 */ SyscallDesc("execv", unimplementedFunc);
-    /* 12 */ SyscallDesc("chdir", unimplementedFunc);
-    /* 13 */ SyscallDesc("chown", chownFunc);
-    /* 14 */ SyscallDesc("mknod", unimplementedFunc);
-    /* 15 */ SyscallDesc("chmod", chmodFunc<Linux>);
-    /* 16 */ SyscallDesc("lchown", unimplementedFunc);
-    /* 17 */ SyscallDesc("brk", obreakFunc);
-    /* 18 */ SyscallDesc("perfctr", unimplementedFunc);
-    /* 19 */ SyscallDesc("lseek", lseekFunc);
-    /* 20 */ SyscallDesc("getpid", getpidFunc);
-    /* 21 */ SyscallDesc("capget", unimplementedFunc);
-    /* 22 */ SyscallDesc("capset", unimplementedFunc);
-    /* 23 */ SyscallDesc("setuid", setuidFunc);
-    /* 24 */ SyscallDesc("getuid", getuidFunc);
-    /* 25 */ SyscallDesc("time", unimplementedFunc);
-    /* 26 */ SyscallDesc("ptrace", unimplementedFunc);
-    /* 27 */ SyscallDesc("alarm", unimplementedFunc);
-    /* 28 */ SyscallDesc("sigaltstack", unimplementedFunc);
-    /* 29 */ SyscallDesc("pause", unimplementedFunc);
-    /* 30 */ SyscallDesc("utime", unimplementedFunc);
-    /* 31 */ SyscallDesc("lchown32", unimplementedFunc);
-    /* 32 */ SyscallDesc("fchown32", unimplementedFunc);
-    /* 33 */ SyscallDesc("access", unimplementedFunc);
-    /* 34 */ SyscallDesc("nice", unimplementedFunc);
-    /* 35 */ SyscallDesc("chown32", unimplementedFunc);
-    /* 36 */ SyscallDesc("sync", unimplementedFunc);
-    /* 37 */ SyscallDesc("kill", unimplementedFunc);
-    /* 38 */ SyscallDesc("stat", unimplementedFunc);
-    /* 39 */ SyscallDesc("sendfile", unimplementedFunc);
-    /* 40 */ SyscallDesc("lstat", unimplementedFunc);
-    /* 41 */ SyscallDesc("dup", unimplementedFunc);
-    /* 42 */ SyscallDesc("pipe", pipePseudoFunc);
-    /* 43 */ SyscallDesc("times", unimplementedFunc);
-    /* 44 */ SyscallDesc("getuid32", unimplementedFunc);
-    /* 45 */ SyscallDesc("umount2", unimplementedFunc);
-    /* 46 */ SyscallDesc("setgid", unimplementedFunc);
-    /* 47 */ SyscallDesc("getgid", getgidFunc);
-    /* 48 */ SyscallDesc("signal", unimplementedFunc);
-    /* 49 */ SyscallDesc("geteuid", geteuidFunc);
-    /* 50 */ SyscallDesc("getegid", getegidFunc);
-    /* 51 */ SyscallDesc("acct", unimplementedFunc);
-    /* 52 */ SyscallDesc("memory_ordering", unimplementedFunc);
-    /* 53 */ SyscallDesc("getgid32", unimplementedFunc);
-    /* 54 */ SyscallDesc("ioctl", unimplementedFunc);
-    /* 55 */ SyscallDesc("reboot", unimplementedFunc);
-    /* 56 */ SyscallDesc("mmap2", unimplementedFunc);
-    /* 57 */ SyscallDesc("symlink", unimplementedFunc);
-    /* 58 */ SyscallDesc("readlink", unimplementedFunc);
-    /* 59 */ SyscallDesc("execve", unimplementedFunc);
-    /* 60 */ SyscallDesc("umask", unimplementedFunc);
-    /* 61 */ SyscallDesc("chroot", unimplementedFunc);
-    /* 62 */ SyscallDesc("fstat", unimplementedFunc);
-    /* 63 */ SyscallDesc("fstat64", unimplementedFunc);
-    /* 64 */ SyscallDesc("getpagesize", unimplementedFunc);
-    /* 65 */ SyscallDesc("msync", unimplementedFunc);
-    /* 66 */ SyscallDesc("vfork", unimplementedFunc);
-    /* 67 */ SyscallDesc("pread64", unimplementedFunc);
-    /* 68 */ SyscallDesc("pwrite64", unimplementedFunc);
-    /* 69 */ SyscallDesc("geteuid32", unimplementedFunc);
-    /* 70 */ SyscallDesc("getdgid32", unimplementedFunc);
-    /* 71 */ SyscallDesc("mmap", unimplementedFunc);
-    /* 72 */ SyscallDesc("setreuid32", unimplementedFunc);
-    /* 73 */ SyscallDesc("munmap", unimplementedFunc);
-    /* 74 */ SyscallDesc("mprotect", unimplementedFunc);
-    /* 75 */ SyscallDesc("madvise", unimplementedFunc);
-    /* 76 */ SyscallDesc("vhangup", unimplementedFunc);
-    /* 77 */ SyscallDesc("truncate64", unimplementedFunc);
-    /* 78 */ SyscallDesc("mincore", unimplementedFunc);
-    /* 79 */ SyscallDesc("getgroups", unimplementedFunc);
-    /* 80 */ SyscallDesc("setgroups", unimplementedFunc);
-    /* 81 */ SyscallDesc("getpgrp", unimplementedFunc);
-    /* 82 */ SyscallDesc("setgroups32", unimplementedFunc);
-    /* 83 */ SyscallDesc("setitimer", unimplementedFunc);
-    /* 84 */ SyscallDesc("ftruncate64", unimplementedFunc);
-    /* 85 */ SyscallDesc("swapon", unimplementedFunc);
-    /* 86 */ SyscallDesc("getitimer", unimplementedFunc);
-    /* 87 */ SyscallDesc("setuid32", unimplementedFunc);
-    /* 88 */ SyscallDesc("sethostname", unimplementedFunc);
-    /* 89 */ SyscallDesc("setgid32", unimplementedFunc);
-    /* 90 */ SyscallDesc("dup2", unimplementedFunc);
-    /* 91 */ SyscallDesc("setfsuid32", unimplementedFunc);
-    /* 92 */ SyscallDesc("fcntl", unimplementedFunc);
-    /* 93 */ SyscallDesc("select", unimplementedFunc);
-    /* 94 */ SyscallDesc("setfsgid32", unimplementedFunc);
-    /* 95 */ SyscallDesc("fsync", unimplementedFunc);
-    /* 96 */ SyscallDesc("setpriority", unimplementedFunc);
-    /* 97 */ SyscallDesc("socket", unimplementedFunc);
-    /* 98 */ SyscallDesc("connect", unimplementedFunc);
-    /* 99 */ SyscallDesc("accept", unimplementedFunc);
-    /* 100 */ SyscallDesc("getpriority", unimplementedFunc);
-    /* 101 */ SyscallDesc("rt_sigreturn", unimplementedFunc);
-    /* 102 */ SyscallDesc("rt_sigaction", unimplementedFunc);
-    /* 103 */ SyscallDesc("rt_sigprocmask", unimplementedFunc);
-    /* 104 */ SyscallDesc("rt_sigpending", unimplementedFunc);
-    /* 105 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc);
-    /* 106 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc);
-    /* 107 */ SyscallDesc("rt_sigsuspend", unimplementedFunc);
-    /* 108 */ SyscallDesc("setresuid", unimplementedFunc);
-    /* 109 */ SyscallDesc("getresuid", unimplementedFunc);
-    /* 110 */ SyscallDesc("setresgid", unimplementedFunc);
-    /* 111 */ SyscallDesc("getresgid", unimplementedFunc);
-    /* 112 */ SyscallDesc("setregid32", unimplementedFunc);
-    /* 113 */ SyscallDesc("recvmsg", unimplementedFunc);
-    /* 114 */ SyscallDesc("sendmsg", unimplementedFunc);
-    /* 115 */ SyscallDesc("getgroups32", unimplementedFunc);
-    /* 116 */ SyscallDesc("gettimeofday", unimplementedFunc);
-    /* 117 */ SyscallDesc("getrusage", unimplementedFunc);
-    /* 118 */ SyscallDesc("getsockopt", unimplementedFunc);
-    /* 119 */ SyscallDesc("getcwd", unimplementedFunc);
-    /* 120 */ SyscallDesc("readv", unimplementedFunc);
-    /* 121 */ SyscallDesc("writev", unimplementedFunc);
-    /* 122 */ SyscallDesc("settimeofday", unimplementedFunc);
-    /* 123 */ SyscallDesc("fchown", unimplementedFunc);
-    /* 124 */ SyscallDesc("fchmod", unimplementedFunc);
-    /* 125 */ SyscallDesc("recvfrom", unimplementedFunc);
-    /* 126 */ SyscallDesc("setreuid", unimplementedFunc);
-    /* 127 */ SyscallDesc("setregid", unimplementedFunc);
-    /* 128 */ SyscallDesc("rename", unimplementedFunc);
-    /* 129 */ SyscallDesc("truncate", unimplementedFunc);
-    /* 130 */ SyscallDesc("ftruncate", unimplementedFunc);
-    /* 131 */ SyscallDesc("flock", unimplementedFunc);
-    /* 132 */ SyscallDesc("lstat64", unimplementedFunc);
-    /* 133 */ SyscallDesc("sendto", unimplementedFunc);
-    /* 134 */ SyscallDesc("shutdown", unimplementedFunc);
-    /* 135 */ SyscallDesc("socketpair", unimplementedFunc);
-    /* 136 */ SyscallDesc("mkdir", unimplementedFunc);
-    /* 137 */ SyscallDesc("rmdir", unimplementedFunc);
-    /* 138 */ SyscallDesc("utimes", unimplementedFunc);
-    /* 139 */ SyscallDesc("stat64", unimplementedFunc);
-    /* 140 */ SyscallDesc("sendfile64", unimplementedFunc);
-    /* 141 */ SyscallDesc("getpeername", unimplementedFunc);
-    /* 142 */ SyscallDesc("futex", unimplementedFunc);
-    /* 143 */ SyscallDesc("gettid", unimplementedFunc);
-    /* 144 */ SyscallDesc("getrlimit", unimplementedFunc);
-    /* 145 */ SyscallDesc("setrlimit", unimplementedFunc);
-    /* 146 */ SyscallDesc("pivot_root", unimplementedFunc);
-    /* 147 */ SyscallDesc("prctl", unimplementedFunc);
-    /* 148 */ SyscallDesc("pciconfig_read", unimplementedFunc);
-    /* 149 */ SyscallDesc("pciconfig_write", unimplementedFunc);
-    /* 150 */ SyscallDesc("getsockname", unimplementedFunc);
-    /* 151 */ SyscallDesc("inotify_init", unimplementedFunc);
-    /* 152 */ SyscallDesc("inotify_add_watch", unimplementedFunc);
-    /* 153 */ SyscallDesc("poll", unimplementedFunc);
-    /* 154 */ SyscallDesc("getdents64", unimplementedFunc);
-    /* 155 */ SyscallDesc("fcntl64", unimplementedFunc);
-    /* 156 */ SyscallDesc("inotify_rm_watch", unimplementedFunc);
-    /* 157 */ SyscallDesc("statfs", unimplementedFunc);
-    /* 158 */ SyscallDesc("fstatfs", unimplementedFunc);
-    /* 159 */ SyscallDesc("umount", unimplementedFunc);
-    /* 160 */ SyscallDesc("sched_set_affinity", unimplementedFunc);
-    /* 161 */ SyscallDesc("sched_get_affinity", unimplementedFunc);
-    /* 162 */ SyscallDesc("getdomainname", unimplementedFunc);
-    /* 163 */ SyscallDesc("setdomainname", unimplementedFunc);
-    /* 164 */ SyscallDesc("utrap_install", unimplementedFunc);
-    /* 165 */ SyscallDesc("quotactl", unimplementedFunc);
-    /* 166 */ SyscallDesc("set_tid_address", unimplementedFunc);
-    /* 167 */ SyscallDesc("mount", unimplementedFunc);
-    /* 168 */ SyscallDesc("ustat", unimplementedFunc);
-    /* 169 */ SyscallDesc("setxattr", unimplementedFunc);
-    /* 170 */ SyscallDesc("lsetxattr", unimplementedFunc);
-    /* 171 */ SyscallDesc("fsetxattr", unimplementedFunc);
-    /* 172 */ SyscallDesc("getxattr", unimplementedFunc);
-    /* 173 */ SyscallDesc("lgetxattr", unimplementedFunc);
-    /* 174 */ SyscallDesc("getdents", unimplementedFunc);
-    /* 175 */ SyscallDesc("setsid", unimplementedFunc);
-    /* 176 */ SyscallDesc("fchdir", unimplementedFunc);
-    /* 177 */ SyscallDesc("fgetxattr", unimplementedFunc);
-    /* 178 */ SyscallDesc("listxattr", unimplementedFunc);
-    /* 179 */ SyscallDesc("llistxattr", unimplementedFunc);
-    /* 180 */ SyscallDesc("flistxattr", unimplementedFunc);
-    /* 181 */ SyscallDesc("removexattr", unimplementedFunc);
-    /* 182 */ SyscallDesc("lremovexattr", unimplementedFunc);
-    /* 183 */ SyscallDesc("sigpending", unimplementedFunc);
-    /* 184 */ SyscallDesc("query_module", unimplementedFunc);
-    /* 185 */ SyscallDesc("setpgid", unimplementedFunc);
-    /* 186 */ SyscallDesc("fremovexattr", unimplementedFunc);
-    /* 187 */ SyscallDesc("tkill", unimplementedFunc);
-    /* 188 */ SyscallDesc("exit_group", unimplementedFunc);
-    /* 189 */ SyscallDesc("uname", unameFunc);
-    /* 190 */ SyscallDesc("init_module", unimplementedFunc);
-    /* 191 */ SyscallDesc("personality", unimplementedFunc);
-    /* 192 */ SyscallDesc("remap_file_pages", unimplementedFunc);
-    /* 193 */ SyscallDesc("epoll_create", unimplementedFunc);
-    /* 194 */ SyscallDesc("epoll_ctl", unimplementedFunc);
-    /* 195 */ SyscallDesc("epoll_wait", unimplementedFunc);
-    /* 196 */ SyscallDesc("ioprio_set", unimplementedFunc);
-    /* 197 */ SyscallDesc("getppid", getppidFunc);
-    /* 198 */ SyscallDesc("sigaction", unimplementedFunc);
-    /* 199 */ SyscallDesc("sgetmask", unimplementedFunc);
-    /* 200 */ SyscallDesc("ssetmask", unimplementedFunc);
-    /* 201 */ SyscallDesc("sigsuspend", unimplementedFunc);
-    /* 202 */ SyscallDesc("oldlstat", unimplementedFunc);
-    /* 203 */ SyscallDesc("uselib", unimplementedFunc);
-    /* 204 */ SyscallDesc("readdir", unimplementedFunc);
-    /* 205 */ SyscallDesc("readahead", unimplementedFunc);
-    /* 206 */ SyscallDesc("socketcall", unimplementedFunc);
-    /* 207 */ SyscallDesc("syslog", unimplementedFunc);
-    /* 208 */ SyscallDesc("lookup_dcookie", unimplementedFunc);
-    /* 209 */ SyscallDesc("fadvise64", unimplementedFunc);
-    /* 210 */ SyscallDesc("fadvise64_64", unimplementedFunc);
-    /* 211 */ SyscallDesc("tgkill", unimplementedFunc);
-    /* 212 */ SyscallDesc("waitpid", unimplementedFunc);
-    /* 213 */ SyscallDesc("swapoff", unimplementedFunc);
-    /* 214 */ SyscallDesc("sysinfo", unimplementedFunc);
-    /* 215 */ SyscallDesc("ipc", unimplementedFunc);
-    /* 216 */ SyscallDesc("sigreturn", unimplementedFunc);
-    /* 217 */ SyscallDesc("clone", unimplementedFunc);
-    /* 218 */ SyscallDesc("ioprio_get", unimplementedFunc);
-    /* 219 */ SyscallDesc("adjtimex", unimplementedFunc);
-    /* 220 */ SyscallDesc("sigprocmask", unimplementedFunc);
-    /* 221 */ SyscallDesc("create_module", unimplementedFunc);
-    /* 222 */ SyscallDesc("delete_module", unimplementedFunc);
-    /* 223 */ SyscallDesc("get_kernel_syms", unimplementedFunc);
-    /* 224 */ SyscallDesc("getpgid", unimplementedFunc);
-    /* 225 */ SyscallDesc("bdflush", unimplementedFunc);
-    /* 226 */ SyscallDesc("sysfs", unimplementedFunc);
-    /* 227 */ SyscallDesc("afs_syscall", unimplementedFunc);
-    /* 228 */ SyscallDesc("setfsuid", unimplementedFunc);
-    /* 229 */ SyscallDesc("setfsgid", unimplementedFunc);
-    /* 230 */ SyscallDesc("_newselect", unimplementedFunc);
-    /* 231 */ SyscallDesc("time", unimplementedFunc);
-    /* 232 */ SyscallDesc("oldstat", unimplementedFunc);
-    /* 233 */ SyscallDesc("stime", unimplementedFunc);
-    /* 234 */ SyscallDesc("statfs64", unimplementedFunc);
-    /* 235 */ SyscallDesc("fstatfs64", unimplementedFunc);
-    /* 236 */ SyscallDesc("_llseek", unimplementedFunc);
-    /* 237 */ SyscallDesc("mlock", unimplementedFunc);
-    /* 238 */ SyscallDesc("munlock", unimplementedFunc);
-    /* 239 */ SyscallDesc("mlockall", unimplementedFunc);
-    /* 240 */ SyscallDesc("munlockall", unimplementedFunc);
-    /* 241 */ SyscallDesc("sched_setparam", unimplementedFunc);
-    /* 242 */ SyscallDesc("sched_getparam", unimplementedFunc);
-    /* 243 */ SyscallDesc("sched_setscheduler", unimplementedFunc);
-    /* 244 */ SyscallDesc("sched_getscheduler", unimplementedFunc);
-    /* 245 */ SyscallDesc("sched_yield", unimplementedFunc);
-    /* 246 */ SyscallDesc("sched_get_priority_max", unimplimented);
-    /* 247 */ SyscallDesc("sched_get_priority_min", unimplimented);
-    /* 248 */ SyscallDesc("sched_rr_get_interval", unimplimented);
-    /* 249 */ SyscallDesc("nanosleep", unimplementedFunc);
-    /* 250 */ SyscallDesc("mremap", unimplementedFunc);
-    /* 251 */ SyscallDesc("_sysctl", unimplementedFunc);
-    /* 252 */ SyscallDesc("getsid", unimplementedFunc);
-    /* 253 */ SyscallDesc("fdatasync", unimplementedFunc);
-    /* 254 */ SyscallDesc("nfsservctl", unimplementedFunc);
-    /* 255 */ SyscallDesc("aplib", unimplementedFunc);
-    /* 256 */ SyscallDesc("clock_settime", unimplementedFunc);
-    /* 257 */ SyscallDesc("clock_gettime", unimplementedFunc);
-    /* 258 */ SyscallDesc("clock_getres", unimplementedFunc);
-    /* 259 */ SyscallDesc("clock_nanosleep", unimplementedFunc);
-    /* 260 */ SyscallDesc("sched_getaffinity", unimplementedFunc);
-    /* 261 */ SyscallDesc("sched_setaffinity", unimplementedFunc);
-    /* 262 */ SyscallDesc("timer_settime", unimplementedFunc);
-    /* 263 */ SyscallDesc("timer_gettime", unimplementedFunc);
-    /* 264 */ SyscallDesc("timer_getoverrun", unimplementedFunc);
-    /* 265 */ SyscallDesc("timer_delete", unimplementedFunc);
-    /* 266 */ SyscallDesc("timer_create", unimplementedFunc);
-    /* 267 */ SyscallDesc("vserver", unimplementedFunc);
-    /* 268 */ SyscallDesc("io_setup", unimplementedFunc);
-    /* 269 */ SyscallDesc("io_destroy", unimplementedFunc);
-    /* 270 */ SyscallDesc("io_submit", unimplementedFunc);
-    /* 271 */ SyscallDesc("io_cancel", unimplementedFunc);
-    /* 272 */ SyscallDesc("io_getevents", unimplementedFunc);
-    /* 273 */ SyscallDesc("mq_open", unimplementedFunc);
-    /* 274 */ SyscallDesc("mq_unlink", unimplementedFunc);
-    /* 275 */ SyscallDesc("mq_timedsend", unimplementedFunc);
-    /* 276 */ SyscallDesc("mq_timedreceive", unimplementedFunc);
-    /* 277 */ SyscallDesc("mq_notify", unimplementedFunc);
-    /* 278 */ SyscallDesc("mq_getsetattr", unimplementedFunc);
-    /* 279 */ SyscallDesc("waitid", unimplementedFunc);
-    /* 280 */ SyscallDesc("sys_setaltroot", unimplementedFunc);
-    /* 281 */ SyscallDesc("add_key", unimplementedFunc);
-    /* 282 */ SyscallDesc("request_key", unimplementedFunc);
-    /* 283 */ SyscallDesc("keyctl", unimplementedFunc);
+    /*  0 */ SyscallDesc("restart_syscall", unimplementedFunc),
+    /*  1 */ SyscallDesc("exit", exitFunc),
+    /*  2 */ SyscallDesc("fork", unimplementedFunc),
+    /*  3 */ SyscallDesc("read", readFunc),
+    /*  4 */ SyscallDesc("write", writeFunc),
+    /*  5 */ SyscallDesc("open", openFunc<Linux>),
+    /*  6 */ SyscallDesc("close", closeFunc),
+    /*  7 */ SyscallDesc("wait4", unimplementedFunc),
+    /*  8 */ SyscallDesc("creat", unimplementedFunc),
+    /*  9 */ SyscallDesc("link", unimplementedFunc),
+    /* 10 */ SyscallDesc("unlink", unlinkFunc),
+    /* 11 */ SyscallDesc("execv", unimplementedFunc),
+    /* 12 */ SyscallDesc("chdir", unimplementedFunc),
+    /* 13 */ SyscallDesc("chown", chownFunc),
+    /* 14 */ SyscallDesc("mknod", unimplementedFunc),
+    /* 15 */ SyscallDesc("chmod", chmodFunc<Linux>),
+    /* 16 */ SyscallDesc("lchown", unimplementedFunc),
+    /* 17 */ SyscallDesc("brk", obreakFunc),
+    /* 18 */ SyscallDesc("perfctr", unimplementedFunc),
+    /* 19 */ SyscallDesc("lseek", lseekFunc),
+    /* 20 */ SyscallDesc("getpid", getpidFunc),
+    /* 21 */ SyscallDesc("capget", unimplementedFunc),
+    /* 22 */ SyscallDesc("capset", unimplementedFunc),
+    /* 23 */ SyscallDesc("setuid", setuidFunc),
+    /* 24 */ SyscallDesc("getuid", getuidFunc),
+    /* 25 */ SyscallDesc("time", unimplementedFunc),
+    /* 26 */ SyscallDesc("ptrace", unimplementedFunc),
+    /* 27 */ SyscallDesc("alarm", unimplementedFunc),
+    /* 28 */ SyscallDesc("sigaltstack", unimplementedFunc),
+    /* 29 */ SyscallDesc("pause", unimplementedFunc),
+    /* 30 */ SyscallDesc("utime", unimplementedFunc),
+    /* 31 */ SyscallDesc("lchown32", unimplementedFunc),
+    /* 32 */ SyscallDesc("fchown32", unimplementedFunc),
+    /* 33 */ SyscallDesc("access", unimplementedFunc),
+    /* 34 */ SyscallDesc("nice", unimplementedFunc),
+    /* 35 */ SyscallDesc("chown32", unimplementedFunc),
+    /* 36 */ SyscallDesc("sync", unimplementedFunc),
+    /* 37 */ SyscallDesc("kill", unimplementedFunc),
+    /* 38 */ SyscallDesc("stat", unimplementedFunc),
+    /* 39 */ SyscallDesc("sendfile", unimplementedFunc),
+    /* 40 */ SyscallDesc("lstat", unimplementedFunc),
+    /* 41 */ SyscallDesc("dup", unimplementedFunc),
+    /* 42 */ SyscallDesc("pipe", pipePseudoFunc),
+    /* 43 */ SyscallDesc("times", unimplementedFunc),
+    /* 44 */ SyscallDesc("getuid32", unimplementedFunc),
+    /* 45 */ SyscallDesc("umount2", unimplementedFunc),
+    /* 46 */ SyscallDesc("setgid", unimplementedFunc),
+    /* 47 */ SyscallDesc("getgid", getgidFunc),
+    /* 48 */ SyscallDesc("signal", unimplementedFunc),
+    /* 49 */ SyscallDesc("geteuid", geteuidFunc),
+    /* 50 */ SyscallDesc("getegid", getegidFunc),
+    /* 51 */ SyscallDesc("acct", unimplementedFunc),
+    /* 52 */ SyscallDesc("memory_ordering", unimplementedFunc),
+    /* 53 */ SyscallDesc("getgid32", unimplementedFunc),
+    /* 54 */ SyscallDesc("ioctl", unimplementedFunc),
+    /* 55 */ SyscallDesc("reboot", unimplementedFunc),
+    /* 56 */ SyscallDesc("mmap2", unimplementedFunc),
+    /* 57 */ SyscallDesc("symlink", unimplementedFunc),
+    /* 58 */ SyscallDesc("readlink", unimplementedFunc),
+    /* 59 */ SyscallDesc("execve", unimplementedFunc),
+    /* 60 */ SyscallDesc("umask", unimplementedFunc),
+    /* 61 */ SyscallDesc("chroot", unimplementedFunc),
+    /* 62 */ SyscallDesc("fstat", unimplementedFunc),
+    /* 63 */ SyscallDesc("fstat64", unimplementedFunc),
+    /* 64 */ SyscallDesc("getpagesize", unimplementedFunc),
+    /* 65 */ SyscallDesc("msync", unimplementedFunc),
+    /* 66 */ SyscallDesc("vfork", unimplementedFunc),
+    /* 67 */ SyscallDesc("pread64", unimplementedFunc),
+    /* 68 */ SyscallDesc("pwrite64", unimplementedFunc),
+    /* 69 */ SyscallDesc("geteuid32", unimplementedFunc),
+    /* 70 */ SyscallDesc("getdgid32", unimplementedFunc),
+    /* 71 */ SyscallDesc("mmap", unimplementedFunc),
+    /* 72 */ SyscallDesc("setreuid32", unimplementedFunc),
+    /* 73 */ SyscallDesc("munmap", unimplementedFunc),
+    /* 74 */ SyscallDesc("mprotect", unimplementedFunc),
+    /* 75 */ SyscallDesc("madvise", unimplementedFunc),
+    /* 76 */ SyscallDesc("vhangup", unimplementedFunc),
+    /* 77 */ SyscallDesc("truncate64", unimplementedFunc),
+    /* 78 */ SyscallDesc("mincore", unimplementedFunc),
+    /* 79 */ SyscallDesc("getgroups", unimplementedFunc),
+    /* 80 */ SyscallDesc("setgroups", unimplementedFunc),
+    /* 81 */ SyscallDesc("getpgrp", unimplementedFunc),
+    /* 82 */ SyscallDesc("setgroups32", unimplementedFunc),
+    /* 83 */ SyscallDesc("setitimer", unimplementedFunc),
+    /* 84 */ SyscallDesc("ftruncate64", unimplementedFunc),
+    /* 85 */ SyscallDesc("swapon", unimplementedFunc),
+    /* 86 */ SyscallDesc("getitimer", unimplementedFunc),
+    /* 87 */ SyscallDesc("setuid32", unimplementedFunc),
+    /* 88 */ SyscallDesc("sethostname", unimplementedFunc),
+    /* 89 */ SyscallDesc("setgid32", unimplementedFunc),
+    /* 90 */ SyscallDesc("dup2", unimplementedFunc),
+    /* 91 */ SyscallDesc("setfsuid32", unimplementedFunc),
+    /* 92 */ SyscallDesc("fcntl", unimplementedFunc),
+    /* 93 */ SyscallDesc("select", unimplementedFunc),
+    /* 94 */ SyscallDesc("setfsgid32", unimplementedFunc),
+    /* 95 */ SyscallDesc("fsync", unimplementedFunc),
+    /* 96 */ SyscallDesc("setpriority", unimplementedFunc),
+    /* 97 */ SyscallDesc("socket", unimplementedFunc),
+    /* 98 */ SyscallDesc("connect", unimplementedFunc),
+    /* 99 */ SyscallDesc("accept", unimplementedFunc),
+    /* 100 */ SyscallDesc("getpriority", unimplementedFunc),
+    /* 101 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
+    /* 102 */ SyscallDesc("rt_sigaction", unimplementedFunc),
+    /* 103 */ SyscallDesc("rt_sigprocmask", unimplementedFunc),
+    /* 104 */ SyscallDesc("rt_sigpending", unimplementedFunc),
+    /* 105 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
+    /* 106 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc),
+    /* 107 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
+    /* 108 */ SyscallDesc("setresuid", unimplementedFunc),
+    /* 109 */ SyscallDesc("getresuid", unimplementedFunc),
+    /* 110 */ SyscallDesc("setresgid", unimplementedFunc),
+    /* 111 */ SyscallDesc("getresgid", unimplementedFunc),
+    /* 112 */ SyscallDesc("setregid32", unimplementedFunc),
+    /* 113 */ SyscallDesc("recvmsg", unimplementedFunc),
+    /* 114 */ SyscallDesc("sendmsg", unimplementedFunc),
+    /* 115 */ SyscallDesc("getgroups32", unimplementedFunc),
+    /* 116 */ SyscallDesc("gettimeofday", unimplementedFunc),
+    /* 117 */ SyscallDesc("getrusage", unimplementedFunc),
+    /* 118 */ SyscallDesc("getsockopt", unimplementedFunc),
+    /* 119 */ SyscallDesc("getcwd", unimplementedFunc),
+    /* 120 */ SyscallDesc("readv", unimplementedFunc),
+    /* 121 */ SyscallDesc("writev", unimplementedFunc),
+    /* 122 */ SyscallDesc("settimeofday", unimplementedFunc),
+    /* 123 */ SyscallDesc("fchown", unimplementedFunc),
+    /* 124 */ SyscallDesc("fchmod", unimplementedFunc),
+    /* 125 */ SyscallDesc("recvfrom", unimplementedFunc),
+    /* 126 */ SyscallDesc("setreuid", unimplementedFunc),
+    /* 127 */ SyscallDesc("setregid", unimplementedFunc),
+    /* 128 */ SyscallDesc("rename", unimplementedFunc),
+    /* 129 */ SyscallDesc("truncate", unimplementedFunc),
+    /* 130 */ SyscallDesc("ftruncate", unimplementedFunc),
+    /* 131 */ SyscallDesc("flock", unimplementedFunc),
+    /* 132 */ SyscallDesc("lstat64", unimplementedFunc),
+    /* 133 */ SyscallDesc("sendto", unimplementedFunc),
+    /* 134 */ SyscallDesc("shutdown", unimplementedFunc),
+    /* 135 */ SyscallDesc("socketpair", unimplementedFunc),
+    /* 136 */ SyscallDesc("mkdir", unimplementedFunc),
+    /* 137 */ SyscallDesc("rmdir", unimplementedFunc),
+    /* 138 */ SyscallDesc("utimes", unimplementedFunc),
+    /* 139 */ SyscallDesc("stat64", unimplementedFunc),
+    /* 140 */ SyscallDesc("sendfile64", unimplementedFunc),
+    /* 141 */ SyscallDesc("getpeername", unimplementedFunc),
+    /* 142 */ SyscallDesc("futex", unimplementedFunc),
+    /* 143 */ SyscallDesc("gettid", unimplementedFunc),
+    /* 144 */ SyscallDesc("getrlimit", unimplementedFunc),
+    /* 145 */ SyscallDesc("setrlimit", unimplementedFunc),
+    /* 146 */ SyscallDesc("pivot_root", unimplementedFunc),
+    /* 147 */ SyscallDesc("prctl", unimplementedFunc),
+    /* 148 */ SyscallDesc("pciconfig_read", unimplementedFunc),
+    /* 149 */ SyscallDesc("pciconfig_write", unimplementedFunc),
+    /* 150 */ SyscallDesc("getsockname", unimplementedFunc),
+    /* 151 */ SyscallDesc("inotify_init", unimplementedFunc),
+    /* 152 */ SyscallDesc("inotify_add_watch", unimplementedFunc),
+    /* 153 */ SyscallDesc("poll", unimplementedFunc),
+    /* 154 */ SyscallDesc("getdents64", unimplementedFunc),
+    /* 155 */ SyscallDesc("fcntl64", unimplementedFunc),
+    /* 156 */ SyscallDesc("inotify_rm_watch", unimplementedFunc),
+    /* 157 */ SyscallDesc("statfs", unimplementedFunc),
+    /* 158 */ SyscallDesc("fstatfs", unimplementedFunc),
+    /* 159 */ SyscallDesc("umount", unimplementedFunc),
+    /* 160 */ SyscallDesc("sched_set_affinity", unimplementedFunc),
+    /* 161 */ SyscallDesc("sched_get_affinity", unimplementedFunc),
+    /* 162 */ SyscallDesc("getdomainname", unimplementedFunc),
+    /* 163 */ SyscallDesc("setdomainname", unimplementedFunc),
+    /* 164 */ SyscallDesc("utrap_install", unimplementedFunc),
+    /* 165 */ SyscallDesc("quotactl", unimplementedFunc),
+    /* 166 */ SyscallDesc("set_tid_address", unimplementedFunc),
+    /* 167 */ SyscallDesc("mount", unimplementedFunc),
+    /* 168 */ SyscallDesc("ustat", unimplementedFunc),
+    /* 169 */ SyscallDesc("setxattr", unimplementedFunc),
+    /* 170 */ SyscallDesc("lsetxattr", unimplementedFunc),
+    /* 171 */ SyscallDesc("fsetxattr", unimplementedFunc),
+    /* 172 */ SyscallDesc("getxattr", unimplementedFunc),
+    /* 173 */ SyscallDesc("lgetxattr", unimplementedFunc),
+    /* 174 */ SyscallDesc("getdents", unimplementedFunc),
+    /* 175 */ SyscallDesc("setsid", unimplementedFunc),
+    /* 176 */ SyscallDesc("fchdir", unimplementedFunc),
+    /* 177 */ SyscallDesc("fgetxattr", unimplementedFunc),
+    /* 178 */ SyscallDesc("listxattr", unimplementedFunc),
+    /* 179 */ SyscallDesc("llistxattr", unimplementedFunc),
+    /* 180 */ SyscallDesc("flistxattr", unimplementedFunc),
+    /* 181 */ SyscallDesc("removexattr", unimplementedFunc),
+    /* 182 */ SyscallDesc("lremovexattr", unimplementedFunc),
+    /* 183 */ SyscallDesc("sigpending", unimplementedFunc),
+    /* 184 */ SyscallDesc("query_module", unimplementedFunc),
+    /* 185 */ SyscallDesc("setpgid", unimplementedFunc),
+    /* 186 */ SyscallDesc("fremovexattr", unimplementedFunc),
+    /* 187 */ SyscallDesc("tkill", unimplementedFunc),
+    /* 188 */ SyscallDesc("exit_group", unimplementedFunc),
+    /* 189 */ SyscallDesc("uname", unameFunc),
+    /* 190 */ SyscallDesc("init_module", unimplementedFunc),
+    /* 191 */ SyscallDesc("personality", unimplementedFunc),
+    /* 192 */ SyscallDesc("remap_file_pages", unimplementedFunc),
+    /* 193 */ SyscallDesc("epoll_create", unimplementedFunc),
+    /* 194 */ SyscallDesc("epoll_ctl", unimplementedFunc),
+    /* 195 */ SyscallDesc("epoll_wait", unimplementedFunc),
+    /* 196 */ SyscallDesc("ioprio_set", unimplementedFunc),
+    /* 197 */ SyscallDesc("getppid", getppidFunc),
+    /* 198 */ SyscallDesc("sigaction", unimplementedFunc),
+    /* 199 */ SyscallDesc("sgetmask", unimplementedFunc),
+    /* 200 */ SyscallDesc("ssetmask", unimplementedFunc),
+    /* 201 */ SyscallDesc("sigsuspend", unimplementedFunc),
+    /* 202 */ SyscallDesc("oldlstat", unimplementedFunc),
+    /* 203 */ SyscallDesc("uselib", unimplementedFunc),
+    /* 204 */ SyscallDesc("readdir", unimplementedFunc),
+    /* 205 */ SyscallDesc("readahead", unimplementedFunc),
+    /* 206 */ SyscallDesc("socketcall", unimplementedFunc),
+    /* 207 */ SyscallDesc("syslog", unimplementedFunc),
+    /* 208 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
+    /* 209 */ SyscallDesc("fadvise64", unimplementedFunc),
+    /* 210 */ SyscallDesc("fadvise64_64", unimplementedFunc),
+    /* 211 */ SyscallDesc("tgkill", unimplementedFunc),
+    /* 212 */ SyscallDesc("waitpid", unimplementedFunc),
+    /* 213 */ SyscallDesc("swapoff", unimplementedFunc),
+    /* 214 */ SyscallDesc("sysinfo", unimplementedFunc),
+    /* 215 */ SyscallDesc("ipc", unimplementedFunc),
+    /* 216 */ SyscallDesc("sigreturn", unimplementedFunc),
+    /* 217 */ SyscallDesc("clone", unimplementedFunc),
+    /* 218 */ SyscallDesc("ioprio_get", unimplementedFunc),
+    /* 219 */ SyscallDesc("adjtimex", unimplementedFunc),
+    /* 220 */ SyscallDesc("sigprocmask", unimplementedFunc),
+    /* 221 */ SyscallDesc("create_module", unimplementedFunc),
+    /* 222 */ SyscallDesc("delete_module", unimplementedFunc),
+    /* 223 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
+    /* 224 */ SyscallDesc("getpgid", unimplementedFunc),
+    /* 225 */ SyscallDesc("bdflush", unimplementedFunc),
+    /* 226 */ SyscallDesc("sysfs", unimplementedFunc),
+    /* 227 */ SyscallDesc("afs_syscall", unimplementedFunc),
+    /* 228 */ SyscallDesc("setfsuid", unimplementedFunc),
+    /* 229 */ SyscallDesc("setfsgid", unimplementedFunc),
+    /* 230 */ SyscallDesc("_newselect", unimplementedFunc),
+    /* 231 */ SyscallDesc("time", unimplementedFunc),
+    /* 232 */ SyscallDesc("oldstat", unimplementedFunc),
+    /* 233 */ SyscallDesc("stime", unimplementedFunc),
+    /* 234 */ SyscallDesc("statfs64", unimplementedFunc),
+    /* 235 */ SyscallDesc("fstatfs64", unimplementedFunc),
+    /* 236 */ SyscallDesc("_llseek", unimplementedFunc),
+    /* 237 */ SyscallDesc("mlock", unimplementedFunc),
+    /* 238 */ SyscallDesc("munlock", unimplementedFunc),
+    /* 239 */ SyscallDesc("mlockall", unimplementedFunc),
+    /* 240 */ SyscallDesc("munlockall", unimplementedFunc),
+    /* 241 */ SyscallDesc("sched_setparam", unimplementedFunc),
+    /* 242 */ SyscallDesc("sched_getparam", unimplementedFunc),
+    /* 243 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
+    /* 244 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
+    /* 245 */ SyscallDesc("sched_yield", unimplementedFunc),
+    /* 246 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
+    /* 247 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
+    /* 248 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
+    /* 249 */ SyscallDesc("nanosleep", unimplementedFunc),
+    /* 250 */ SyscallDesc("mremap", unimplementedFunc),
+    /* 251 */ SyscallDesc("_sysctl", unimplementedFunc),
+    /* 252 */ SyscallDesc("getsid", unimplementedFunc),
+    /* 253 */ SyscallDesc("fdatasync", unimplementedFunc),
+    /* 254 */ SyscallDesc("nfsservctl", unimplementedFunc),
+    /* 255 */ SyscallDesc("aplib", unimplementedFunc),
+    /* 256 */ SyscallDesc("clock_settime", unimplementedFunc),
+    /* 257 */ SyscallDesc("clock_gettime", unimplementedFunc),
+    /* 258 */ SyscallDesc("clock_getres", unimplementedFunc),
+    /* 259 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
+    /* 260 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
+    /* 261 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
+    /* 262 */ SyscallDesc("timer_settime", unimplementedFunc),
+    /* 263 */ SyscallDesc("timer_gettime", unimplementedFunc),
+    /* 264 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
+    /* 265 */ SyscallDesc("timer_delete", unimplementedFunc),
+    /* 266 */ SyscallDesc("timer_create", unimplementedFunc),
+    /* 267 */ SyscallDesc("vserver", unimplementedFunc),
+    /* 268 */ SyscallDesc("io_setup", unimplementedFunc),
+    /* 269 */ SyscallDesc("io_destroy", unimplementedFunc),
+    /* 270 */ SyscallDesc("io_submit", unimplementedFunc),
+    /* 271 */ SyscallDesc("io_cancel", unimplementedFunc),
+    /* 272 */ SyscallDesc("io_getevents", unimplementedFunc),
+    /* 273 */ SyscallDesc("mq_open", unimplementedFunc),
+    /* 274 */ SyscallDesc("mq_unlink", unimplementedFunc),
+    /* 275 */ SyscallDesc("mq_timedsend", unimplementedFunc),
+    /* 276 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
+    /* 277 */ SyscallDesc("mq_notify", unimplementedFunc),
+    /* 278 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
+    /* 279 */ SyscallDesc("waitid", unimplementedFunc),
+    /* 280 */ SyscallDesc("sys_setaltroot", unimplementedFunc),
+    /* 281 */ SyscallDesc("add_key", unimplementedFunc),
+    /* 282 */ SyscallDesc("request_key", unimplementedFunc),
+    /* 283 */ SyscallDesc("keyctl", unimplementedFunc)
 };
 
 SparcLinuxProcess::SparcLinuxProcess(const std::string &name,
                                      ObjectFile *objFile,
+                                     System * system,
                                      int stdin_fd,
                                      int stdout_fd,
                                      int stderr_fd,
                                      std::vector<std::string> &argv,
                                      std::vector<std::string> &envp)
-    : LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp),
+    : LiveProcess(name, objFile, system,
+            stdin_fd, stdout_fd, stderr_fd, argv, envp),
      Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
 {
     // The sparc syscall table must be <= 283 entries because that is all there
     // is space for.
     assert(Num_Syscall_Descs <= 283);
-
-    init_regs->intRegFile[0] = 0;
 }
 
 
 
 SyscallDesc*
-AlphaLinuxProcess::getDesc(int callnum)
+SparcLinuxProcess::getDesc(int callnum)
 {
     if (callnum < 0 || callnum > Num_Syscall_Descs)
         return NULL;
index c41406b4b22312d4e4c5749f23d48faac49d3ab5..36b2819daad9c6ed0b7d6c24052e16e8f20bcd3a 100644 (file)
@@ -39,6 +39,7 @@ class SparcLinuxProcess : public LiveProcess
     /// Constructor.
     SparcLinuxProcess(const std::string &name,
                       ObjectFile *objFile,
+                      System * system,
                       int stdin_fd, int stdout_fd, int stderr_fd,
                       std::vector<std::string> &argv,
                       std::vector<std::string> &envp);
index 2c10f65e66ebb63228d8522a4dcc45d43162cc86..174df2be4357e3d901354aec89c0beda3bbd54fc 100644 (file)
 #include "base/loader/object_file.hh"
 #include "base/misc.hh"
 
+using namespace std;
+
 namespace SparcISA
 {
 
 LiveProcess *
-createProcess(const string &nm, ObjectFile * objFile,
+createProcess(const string &nm, ObjectFile * objFile, System * system,
         int stdin_fd, int stdout_fd, int stderr_fd,
         vector<string> &argv, vector<string> &envp)
 {
@@ -44,7 +46,7 @@ createProcess(const string &nm, ObjectFile * objFile,
         fatal("Object file does not match architecture.");
     switch (objFile->getOpSys()) {
       case ObjectFile::Linux:
-        process = new SparcLinuxProcess(nm, objFile,
+        process = new SparcLinuxProcess(nm, objFile, system,
                                         stdin_fd, stdout_fd, stderr_fd,
                                         argv, envp);
         break;
index e0bba3497cd46a53057542c6925efb00bdcd0b60..1c2d86b6a550f9aa5b9ddb940ba85d9103add8ff 100644 (file)
@@ -40,7 +40,7 @@ namespace SparcISA
 {
 
 LiveProcess *
-createProcess(const std::string &nm, ObjectFile * objFile,
+createProcess(const std::string &nm, ObjectFile * objFile, System * system,
               int stdin_fd, int stdout_fd, int stderr_fd,
               std::vector<std::string> &argv, std::vector<std::string> &envp);