system.cc (7733:08d6a773d1b6) system.cc (7770:6286bb50127e)
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;

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

62int System::numSystemsRunning = 0;
63
64System::System(Params *p)
65 : SimObject(p), physmem(p->physmem), _numContexts(0),
66#if FULL_SYSTEM
67 init_param(p->init_param),
68 loadAddrMask(p->load_addr_mask),
69#else
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;

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

62int System::numSystemsRunning = 0;
63
64System::System(Params *p)
65 : SimObject(p), physmem(p->physmem), _numContexts(0),
66#if FULL_SYSTEM
67 init_param(p->init_param),
68 loadAddrMask(p->load_addr_mask),
69#else
70 page_ptr(0),
71 next_PID(0),
70 pagePtr(0),
71 nextPID(0),
72#endif
73 memoryMode(p->mem_mode), _params(p)
74{
75 // add self to global system list
76 systemList.push_back(this);
77
78#if FULL_SYSTEM
79 kernelSymtab = new SymbolTable;

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

250 if (context_id < remoteGDB.size())
251 remoteGDB[context_id]->replaceThreadContext(tc);
252}
253
254#if !FULL_SYSTEM
255Addr
256System::new_page()
257{
72#endif
73 memoryMode(p->mem_mode), _params(p)
74{
75 // add self to global system list
76 systemList.push_back(this);
77
78#if FULL_SYSTEM
79 kernelSymtab = new SymbolTable;

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

250 if (context_id < remoteGDB.size())
251 remoteGDB[context_id]->replaceThreadContext(tc);
252}
253
254#if !FULL_SYSTEM
255Addr
256System::new_page()
257{
258 Addr return_addr = page_ptr << LogVMPageSize;
259 ++page_ptr;
258 Addr return_addr = pagePtr << LogVMPageSize;
259 ++pagePtr;
260 if (return_addr >= physmem->size())
261 fatal("Out of memory, please increase size of physical memory.");
262 return return_addr;
263}
264
265Addr
266System::memSize()
267{
268 return physmem->size();
269}
270
271Addr
272System::freeMemSize()
273{
260 if (return_addr >= physmem->size())
261 fatal("Out of memory, please increase size of physical memory.");
262 return return_addr;
263}
264
265Addr
266System::memSize()
267{
268 return physmem->size();
269}
270
271Addr
272System::freeMemSize()
273{
274 return physmem->size() - (page_ptr << LogVMPageSize);
274 return physmem->size() - (pagePtr << LogVMPageSize);
275}
276
277#endif
278
279void
280System::serialize(ostream &os)
281{
282#if FULL_SYSTEM
283 kernelSymtab->serialize("kernel_symtab", os);
284#else // !FULL_SYSTEM
275}
276
277#endif
278
279void
280System::serialize(ostream &os)
281{
282#if FULL_SYSTEM
283 kernelSymtab->serialize("kernel_symtab", os);
284#else // !FULL_SYSTEM
285 SERIALIZE_SCALAR(page_ptr);
285 SERIALIZE_SCALAR(pagePtr);
286 SERIALIZE_SCALAR(nextPID);
286#endif
287}
288
289
290void
291System::unserialize(Checkpoint *cp, const string &section)
292{
293#if FULL_SYSTEM
294 kernelSymtab->unserialize("kernel_symtab", cp, section);
295#else // !FULL_SYSTEM
287#endif
288}
289
290
291void
292System::unserialize(Checkpoint *cp, const string &section)
293{
294#if FULL_SYSTEM
295 kernelSymtab->unserialize("kernel_symtab", cp, section);
296#else // !FULL_SYSTEM
296 UNSERIALIZE_SCALAR(page_ptr);
297 UNSERIALIZE_SCALAR(pagePtr);
298 UNSERIALIZE_SCALAR(nextPID);
297#endif
298}
299
300void
301System::printSystems()
302{
303 vector<System *>::iterator i = systemList.begin();
304 vector<System *>::iterator end = systemList.end();

--- 24 unchanged lines hidden ---
299#endif
300}
301
302void
303System::printSystems()
304{
305 vector<System *>::iterator i = systemList.begin();
306 vector<System *>::iterator end = systemList.end();

--- 24 unchanged lines hidden ---