system.cc (3960:1dca397b2bab) system.cc (4095:44792b4db1b9)
1/*
2 * Copyright (c) 2003-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;

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

137 delete kernel;
138#else
139 panic("System::fixFuncEventAddr needs to be rewritten "
140 "to work with syscall emulation");
141#endif // FULL_SYSTEM}
142}
143
144int rgdb_wait = -1;
1/*
2 * Copyright (c) 2003-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;

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

137 delete kernel;
138#else
139 panic("System::fixFuncEventAddr needs to be rewritten "
140 "to work with syscall emulation");
141#endif // FULL_SYSTEM}
142}
143
144int rgdb_wait = -1;
145int rgdb_enable = true;
145
146void
147System::setMemoryMode(MemoryMode mode)
148{
149 assert(getState() == Drained);
150 memoryMode = mode;
151}
152
153bool System::breakpoint()
154{
146
147void
148System::setMemoryMode(MemoryMode mode)
149{
150 assert(getState() == Drained);
151 memoryMode = mode;
152}
153
154bool System::breakpoint()
155{
155 return remoteGDB[0]->breakpoint();
156 if (remoteGDB.size())
157 return remoteGDB[0]->breakpoint();
158 return false;
156}
157
158int
159System::registerThreadContext(ThreadContext *tc, int id)
160{
161 if (id == -1) {
162 for (id = 0; id < threadContexts.size(); id++) {
163 if (!threadContexts[id])

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

169 threadContexts.resize(id + 1);
170
171 if (threadContexts[id])
172 panic("Cannot have two CPUs with the same id (%d)\n", id);
173
174 threadContexts[id] = tc;
175 numcpus++;
176
159}
160
161int
162System::registerThreadContext(ThreadContext *tc, int id)
163{
164 if (id == -1) {
165 for (id = 0; id < threadContexts.size(); id++) {
166 if (!threadContexts[id])

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

172 threadContexts.resize(id + 1);
173
174 if (threadContexts[id])
175 panic("Cannot have two CPUs with the same id (%d)\n", id);
176
177 threadContexts[id] = tc;
178 numcpus++;
179
177 RemoteGDB *rgdb = new RemoteGDB(this, tc);
178 GDBListener *gdbl = new GDBListener(rgdb, 7000 + id);
179 gdbl->listen();
180 /**
181 * Uncommenting this line waits for a remote debugger to connect
182 * to the simulator before continuing.
183 */
184 if (rgdb_wait != -1 && rgdb_wait == id)
185 gdbl->accept();
180 if (rgdb_enable) {
181 RemoteGDB *rgdb = new RemoteGDB(this, tc);
182 GDBListener *gdbl = new GDBListener(rgdb, 7000 + id);
183 gdbl->listen();
184 /**
185 * Uncommenting this line waits for a remote debugger to
186 * connect to the simulator before continuing.
187 */
188 if (rgdb_wait != -1 && rgdb_wait == id)
189 gdbl->accept();
186
190
187 if (remoteGDB.size() <= id) {
188 remoteGDB.resize(id + 1);
191 if (remoteGDB.size() <= id) {
192 remoteGDB.resize(id + 1);
193 }
194
195 remoteGDB[id] = rgdb;
189 }
190
196 }
197
191 remoteGDB[id] = rgdb;
192
193 return id;
194}
195
196void
197System::startup()
198{
199 int i;
200 for (i = 0; i < threadContexts.size(); i++)

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

205System::replaceThreadContext(ThreadContext *tc, int id)
206{
207 if (id >= threadContexts.size()) {
208 panic("replaceThreadContext: bad id, %d >= %d\n",
209 id, threadContexts.size());
210 }
211
212 threadContexts[id] = tc;
198 return id;
199}
200
201void
202System::startup()
203{
204 int i;
205 for (i = 0; i < threadContexts.size(); i++)

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

210System::replaceThreadContext(ThreadContext *tc, int id)
211{
212 if (id >= threadContexts.size()) {
213 panic("replaceThreadContext: bad id, %d >= %d\n",
214 id, threadContexts.size());
215 }
216
217 threadContexts[id] = tc;
213 remoteGDB[id]->replaceThreadContext(tc);
218 if (id < remoteGDB.size())
219 remoteGDB[id]->replaceThreadContext(tc);
214}
215
216#if !FULL_SYSTEM
217Addr
218System::new_page()
219{
220 Addr return_addr = page_ptr << LogVMPageSize;
221 ++page_ptr;

--- 79 unchanged lines hidden ---
220}
221
222#if !FULL_SYSTEM
223Addr
224System::new_page()
225{
226 Addr return_addr = page_ptr << LogVMPageSize;
227 ++page_ptr;

--- 79 unchanged lines hidden ---