init.hh (10453:d0365cc3d05f) | init.hh (11548:91f58918a76a) |
---|---|
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; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Nathan Binkert 29 */ 30 31#ifndef __SIM_INIT_HH__ 32#define __SIM_INIT_HH__ 33 34#include <Python.h> 35 | 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; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Nathan Binkert 29 */ 30 31#ifndef __SIM_INIT_HH__ 32#define __SIM_INIT_HH__ 33 34#include <Python.h> 35 |
36/* 37 * Data structure describing an embedded python file. 38 */ | |
39#include <list> | 36#include <list> |
37#include <string> |
|
40 41#include <inttypes.h> 42 43#ifndef PyObject_HEAD 44struct _object; 45typedef _object PyObject; 46#endif 47 | 38 39#include <inttypes.h> 40 41#ifndef PyObject_HEAD 42struct _object; 43typedef _object PyObject; 44#endif 45 |
46/* 47 * Data structure describing an embedded python file. 48 */ |
|
48struct EmbeddedPython 49{ 50 const char *filename; 51 const char *abspath; 52 const char *modpath; 53 const uint8_t *code; 54 int zlen; 55 int len; --- 9 unchanged lines hidden (view full) --- 65 static std::list<EmbeddedPython *> &getList(); 66 static int initAll(); 67}; 68 69struct EmbeddedSwig 70{ 71 void (*initFunc)(); 72 | 49struct EmbeddedPython 50{ 51 const char *filename; 52 const char *abspath; 53 const char *modpath; 54 const uint8_t *code; 55 int zlen; 56 int len; --- 9 unchanged lines hidden (view full) --- 66 static std::list<EmbeddedPython *> &getList(); 67 static int initAll(); 68}; 69 70struct EmbeddedSwig 71{ 72 void (*initFunc)(); 73 |
73 EmbeddedSwig(void (*init_func)()); | 74 std::string context; |
74 | 75 |
76 EmbeddedSwig(void (*init_func)(), const std::string& _context); 77 |
|
75 static std::list<EmbeddedSwig *> &getList(); 76 static void initAll(); 77}; 78 79int initM5Python(); 80int m5Main(int argc, char **argv); 81PyMODINIT_FUNC initm5(void); 82 83#endif // __SIM_INIT_HH__ | 78 static std::list<EmbeddedSwig *> &getList(); 79 static void initAll(); 80}; 81 82int initM5Python(); 83int m5Main(int argc, char **argv); 84PyMODINIT_FUNC initm5(void); 85 86#endif // __SIM_INIT_HH__ |