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 <gem5/asm/generic/m5ops.h>
55
56#include "arch/kernel_stats.hh"
57#include "arch/pseudo_inst.hh"
58#include "arch/utility.hh"
59#include "arch/vtophys.hh"
60#include "base/debug.hh"
61#include "base/output.hh"
62#include "config/the_isa.hh"
63#include "cpu/base.hh"

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

106 // from getArgument, it'd most likely break.
107 int arg_num(0);
108 for (int i = 0; i < sizeof(args) / sizeof(*args); ++i) {
109 args[arg_num] = getArgument(tc, arg_num, sizeof(uint64_t), false);
110 ++arg_num;
111 }
112
113 switch (func) {
114 case M5OP_ARM:
115 arm(tc);
116 break;
117
118 case M5OP_QUIESCE:
119 quiesce(tc);
120 break;
121
122 case M5OP_QUIESCE_NS:
123 quiesceNs(tc, args[0]);
124 break;
125
126 case M5OP_QUIESCE_CYCLE:
127 quiesceCycles(tc, args[0]);
128 break;
129
130 case M5OP_QUIESCE_TIME:
131 return quiesceTime(tc);
132
133 case M5OP_RPNS:
134 return rpns(tc);
135
136 case M5OP_WAKE_CPU:
137 wakeCPU(tc, args[0]);
138 break;
139
140 case M5OP_EXIT:
141 m5exit(tc, args[0]);
142 break;
143
144 case M5OP_FAIL:
145 m5fail(tc, args[0], args[1]);
146 break;
147
148 case M5OP_INIT_PARAM:
149 return initParam(tc, args[0], args[1]);
150
151 case M5OP_LOAD_SYMBOL:
152 loadsymbol(tc);
153 break;
154
155 case M5OP_RESET_STATS:
156 resetstats(tc, args[0], args[1]);
157 break;
158
159 case M5OP_DUMP_STATS:
160 dumpstats(tc, args[0], args[1]);
161 break;
162
163 case M5OP_DUMP_RESET_STATS:
164 dumpresetstats(tc, args[0], args[1]);
165 break;
166
167 case M5OP_CHECKPOINT:
168 m5checkpoint(tc, args[0], args[1]);
169 break;
170
171 case M5OP_WRITE_FILE:
172 return writefile(tc, args[0], args[1], args[2], args[3]);
173
174 case M5OP_READ_FILE:
175 return readfile(tc, args[0], args[1], args[2]);
176
177 case M5OP_DEBUG_BREAK:
178 debugbreak(tc);
179 break;
180
181 case M5OP_SWITCH_CPU:
182 switchcpu(tc);
183 break;
184
185 case M5OP_ADD_SYMBOL:
186 addsymbol(tc, args[0], args[1]);
187 break;
188
189 case M5OP_PANIC:
190 panic("M5 panic instruction called at %s\n", tc->pcState());
191
192 case M5OP_WORK_BEGIN:
193 workbegin(tc, args[0], args[1]);
194 break;
195
196 case M5OP_WORK_END:
197 workend(tc, args[0], args[1]);
198 break;
199
200 case M5OP_ANNOTATE:
201 case M5OP_RESERVED2:
202 case M5OP_RESERVED3:
203 case M5OP_RESERVED4:
204 case M5OP_RESERVED5:
205 warn("Unimplemented m5 op (0x%x)\n", func);
206 break;
207
208 /* SE mode functions */
209 case M5OP_SE_SYSCALL:
210 m5Syscall(tc);
211 break;
212
213 case M5OP_SE_PAGE_FAULT:
214 m5PageFault(tc);
215 break;
216
217 /* dist-gem5 functions */
218 case M5OP_DIST_TOGGLE_SYNC:
219 togglesync(tc);
220 break;
221
222 default:
223 warn("Unhandled m5 op: 0x%x\n", func);
224 break;
225 }
226

--- 493 unchanged lines hidden ---