From 54466a31c3c295f11d5936d34a1b2ac0d3e0045f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 16 Oct 2007 18:04:01 -0700 Subject: Make the process objects use the Params structs in their constructors, and use a limit to check if access are on the stack. --HG-- extra : convert_revision : af40a7acf424c4c4f62d0d76db1001a714ae0474 --- src/sim/process.hh | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'src/sim/process.hh') diff --git a/src/sim/process.hh b/src/sim/process.hh index 83c00a676..d43208c27 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -48,12 +48,14 @@ #include "sim/host.hh" #include "sim/sim_object.hh" -class ThreadContext; -class SyscallDesc; +class GDBListener; class PageTable; -class TranslatingPort; +class ProcessParams; +class LiveProcessParams; +class SyscallDesc; class System; -class GDBListener; +class ThreadContext; +class TranslatingPort; namespace TheISA { class RemoteGDB; @@ -103,6 +105,9 @@ class Process : public SimObject 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; @@ -121,11 +126,7 @@ class Process : public SimObject protected: // constructor - Process(const std::string &nm, - System *_system, - int stdin_fd, // initial I/O descriptors - int stdout_fd, - int stderr_fd); + Process(ProcessParams * params); // post initialization startup virtual void startup(); @@ -195,14 +196,7 @@ class LiveProcess : public Process std::vector envp; std::string cwd; - LiveProcess(const std::string &nm, ObjectFile *objFile, - System *_system, int stdin_fd, int stdout_fd, int stderr_fd, - std::vector &argv, - std::vector &envp, - const std::string &cwd, - uint64_t _uid, uint64_t _euid, - uint64_t _gid, uint64_t _egid, - uint64_t _pid, uint64_t _ppid); + LiveProcess(LiveProcessParams * params, ObjectFile *objFile); virtual void argsInit(int intSize, int pageSize); @@ -272,16 +266,7 @@ class LiveProcess : public Process // 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. - static LiveProcess *create(const std::string &nm, - System *_system, - int stdin_fd, int stdout_fd, int stderr_fd, - std::string executable, - std::vector &argv, - std::vector &envp, - const std::string &cwd, - uint64_t _uid, uint64_t _euid, - uint64_t _gid, uint64_t _egid, - uint64_t _pid, uint64_t _ppid); + static LiveProcess *create(LiveProcessParams * params); }; -- cgit v1.2.3