AlphaLiveProcess::setupASNReg()
{
ThreadContext *tc = system->getThreadContext(contextIds[0]);
- tc->setMiscRegNoEffect(IPR_DTB_ASN, M5_pid << 57);
+ tc->setMiscRegNoEffect(IPR_DTB_ASN, _pid << 57);
}
AlphaLiveProcess::loadState(CheckpointIn &cp)
{
LiveProcess::loadState(cp);
- // need to set up ASN after unserialization since M5_pid value may
+ // need to set up ASN after unserialization since _pid value may
// come from checkpoint
setupASNReg();
}
} else {
Addr alignedVaddr = p->pTable->pageAlign(vaddr);
tc->getITBPtr()->insert(alignedVaddr, 0 /*partition id*/,
- p->M5_pid /*context id*/, false, entry.pte);
+ p->_pid /*context id*/, false, entry.pte);
}
}
} else {
Addr alignedVaddr = p->pTable->pageAlign(vaddr);
tc->getDTBPtr()->insert(alignedVaddr, 0 /*partition id*/,
- p->M5_pid /*context id*/, false, entry.pte);
+ p->_pid /*context id*/, false, entry.pte);
}
}
kvmInSE = Param.Bool('false', 'initialize the process for KvmCPU in SE')
max_stack_size = Param.MemorySize('64MB', 'maximum size of the stack')
+ uid = Param.Int(100, 'user id')
+ euid = Param.Int(100, 'effective user id')
+ gid = Param.Int(100, 'group id')
+ egid = Param.Int(100, 'effective group id')
+ pid = Param.Int(100, 'process id')
+ ppid = Param.Int(99, 'parent process id')
+
@classmethod
def export_methods(cls, code):
code('bool map(Addr vaddr, Addr paddr, int size, bool cacheable=true);')
cmd = VectorParam.String("command line (executable plus arguments)")
env = VectorParam.String([], "environment settings")
cwd = Param.String('', "current working directory")
- uid = Param.Int(100, 'user id')
- euid = Param.Int(100, 'effective user id')
- gid = Param.Int(100, 'group id')
- egid = Param.Int(100, 'effective group id')
- pid = Param.Int(100, 'process id')
- ppid = Param.Int(99, 'parent process id')
simpoint = Param.UInt64(0, 'simulation point at which to start simulation')
drivers = VectorParam.EmulatedDriver([], 'Available emulated drivers')
brk_point(0), stack_base(0), stack_size(0), stack_min(0),
max_stack_size(params->max_stack_size),
next_thread_stack_base(0),
- M5_pid(system->allocatePID()),
useArchPT(params->useArchPT),
kvmInSE(params->kvmInSE),
pTable(useArchPT ?
- static_cast<PageTableBase *>(new ArchPageTable(name(), M5_pid, system)) :
- static_cast<PageTableBase *>(new FuncPageTable(name(), M5_pid)) ),
+ static_cast<PageTableBase *>(new ArchPageTable(name(), _pid, system)) :
+ static_cast<PageTableBase *>(new FuncPageTable(name(), _pid))),
initVirtMem(system->getSystemPort(), this,
SETranslatingPortProxy::Always),
fd_array(make_shared<array<FDEntry, NUM_FDS>>()),
{"cout", STDOUT_FILENO},
{"stdout", STDOUT_FILENO},
{"cerr", STDERR_FILENO},
- {"stderr", STDERR_FILENO}}
+ {"stderr", STDERR_FILENO}},
+ _uid(params->uid), _euid(params->euid),
+ _gid(params->gid), _egid(params->egid),
+ _pid(params->pid), _ppid(params->ppid)
{
int sim_fd;
std::map<string,int>::iterator it;
for (int x = 0; x < fd_array->size(); x++) {
(*fd_array)[x].serializeSection(cp, csprintf("FDEntry%d", x));
}
- SERIALIZE_SCALAR(M5_pid);
}
fde->unserializeSection(cp, csprintf("FDEntry%d", x));
}
fixFileOffsets();
- UNSERIALIZE_OPT_SCALAR(M5_pid);
// The above returns a bool so that you could do something if you don't
// find the param in the checkpoint if you wanted to, like set a default
// but in this case we'll just stick with the instantiated value if not
: Process(params), objFile(_objFile),
argv(params->cmd), envp(params->env), cwd(params->cwd),
executable(params->executable),
- __uid(params->uid), __euid(params->euid),
- __gid(params->gid), __egid(params->egid),
- __pid(params->pid), __ppid(params->ppid),
drivers(params->drivers)
{
public:
- //This id is assigned by m5 and is used to keep process' tlb entries
- //separated.
- uint64_t M5_pid;
-
// flag for using architecture specific page table
bool useArchPT;
// running KvmCPU in SE mode requires special initialization
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
+
+ public:
+ // Id of the owner of the process
+ uint64_t _uid;
+ uint64_t _euid;
+ uint64_t _gid;
+ uint64_t _egid;
+
+ // pid of the process and it's parent
+ uint64_t _pid;
+ uint64_t _ppid;
+
};
//
LiveProcess(LiveProcessParams *params, ObjectFile *objFile);
- // Id of the owner of the process
- uint64_t __uid;
- uint64_t __euid;
- uint64_t __gid;
- uint64_t __egid;
-
- // pid of the process and it's parent
- uint64_t __pid;
- uint64_t __ppid;
-
// Emulated drivers available to this process
std::vector<EmulatedDriver *> drivers;
M5_AT_VECTOR_SIZE = 44
};
- inline uint64_t uid() {return __uid;}
- inline uint64_t euid() {return __euid;}
- inline uint64_t gid() {return __gid;}
- inline uint64_t egid() {return __egid;}
- inline uint64_t pid() {return __pid;}
- inline uint64_t ppid() {return __ppid;}
+ inline uint64_t uid() { return _uid; }
+ inline uint64_t euid() { return _euid; }
+ inline uint64_t gid() { return _gid; }
+ inline uint64_t egid() { return _egid; }
+ inline uint64_t pid() { return _pid; }
+ inline uint64_t ppid() { return _ppid; }
// provide program name for debug messages
virtual const char *progName() const { return executable.c_str(); }
kernel(nullptr),
loadAddrMask(p->load_addr_mask),
loadAddrOffset(p->load_offset),
- nextPID(0),
physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve),
memoryMode(p->mem_mode),
_cacheLineSize(p->cache_line_size),
if (FullSystem)
kernelSymtab->serialize("kernel_symtab", cp);
SERIALIZE_SCALAR(pagePtr);
- SERIALIZE_SCALAR(nextPID);
serializeSymtab(cp);
// also serialize the memories in the system
if (FullSystem)
kernelSymtab->unserialize("kernel_symtab", cp);
UNSERIALIZE_SCALAR(pagePtr);
- UNSERIALIZE_SCALAR(nextPID);
unserializeSymtab(cp);
// also unserialize the memories in the system
*/
Addr loadAddrOffset;
- protected:
- uint64_t nextPID;
-
public:
- uint64_t allocatePID()
- {
- return nextPID++;
- }
-
/** Get a pointer to access the physical memory of the system */
PhysicalMemory& getPhysMem() { return physmem; }