1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 28 unchanged lines hidden (view full) --- 37#include "mem/vport.hh" 38#include "sim/serialize.hh" 39 40#if FULL_SYSTEM 41#include "arch/kernel_stats.hh" 42#include "cpu/quiesce_event.hh" 43#endif 44 |
45ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process) |
46 : numInst(0), numLoad(0), _status(ThreadContext::Halted), 47 baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0), 48#if FULL_SYSTEM 49 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), 50 kernelStats(NULL), |
51#endif |
52 process(_process), port(NULL), virtPort(NULL), physPort(NULL), 53 funcExeInst(0), storeCondFailures(0) |
54{ 55} 56 57ThreadState::~ThreadState() 58{ |
59 if (port) { 60 delete port->getPeer(); 61 delete port; 62 } |
63} 64 65void 66ThreadState::serialize(std::ostream &os) 67{ 68 SERIALIZE_ENUM(_status); 69 // thread_num and cpu_id are deterministic from the config 70 SERIALIZE_SCALAR(funcExeInst); --- 80 unchanged lines hidden (view full) --- 151TranslatingPort * 152ThreadState::getMemPort() 153{ 154 if (port != NULL) 155 return port; 156 157 /* Use this port to for syscall emulation writes to memory. */ 158 port = new TranslatingPort(csprintf("%s-%d-funcport", baseCpu->name(), |
159 _threadId), process, TranslatingPort::NextPage); |
160 161 connectToMemFunc(port); 162 163 return port; 164} 165 166void 167ThreadState::connectToMemFunc(Port *port) --- 15 unchanged lines hidden --- |