sim-se: Add prlimit system call
[gem5.git] / src / sim / init.cc
index 33cd4040fce8ddd3186b5d7ec7202aa9d9bb4632..70578197fb324c21b561e3f97dd5357a30d9a19f 100644 (file)
@@ -127,8 +127,7 @@ EmbeddedPython::addModule() const
 }
 
 /*
- * Load and initialize all of the python parts of M5, including Swig
- * and the embedded module importer.
+ * Load and initialize all of the python parts of M5.
  */
 int
 EmbeddedPython::initAll()
@@ -152,40 +151,6 @@ EmbeddedPython::initAll()
     return 0;
 }
 
-EmbeddedSwig::EmbeddedSwig(void (*init_func)(), const string& _context)
-    : initFunc(init_func), context(_context)
-{
-    getList().push_back(this);
-}
-
-list<EmbeddedSwig *> &
-EmbeddedSwig::getList()
-{
-    static list<EmbeddedSwig *> the_list;
-    return the_list;
-}
-
-void
-EmbeddedSwig::initAll()
-{
-    char* old_context = _Py_PackageContext;
-    // initialize SWIG modules. initFunc() is autogenerated and calls
-    // all of the individual swig initialization functions.
-    for (auto i : getList()) {
-        // to ensure that the loaded modules are placed in the right
-        // package we have to be a bit unorthodox and directly
-        // manipulate the package context since swig simply calls
-        // Py_InitModule with nothing but the module name of the
-        // wrapper
-        char* cstr = new char[i->context.size() + 1];
-        strcpy(cstr, i->context.c_str());
-        _Py_PackageContext = cstr;
-        i->initFunc();
-        delete[] cstr;
-    }
-    _Py_PackageContext = old_context;
-}
-
 EmbeddedPyBind::EmbeddedPyBind(const char *_name,
                                void (*init_func)(py::module &),
                                const char *_base)
@@ -265,7 +230,6 @@ EmbeddedPyBind::initAll()
 int
 initM5Python()
 {
-    EmbeddedSwig::initAll();
     EmbeddedPyBind::initAll();
     return EmbeddedPython::initAll();
 }