thread_state.hh (3276:dc3cd126b479) thread_state.hh (3402:db60546818d0)
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;

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

32#define __CPU_THREAD_STATE_HH__
33
34#include "arch/types.hh"
35#include "cpu/profile.hh"
36#include "cpu/thread_context.hh"
37
38#if !FULL_SYSTEM
39#include "mem/mem_object.hh"
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;

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

32#define __CPU_THREAD_STATE_HH__
33
34#include "arch/types.hh"
35#include "cpu/profile.hh"
36#include "cpu/thread_context.hh"
37
38#if !FULL_SYSTEM
39#include "mem/mem_object.hh"
40#include "mem/translating_port.hh"
41#include "sim/process.hh"
42#endif
43
44#if FULL_SYSTEM
45class EndQuiesceEvent;
46class FunctionProfile;
47class ProfileNode;
48namespace Kernel {
49 class Statistics;
50};
51#endif
52
40#include "sim/process.hh"
41#endif
42
43#if FULL_SYSTEM
44class EndQuiesceEvent;
45class FunctionProfile;
46class ProfileNode;
47namespace Kernel {
48 class Statistics;
49};
50#endif
51
52class BaseCPU;
53class Checkpoint;
53class Checkpoint;
54class TranslatingPort;
54
55/**
56 * Struct for holding general thread state that is needed across CPU
57 * models. This includes things such as pointers to the process,
58 * memory, quiesce events, and certain stats. This can be expanded
59 * to hold more thread-specific stats within it.
60 */
61struct ThreadState {
62 typedef ThreadContext::Status Status;
63
64#if FULL_SYSTEM
55
56/**
57 * Struct for holding general thread state that is needed across CPU
58 * models. This includes things such as pointers to the process,
59 * memory, quiesce events, and certain stats. This can be expanded
60 * to hold more thread-specific stats within it.
61 */
62struct ThreadState {
63 typedef ThreadContext::Status Status;
64
65#if FULL_SYSTEM
65 ThreadState(int _cpuId, int _tid);
66 ThreadState(BaseCPU *cpu, int _cpuId, int _tid);
66#else
67#else
67 ThreadState(int _cpuId, int _tid, Process *_process,
68 short _asid, MemObject *mem);
68 ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,
69 short _asid);
69#endif
70
71 void serialize(std::ostream &os);
72
73 void unserialize(Checkpoint *cp, const std::string &section);
74
75 void setCpuId(int id) { cpuId = id; }
76

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

100 void setPhysPort(FunctionalPort *port) { physPort = port; }
101
102 VirtualPort *getVirtPort(ThreadContext *tc = NULL) { return virtPort; }
103
104 void setVirtPort(VirtualPort *port) { virtPort = port; }
105#else
106 Process *getProcessPtr() { return process; }
107
70#endif
71
72 void serialize(std::ostream &os);
73
74 void unserialize(Checkpoint *cp, const std::string &section);
75
76 void setCpuId(int id) { cpuId = id; }
77

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

101 void setPhysPort(FunctionalPort *port) { physPort = port; }
102
103 VirtualPort *getVirtPort(ThreadContext *tc = NULL) { return virtPort; }
104
105 void setVirtPort(VirtualPort *port) { virtPort = port; }
106#else
107 Process *getProcessPtr() { return process; }
108
108 TranslatingPort *getMemPort() { return port; }
109 TranslatingPort *getMemPort();
109
110 void setMemPort(TranslatingPort *_port) { port = _port; }
111
112 int getInstAsid() { return asid; }
113 int getDataAsid() { return asid; }
114#endif
115
116 /** Sets the current instruction being committed. */

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

148 Counter numLoad;
149
150 /** The number of simulated loads committed prior to this run. */
151 Counter startNumLoad;
152
153 protected:
154 ThreadContext::Status _status;
155
110
111 void setMemPort(TranslatingPort *_port) { port = _port; }
112
113 int getInstAsid() { return asid; }
114 int getDataAsid() { return asid; }
115#endif
116
117 /** Sets the current instruction being committed. */

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

149 Counter numLoad;
150
151 /** The number of simulated loads committed prior to this run. */
152 Counter startNumLoad;
153
154 protected:
155 ThreadContext::Status _status;
156
157 // Pointer to the base CPU.
158 BaseCPU *baseCpu;
159
156 // ID of this context w.r.t. the System or Process object to which
157 // it belongs. For full-system mode, this is the system CPU ID.
158 int cpuId;
159
160 // Index of hardware thread context on the CPU that this represents.
161 int tid;
162
163 public:

--- 75 unchanged lines hidden ---
160 // ID of this context w.r.t. the System or Process object to which
161 // it belongs. For full-system mode, this is the system CPU ID.
162 int cpuId;
163
164 // Index of hardware thread context on the CPU that this represents.
165 int tid;
166
167 public:

--- 75 unchanged lines hidden ---