diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2014-10-22 15:53:34 -0700 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2014-10-22 15:53:34 -0700 |
commit | 44ec1d212499246be3cef40ce7c96a3f65286153 (patch) | |
tree | 503f72a85b24db8b82f792cd22341aeb0bdcd112 /src/sim/process.hh | |
parent | 6523aad25c32f2443c48b114db4dab078bfb16d1 (diff) | |
download | gem5-44ec1d212499246be3cef40ce7c96a3f65286153.tar.xz |
syscall_emul: add EmulatedDriver object
Fake SE-mode device drivers can now be added by
deriving from this abstract object.
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. |