simple_thread.cc (3402:db60546818d0) simple_thread.cc (3453:c3ce58882751)
1/*
2 * Copyright (c) 2001-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;

--- 46 unchanged lines hidden (view full) ---

55#include "mem/translating_port.hh"
56#endif
57
58using namespace std;
59
60// constructor
61#if FULL_SYSTEM
62SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
1/*
2 * Copyright (c) 2001-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;

--- 46 unchanged lines hidden (view full) ---

55#include "mem/translating_port.hh"
56#endif
57
58using namespace std;
59
60// constructor
61#if FULL_SYSTEM
62SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
63 AlphaITB *_itb, AlphaDTB *_dtb,
63 TheISA::ITB *_itb, TheISA::DTB *_dtb,
64 bool use_kernel_stats)
64 bool use_kernel_stats)
65 : ThreadState(_cpu, -1, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
65 : ThreadState(-1, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
66 dtb(_dtb)
67
68{
69 tc = new ProxyThreadContext<SimpleThread>(this);
70
71 quiesceEvent = new EndQuiesceEvent(tc);
72
73 regs.clear();

--- 27 unchanged lines hidden (view full) ---

101 virtPort = new VirtualPort(csprintf("%s-%d-vport",
102 cpu->name(), tid));
103 mem_port = system->physmem->getPort("functional");
104 mem_port->setPeer(virtPort);
105 virtPort->setPeer(mem_port);
106}
107#else
108SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
66 dtb(_dtb)
67
68{
69 tc = new ProxyThreadContext<SimpleThread>(this);
70
71 quiesceEvent = new EndQuiesceEvent(tc);
72
73 regs.clear();

--- 27 unchanged lines hidden (view full) ---

101 virtPort = new VirtualPort(csprintf("%s-%d-vport",
102 cpu->name(), tid));
103 mem_port = system->physmem->getPort("functional");
104 mem_port->setPeer(virtPort);
105 virtPort->setPeer(mem_port);
106}
107#else
108SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
109 Process *_process, int _asid)
110 : ThreadState(_cpu, -1, _thread_num, _process, _asid),
109 Process *_process, int _asid, MemObject* memobj)
110 : ThreadState(-1, _thread_num, _process, _asid, memobj),
111 cpu(_cpu)
112{
111 cpu(_cpu)
112{
113 /* Use this port to for syscall emulation writes to memory. */
114 Port *mem_port;
115 port = new TranslatingPort(csprintf("%s-%d-funcport",
116 cpu->name(), tid),
117 process->pTable, false);
118 mem_port = memobj->getPort("functional");
119 mem_port->setPeer(port);
120 port->setPeer(mem_port);
121
113 regs.clear();
114 tc = new ProxyThreadContext<SimpleThread>(this);
115}
116
117#endif
118
119SimpleThread::SimpleThread()
120#if FULL_SYSTEM
122 regs.clear();
123 tc = new ProxyThreadContext<SimpleThread>(this);
124}
125
126#endif
127
128SimpleThread::SimpleThread()
129#if FULL_SYSTEM
121 : ThreadState(NULL, -1, -1)
130 : ThreadState(-1, -1)
122#else
131#else
123 : ThreadState(NULL, -1, -1, NULL, -1)
132 : ThreadState(-1, -1, NULL, -1, NULL)
124#endif
125{
126 tc = new ProxyThreadContext<SimpleThread>(this);
127 regs.clear();
128}
129
130SimpleThread::~SimpleThread()
131{

--- 186 unchanged lines hidden (view full) ---

318SimpleThread::delVirtPort(VirtualPort *vp)
319{
320 if (vp != virtPort) {
321 delete vp->getPeer();
322 delete vp;
323 }
324}
325
133#endif
134{
135 tc = new ProxyThreadContext<SimpleThread>(this);
136 regs.clear();
137}
138
139SimpleThread::~SimpleThread()
140{

--- 186 unchanged lines hidden (view full) ---

327SimpleThread::delVirtPort(VirtualPort *vp)
328{
329 if (vp != virtPort) {
330 delete vp->getPeer();
331 delete vp;
332 }
333}
334
326#else
327TranslatingPort *
328SimpleThread::getMemPort()
329{
330 if (port != NULL)
331 return port;
332
335
333 /* Use this port to for syscall emulation writes to memory. */
334 Port *dcache_port;
335 port = new TranslatingPort(csprintf("%s-%d-funcport",
336 cpu->name(), tid),
337 process->pTable, false);
338 dcache_port = cpu->getPort("dcache_port");
339 assert(dcache_port != NULL);
340 dcache_port = dcache_port->getPeer();
341// mem_port->setPeer(port);
342 port->setPeer(dcache_port);
343 return port;
344}
345
346#endif
347
336#endif
337