diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
commit | 67fda02dda290d614de233846fee434b3713b1dc (patch) | |
tree | c45cf35179244586ff9b3b3b9f87a520cae7ae5d /src/arch/x86/process.cc | |
parent | c55a467a06eaa59c47c52a2adddc266b8e545589 (diff) | |
download | gem5-67fda02dda290d614de233846fee434b3713b1dc.tar.xz |
Make it so that all thread contexts are registered with the System, even in
SE. Process still keeps track of the tc's it owns, but registration occurs
with the System, this eases the way for system-wide context Ids based on
registration.
Diffstat (limited to 'src/arch/x86/process.cc')
-rw-r--r-- | src/arch/x86/process.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index b62efd3cd..52933b7f4 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -146,8 +146,8 @@ X86LiveProcess::startup() argsInit(sizeof(IntReg), VMPageSize); - for (int i = 0; i < threadContexts.size(); i++) { - ThreadContext * tc = threadContexts[i]; + for (int i = 0; i < contextIds.size(); i++) { + ThreadContext * tc = system->getThreadContext(contextIds[i]); SegAttr dataAttr = 0; dataAttr.writable = 1; @@ -458,14 +458,15 @@ X86LiveProcess::argsInit(int intSize, int pageSize) initVirtMem->writeBlob(argc_base, (uint8_t*)&guestArgc, intSize); + ThreadContext *tc = system->getThreadContext(contextIds[0]); //Set the stack pointer register - threadContexts[0]->setIntReg(StackPointerReg, stack_min); + tc->setIntReg(StackPointerReg, stack_min); Addr prog_entry = objFile->entryPoint(); // There doesn't need to be any segment base added in since we're dealing // with the flat segmentation model. - threadContexts[0]->setPC(prog_entry); - threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst)); + tc->setPC(prog_entry); + tc->setNextPC(prog_entry + sizeof(MachInst)); //Align the "stack_min" to a page boundary. stack_min = roundDown(stack_min, pageSize); |