simple_thread.hh (4772:f08370a81812) simple_thread.hh (4997:e7380529bd2d)
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;

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

30 */
31
32#ifndef __CPU_SIMPLE_THREAD_HH__
33#define __CPU_SIMPLE_THREAD_HH__
34
35#include "arch/isa_traits.hh"
36#include "arch/regfile.hh"
37#include "arch/syscallreturn.hh"
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;

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

30 */
31
32#ifndef __CPU_SIMPLE_THREAD_HH__
33#define __CPU_SIMPLE_THREAD_HH__
34
35#include "arch/isa_traits.hh"
36#include "arch/regfile.hh"
37#include "arch/syscallreturn.hh"
38#include "arch/tlb.hh"
38#include "config/full_system.hh"
39#include "cpu/thread_context.hh"
40#include "cpu/thread_state.hh"
41#include "mem/request.hh"
42#include "sim/byteswap.hh"
43#include "sim/eventq.hh"
44#include "sim/host.hh"
45#include "sim/serialize.hh"
46
47class BaseCPU;
48
49#if FULL_SYSTEM
50
51#include "sim/system.hh"
39#include "config/full_system.hh"
40#include "cpu/thread_context.hh"
41#include "cpu/thread_state.hh"
42#include "mem/request.hh"
43#include "sim/byteswap.hh"
44#include "sim/eventq.hh"
45#include "sim/host.hh"
46#include "sim/serialize.hh"
47
48class BaseCPU;
49
50#if FULL_SYSTEM
51
52#include "sim/system.hh"
52#include "arch/tlb.hh"
53
54class FunctionProfile;
55class ProfileNode;
56class FunctionalPort;
57class PhysicalPort;
58
59namespace TheISA {
60 namespace Kernel {

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

104 public:
105 // pointer to CPU associated with this SimpleThread
106 BaseCPU *cpu;
107
108 ProxyThreadContext<SimpleThread> *tc;
109
110 System *system;
111
53
54class FunctionProfile;
55class ProfileNode;
56class FunctionalPort;
57class PhysicalPort;
58
59namespace TheISA {
60 namespace Kernel {

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

104 public:
105 // pointer to CPU associated with this SimpleThread
106 BaseCPU *cpu;
107
108 ProxyThreadContext<SimpleThread> *tc;
109
110 System *system;
111
112#if FULL_SYSTEM
113 TheISA::ITB *itb;
114 TheISA::DTB *dtb;
112 TheISA::ITB *itb;
113 TheISA::DTB *dtb;
115#endif
116
117 // constructor: initialize SimpleThread from given process structure
118#if FULL_SYSTEM
119 SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
120 TheISA::ITB *_itb, TheISA::DTB *_dtb,
121 bool use_kernel_stats = true);
122#else
114
115 // constructor: initialize SimpleThread from given process structure
116#if FULL_SYSTEM
117 SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
118 TheISA::ITB *_itb, TheISA::DTB *_dtb,
119 bool use_kernel_stats = true);
120#else
123 SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
121 SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
122 TheISA::ITB *_itb, TheISA::DTB *_dtb, int _asid);
124#endif
125
126 SimpleThread();
127
128 virtual ~SimpleThread();
129
130 virtual void takeOverFrom(ThreadContext *oldContext);
131

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

144 **************************************************************/
145
146 /** Returns the pointer to this SimpleThread's ThreadContext. Used
147 * when a ThreadContext must be passed to objects outside of the
148 * CPU.
149 */
150 ThreadContext *getTC() { return tc; }
151
123#endif
124
125 SimpleThread();
126
127 virtual ~SimpleThread();
128
129 virtual void takeOverFrom(ThreadContext *oldContext);
130

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

143 **************************************************************/
144
145 /** Returns the pointer to this SimpleThread's ThreadContext. Used
146 * when a ThreadContext must be passed to objects outside of the
147 * CPU.
148 */
149 ThreadContext *getTC() { return tc; }
150
152#if FULL_SYSTEM
153 int getInstAsid() { return regs.instAsid(); }
154 int getDataAsid() { return regs.dataAsid(); }
155
156 Fault translateInstReq(RequestPtr &req)
157 {
158 return itb->translate(req, tc);
159 }
160
161 Fault translateDataReadReq(RequestPtr &req)
162 {
163 return dtb->translate(req, tc, false);
164 }
165
166 Fault translateDataWriteReq(RequestPtr &req)
167 {
168 return dtb->translate(req, tc, true);
169 }
170
151 Fault translateInstReq(RequestPtr &req)
152 {
153 return itb->translate(req, tc);
154 }
155
156 Fault translateDataReadReq(RequestPtr &req)
157 {
158 return dtb->translate(req, tc, false);
159 }
160
161 Fault translateDataWriteReq(RequestPtr &req)
162 {
163 return dtb->translate(req, tc, true);
164 }
165
166#if FULL_SYSTEM
167 int getInstAsid() { return regs.instAsid(); }
168 int getDataAsid() { return regs.dataAsid(); }
169
171 void dumpFuncProfile();
172
173 Fault hwrei();
174
175 bool simPalCheck(int palFunc);
170 void dumpFuncProfile();
171
172 Fault hwrei();
173
174 bool simPalCheck(int palFunc);
176#else
177
175
178 Fault translateInstReq(RequestPtr &req)
179 {
180 return process->pTable->translate(req);
181 }
182
183 Fault translateDataReadReq(RequestPtr &req)
184 {
185 return process->pTable->translate(req);
186 }
187
188 Fault translateDataWriteReq(RequestPtr &req)
189 {
190 return process->pTable->translate(req);
191 }
192#endif
193
194 /*******************************************
195 * ThreadContext interface functions.
196 ******************************************/
197
198 BaseCPU *getCpuPtr() { return cpu; }
199
200 int getThreadNum() { return tid; }
201
176#endif
177
178 /*******************************************
179 * ThreadContext interface functions.
180 ******************************************/
181
182 BaseCPU *getCpuPtr() { return cpu; }
183
184 int getThreadNum() { return tid; }
185
202#if FULL_SYSTEM
203 System *getSystemPtr() { return system; }
204
205 TheISA::ITB *getITBPtr() { return itb; }
206
207 TheISA::DTB *getDTBPtr() { return dtb; }
208
186 TheISA::ITB *getITBPtr() { return itb; }
187
188 TheISA::DTB *getDTBPtr() { return dtb; }
189
190#if FULL_SYSTEM
191 System *getSystemPtr() { return system; }
192
209 FunctionalPort *getPhysPort() { return physPort; }
210
211 /** Return a virtual port. If no thread context is specified then a static
212 * port is returned. Otherwise a port is created and returned. It must be
213 * deleted by deleteVirtPort(). */
214 VirtualPort *getVirtPort(ThreadContext *tc);
215
216 void delVirtPort(VirtualPort *vp);

--- 203 unchanged lines hidden ---
193 FunctionalPort *getPhysPort() { return physPort; }
194
195 /** Return a virtual port. If no thread context is specified then a static
196 * port is returned. Otherwise a port is created and returned. It must be
197 * deleted by deleteVirtPort(). */
198 VirtualPort *getVirtPort(ThreadContext *tc);
199
200 void delVirtPort(VirtualPort *vp);

--- 203 unchanged lines hidden ---