system.cc (8852:c744483edfcf) system.cc (8885:52bbd95b31ed)
1/*
2 * Copyright (c) 2002-2005 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;

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

58 console = createObjectFile(params()->console);
59 if (console == NULL)
60 fatal("Could not load console file %s", params()->console);
61
62 // Load pal file
63 pal = createObjectFile(params()->pal);
64 if (pal == NULL)
65 fatal("Could not load PALcode file %s", params()->pal);
1/*
2 * Copyright (c) 2002-2005 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;

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

58 console = createObjectFile(params()->console);
59 if (console == NULL)
60 fatal("Could not load console file %s", params()->console);
61
62 // Load pal file
63 pal = createObjectFile(params()->pal);
64 if (pal == NULL)
65 fatal("Could not load PALcode file %s", params()->pal);
66
67 // load symbols
68 if (!console->loadGlobalSymbols(consoleSymtab))
69 panic("could not load console symbols\n");
70
71 if (!pal->loadGlobalSymbols(palSymtab))
72 panic("could not load pal symbols\n");
73
74 if (!pal->loadLocalSymbols(palSymtab))
75 panic("could not load pal symbols\n");
76
77 if (!console->loadGlobalSymbols(debugSymbolTable))
78 panic("could not load console symbols\n");
79
80 if (!pal->loadGlobalSymbols(debugSymbolTable))
81 panic("could not load pal symbols\n");
82
83 if (!pal->loadLocalSymbols(debugSymbolTable))
84 panic("could not load pal symbols\n");
85
86
66}
67
68AlphaSystem::~AlphaSystem()
69{
70 delete consoleSymtab;
71 delete console;
72 delete pal;
73#ifdef DEBUG
74 delete consolePanicEvent;
75#endif
76}
77
78void
79AlphaSystem::initState()
80{
87}
88
89AlphaSystem::~AlphaSystem()
90{
91 delete consoleSymtab;
92 delete console;
93 delete pal;
94#ifdef DEBUG
95 delete consolePanicEvent;
96#endif
97}
98
99void
100AlphaSystem::initState()
101{
102 Addr addr = 0;
103
81 // Moved from the constructor to here since it relies on the
82 // address map being resolved in the interconnect
83
84 // Call the initialisation of the super class
85 System::initState();
86
87 // Load program sections into memory
88 pal->loadSections(physProxy, loadAddrMask);
89 console->loadSections(physProxy, loadAddrMask);
90
104 // Moved from the constructor to here since it relies on the
105 // address map being resolved in the interconnect
106
107 // Call the initialisation of the super class
108 System::initState();
109
110 // Load program sections into memory
111 pal->loadSections(physProxy, loadAddrMask);
112 console->loadSections(physProxy, loadAddrMask);
113
91 // load symbols
92 if (!console->loadGlobalSymbols(consoleSymtab))
93 panic("could not load console symbols\n");
94
95 if (!pal->loadGlobalSymbols(palSymtab))
96 panic("could not load pal symbols\n");
97
98 if (!pal->loadLocalSymbols(palSymtab))
99 panic("could not load pal symbols\n");
100
101 if (!console->loadGlobalSymbols(debugSymbolTable))
102 panic("could not load console symbols\n");
103
104 if (!pal->loadGlobalSymbols(debugSymbolTable))
105 panic("could not load pal symbols\n");
106
107 if (!pal->loadLocalSymbols(debugSymbolTable))
108 panic("could not load pal symbols\n");
109
110 Addr addr = 0;
111#ifndef NDEBUG
112 consolePanicEvent = addConsoleFuncEvent<BreakPCEvent>("panic");
113#endif
114
115 /**
116 * Copy the osflags (kernel arguments) into the consoles
117 * memory. (Presently Linux does not use the console service
118 * routine to get these command line arguments, but Tru64 and
119 * others do.)
120 */
121 if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
122 virtProxy.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),

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

130 if (consoleSymtab->findAddress("m5_rpb", addr)) {
131 uint64_t data;
132 data = htog(params()->system_type);
133 virtProxy.write(addr+0x50, data);
134 data = htog(params()->system_rev);
135 virtProxy.write(addr+0x58, data);
136 } else
137 panic("could not find hwrpb\n");
114 /**
115 * Copy the osflags (kernel arguments) into the consoles
116 * memory. (Presently Linux does not use the console service
117 * routine to get these command line arguments, but Tru64 and
118 * others do.)
119 */
120 if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
121 virtProxy.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),

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

129 if (consoleSymtab->findAddress("m5_rpb", addr)) {
130 uint64_t data;
131 data = htog(params()->system_type);
132 virtProxy.write(addr+0x50, data);
133 data = htog(params()->system_rev);
134 virtProxy.write(addr+0x58, data);
135 } else
136 panic("could not find hwrpb\n");
137
138 // Setup all the function events now that we have a system and a symbol
139 // table
140 setupFuncEvents();
138}
139
141}
142
143void
144AlphaSystem::loadState(Checkpoint *cp)
145{
146 System::loadState(cp);
147
148 // Setup all the function events now that we have a system and a symbol
149 // table
150 setupFuncEvents();
151
152}
153
154void
155AlphaSystem::setupFuncEvents()
156{
157#ifndef NDEBUG
158 consolePanicEvent = addConsoleFuncEvent<BreakPCEvent>("panic");
159#endif
160}
161
140/**
141 * This function fixes up addresses that are used to match PCs for
142 * hooking simulator events on to target function executions.
143 *
144 * Alpha binaries may have multiple global offset table (GOT)
145 * sections. A function that uses the GOT starts with a
146 * two-instruction prolog which sets the global pointer (gp == r29) to
147 * the appropriate GOT section. The proper gp value is calculated

--- 78 unchanged lines hidden ---
162/**
163 * This function fixes up addresses that are used to match PCs for
164 * hooking simulator events on to target function executions.
165 *
166 * Alpha binaries may have multiple global offset table (GOT)
167 * sections. A function that uses the GOT starts with a
168 * two-instruction prolog which sets the global pointer (gp == r29) to
169 * the appropriate GOT section. The proper gp value is calculated

--- 78 unchanged lines hidden ---