Deleted Added
sdiff udiff text old ( 7580:6f77f379a594 ) new ( 7723:ee4ac00d0774 )
full compact
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;

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

44#include "mem/physical.hh"
45#include "sim/byteswap.hh"
46#include "sim/system.hh"
47#include "sim/debug.hh"
48
49#if FULL_SYSTEM
50#include "arch/vtophys.hh"
51#include "kern/kernel_stats.hh"
52#else
53#include "params/System.hh"
54#endif
55
56using namespace std;
57using namespace TheISA;
58
59vector<System *> System::systemList;
60
61int System::numSystemsRunning = 0;
62
63System::System(Params *p)
64 : SimObject(p), physmem(p->physmem), _numContexts(0),
65#if FULL_SYSTEM
66 init_param(p->init_param),
67 functionalPort(p->name + "-fport"),
68 virtPort(p->name + "-vport"),
69 loadAddrMask(p->load_addr_mask),
70#else
71 page_ptr(0),
72 next_PID(0),
73#endif
74 memoryMode(p->mem_mode), _params(p)
75{
76 // add self to global system list

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

81 if (!debugSymbolTable)
82 debugSymbolTable = new SymbolTable;
83
84
85 /**
86 * Get a functional port to memory
87 */
88 Port *mem_port;
89 mem_port = physmem->getPort("functional");
90 functionalPort.setPeer(mem_port);
91 mem_port->setPeer(&functionalPort);
92
93 mem_port = physmem->getPort("functional");
94 virtPort.setPeer(mem_port);
95 mem_port->setPeer(&virtPort);
96
97
98 /**
99 * Load the kernel code into memory
100 */
101 if (params()->kernel == "") {
102 inform("No kernel set for full system simulation. Assuming you know what"
103 " you're doing...\n");
104 } else {
105 // Load kernel code
106 kernel = createObjectFile(params()->kernel);
107 inform("kernel located at: %s", params()->kernel);
108
109 if (kernel == NULL)
110 fatal("Could not load kernel file %s", params()->kernel);
111
112 // Load program sections into memory
113 kernel->loadSections(&functionalPort, loadAddrMask);
114
115 // setup entry points
116 kernelStart = kernel->textBase();
117 kernelEnd = kernel->bssBase() + kernel->bssSize();
118 kernelEntry = kernel->entryPoint();
119
120 // load symbols
121 if (!kernel->loadGlobalSymbols(kernelSymtab))

--- 206 unchanged lines hidden ---