1/* 2 * Copyright (c) 2012, 2017 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 113 unchanged lines hidden (view full) --- 122 return false; 123 } 124 125 Py_DECREF(result); 126 return true; 127} 128 129/* |
130 * Load and initialize all of the python parts of M5. |
131 */ 132int 133EmbeddedPython::initAll() 134{ 135 // Load the importer module 136 PyObject *code = importer->getCode(); 137 importerModule = PyImport_ExecCodeModule(PyCC("importer"), code); 138 if (!importerModule) { --- 7 unchanged lines hidden (view full) --- 146 list<EmbeddedPython *>::iterator end = getList().end(); 147 for (; i != end; ++i) 148 if (!(*i)->addModule()) 149 return 1; 150 151 return 0; 152} 153 |
154EmbeddedPyBind::EmbeddedPyBind(const char *_name, 155 void (*init_func)(py::module &), 156 const char *_base) 157 : initFunc(init_func), registered(false), name(_name), base(_base) 158{ 159 getMap()[_name] = this; 160} 161 --- 63 unchanged lines hidden (view full) --- 225 } 226 } 227 } 228} 229 230int 231initM5Python() 232{ |
233 EmbeddedPyBind::initAll(); 234 return EmbeddedPython::initAll(); 235} 236 237/* 238 * Make the commands array weak so that they can be overridden (used 239 * by unit tests to specify a different python main function. 240 */ --- 58 unchanged lines hidden --- |