1/* 2 * Copyright (c) 2008 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 40 unchanged lines hidden (view full) --- 49 std::unique_ptr<wchar_t[], decltype(&PyMem_RawFree)> program( 50 Py_DecodeLocale(argv[0], NULL), 51 &PyMem_RawFree); 52 Py_SetProgramName(program.get()); 53#else 54 Py_SetProgramName(argv[0]); 55#endif 56 |
57 // Register native modules with Python's init system before 58 // initializing the interpreter. 59 registerNativeModules(); 60 |
61 // initialize embedded Python interpreter 62 Py_Initialize(); 63 64 // Initialize the embedded m5 python library |
65 ret = EmbeddedPython::initAll(); |
66 67 if (ret == 0) { 68 // start m5 69 ret = m5Main(argc, argv); 70 } 71 72 // clean up Python intepreter. 73 Py_Finalize(); 74 75 return ret; 76} |