diff options
Diffstat (limited to 'src/sim/process.hh')
-rw-r--r-- | src/sim/process.hh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/sim/process.hh b/src/sim/process.hh index 03380acf7..6e26bb8bd 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -50,6 +50,7 @@ struct LiveProcessParams; class SyscallDesc; class System; class ThreadContext; +class EmulatedDriver; template<class IntType> struct AuxVector @@ -139,10 +140,11 @@ class Process : public SimObject bool isPipe; int readPipeSource; uint64_t fileOffset; + EmulatedDriver *driver; FdMap() : fd(-1), filename("NULL"), mode(0), flags(0), - isPipe(false), readPipeSource(0), fileOffset(0) + isPipe(false), readPipeSource(0), fileOffset(0), driver(NULL) { } void serialize(std::ostream &os); @@ -256,6 +258,9 @@ class LiveProcess : public Process uint64_t __pid; uint64_t __ppid; + // Emulated drivers available to this process + std::vector<EmulatedDriver *> drivers; + public: enum AuxiliaryVectorType { @@ -325,6 +330,14 @@ class LiveProcess : public Process virtual SyscallDesc *getDesc(int callnum) = 0; + /** + * Find an emulated device driver. + * + * @param filename Name of the device (under /dev) + * @return Pointer to driver object if found, else NULL + */ + EmulatedDriver *findDriver(std::string filename); + // this function is used to create the LiveProcess object, since // we can't tell which subclass of LiveProcess to use until we // open and look at the object file. |