- /// Pointer to object representing the system this process is
- /// running on.
- System *system;
-
- // have we initialized a thread context from this process? If
- // yes, subsequent contexts are assumed to be for dynamically
- // created threads and are not initialized.
- bool initialContextLoaded;
-
- bool checkpointRestored;
-
- // thread contexts associated with this process
- std::vector<int> contextIds;
-
- // remote gdb objects
- std::vector<TheISA::RemoteGDB *> remoteGDB;
- std::vector<GDBListener *> gdbListen;
- bool breakpoint();
-
- // number of CPUs (esxec contexts, really) assigned to this process.
- unsigned int numCpus() { return contextIds.size(); }
-
- // record of blocked context
- struct WaitRec
- {
- Addr waitChan;
- ThreadContext *waitingContext;
-
- WaitRec(Addr chan, ThreadContext *ctx)
- : waitChan(chan), waitingContext(ctx)
- { }
- };
-
- // list of all blocked contexts
- std::list<WaitRec> waitList;
-
- Addr brk_point; // top of the data segment
-
- Addr stack_base; // stack segment base (highest address)
- unsigned stack_size; // initial stack size
- Addr stack_min; // lowest address accessed on the stack
-
- // The maximum size allowed for the stack.
- Addr max_stack_size;
-
- // addr to use for next stack region (for multithreaded apps)
- Addr next_thread_stack_base;
-
- // Base of region for mmaps (when user doesn't specify an address).
- Addr mmap_start;
- Addr mmap_end;
-
- // Base of region for nxm data
- Addr nxm_start;
- Addr nxm_end;
-
- std::string prog_fname; // file name
-
- Stats::Scalar<> num_syscalls; // number of syscalls executed
-
-
- protected:
- // constructor
- Process(ProcessParams * params);
-
- // post initialization startup
- virtual void startup();
-
- protected:
- /// Memory object for initialization (image loading)
- TranslatingPort *initVirtMem;
-
- public:
- PageTable *pTable;
-
- //This id is assigned by m5 and is used to keep process' tlb entries
- //separated.
- uint64_t M5_pid;
-
- class FdMap
- {
- public:
- int fd;
- std::string filename;
- int mode;
- int flags;
- bool isPipe;
- int readPipeSource;
- uint64_t fileOffset;
-
-
- FdMap()
- {
- fd = -1;
- filename = "NULL";
- mode = 0;
- flags = 0;
- isPipe = false;
- readPipeSource = 0;
- fileOffset = 0;
-
- }
-
- void serialize(std::ostream &os);
- void unserialize(Checkpoint *cp, const std::string §ion);
-
- };
-
- private:
- // file descriptor remapping support
- static const int MAX_FD = 256; // max legal fd value
- FdMap fd_map[MAX_FD+1];
+ /**
+ * Find an emulated device driver.
+ *
+ * @param filename Name of the device (under /dev)
+ * @return Pointer to driver object if found, else nullptr
+ */
+ EmulatedDriver *findDriver(std::string filename);
+
+ // This function acts as a callback to update the bias value in
+ // the object file because the parameters needed to calculate the
+ // bias are not available when the object file is created.
+ void updateBias();
+ Addr getBias();
+ Addr getStartPC();
+ ObjectFile *getInterpreter();