Deleted Added
sdiff udiff text old ( 12145:9079b93ac9d4 ) new ( 12158:c66cf095928d )
full compact
1/*
2 * Copyright (c) 2010-2012, 2015, 2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

46#include <fcntl.h>
47#include <unistd.h>
48
49#include <cerrno>
50#include <fstream>
51#include <string>
52#include <vector>
53
54#include "arch/kernel_stats.hh"
55#include "arch/pseudo_inst.hh"
56#include "arch/utility.hh"
57#include "arch/vtophys.hh"
58#include "base/debug.hh"
59#include "base/output.hh"
60#include "config/the_isa.hh"
61#include "cpu/base.hh"

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

104 // from getArgument, it'd most likely break.
105 int arg_num(0);
106 for (int i = 0; i < sizeof(args) / sizeof(*args); ++i) {
107 args[arg_num] = getArgument(tc, arg_num, sizeof(uint64_t), false);
108 ++arg_num;
109 }
110
111 switch (func) {
112 case 0x00: // arm_func
113 arm(tc);
114 break;
115
116 case 0x01: // quiesce_func
117 quiesce(tc);
118 break;
119
120 case 0x02: // quiescens_func
121 quiesceSkip(tc);
122 break;
123
124 case 0x03: // quiescecycle_func
125 quiesceNs(tc, args[0]);
126 break;
127
128 case 0x04: // quiescetime_func
129 return quiesceTime(tc);
130
131 case 0x07: // rpns_func
132 return rpns(tc);
133
134 case 0x09: // wakecpu_func
135 wakeCPU(tc, args[0]);
136 break;
137
138 case 0x21: // exit_func
139 m5exit(tc, args[0]);
140 break;
141
142 case 0x22:
143 m5fail(tc, args[0], args[1]);
144 break;
145
146 case 0x30: // initparam_func
147 return initParam(tc, args[0], args[1]);
148
149 case 0x31: // loadsymbol_func
150 loadsymbol(tc);
151 break;
152
153 case 0x40: // resetstats_func
154 resetstats(tc, args[0], args[1]);
155 break;
156
157 case 0x41: // dumpstats_func
158 dumpstats(tc, args[0], args[1]);
159 break;
160
161 case 0x42: // dumprststats_func
162 dumpresetstats(tc, args[0], args[1]);
163 break;
164
165 case 0x43: // ckpt_func
166 m5checkpoint(tc, args[0], args[1]);
167 break;
168
169 case 0x4f: // writefile_func
170 return writefile(tc, args[0], args[1], args[2], args[3]);
171
172 case 0x50: // readfile_func
173 return readfile(tc, args[0], args[1], args[2]);
174
175 case 0x51: // debugbreak_func
176 debugbreak(tc);
177 break;
178
179 case 0x52: // switchcpu_func
180 switchcpu(tc);
181 break;
182
183 case 0x53: // addsymbol_func
184 addsymbol(tc, args[0], args[1]);
185 break;
186
187 case 0x54: // panic_func
188 panic("M5 panic instruction called at %s\n", tc->pcState());
189
190 case 0x5a: // work_begin_func
191 workbegin(tc, args[0], args[1]);
192 break;
193
194 case 0x5b: // work_end_func
195 workend(tc, args[0], args[1]);
196 break;
197
198 case 0x55: // annotate_func
199 case 0x56: // reserved2_func
200 case 0x57: // reserved3_func
201 case 0x58: // reserved4_func
202 case 0x59: // reserved5_func
203 warn("Unimplemented m5 op (0x%x)\n", func);
204 break;
205
206 /* SE mode functions */
207 case 0x60: // syscall_func
208 m5Syscall(tc);
209 break;
210
211 case 0x61: // pagefault_func
212 m5PageFault(tc);
213 break;
214
215 /* dist-gem5 functions */
216 case 0x62: // distToggleSync_func
217 togglesync(tc);
218 break;
219
220 default:
221 warn("Unhandled m5 op: 0x%x\n", func);
222 break;
223 }
224

--- 493 unchanged lines hidden ---