Revision 3fc6c082 target-ppc/op.c
b/target-ppc/op.c | ||
---|---|---|
1 | 1 |
/* |
2 |
* PPC emulation micro-operations for qemu. |
|
2 |
* PowerPC emulation micro-operations for qemu.
|
|
3 | 3 |
* |
4 |
* Copyright (c) 2003 Jocelyn Mayer |
|
4 |
* Copyright (c) 2003-2005 Jocelyn Mayer
|
|
5 | 5 |
* |
6 | 6 |
* This library is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU Lesser General Public |
... | ... | |
130 | 130 |
#define REG 31 |
131 | 131 |
#include "op_template.h" |
132 | 132 |
|
133 |
/* PPC state maintenance operations */ |
|
133 |
/* PowerPC state maintenance operations */
|
|
134 | 134 |
/* set_Rc0 */ |
135 | 135 |
PPC_OP(set_Rc0) |
136 | 136 |
{ |
... | ... | |
223 | 223 |
|
224 | 224 |
PPC_OP(store_srin) |
225 | 225 |
{ |
226 |
do_store_sr(T1 >> 28);
|
|
226 |
do_store_sr(env, ((uint32_t)T1 >> 28), T0);
|
|
227 | 227 |
RETURN(); |
228 | 228 |
} |
229 | 229 |
|
... | ... | |
235 | 235 |
|
236 | 236 |
PPC_OP(store_sdr1) |
237 | 237 |
{ |
238 |
regs->sdr1 = T0;
|
|
238 |
do_store_sdr1(env, T0);
|
|
239 | 239 |
RETURN(); |
240 | 240 |
} |
241 | 241 |
|
... | ... | |
247 | 247 |
/* Load/store special registers */ |
248 | 248 |
PPC_OP(load_cr) |
249 | 249 |
{ |
250 |
do_load_cr();
|
|
250 |
T0 = do_load_cr(env);
|
|
251 | 251 |
RETURN(); |
252 | 252 |
} |
253 | 253 |
|
254 | 254 |
PPC_OP(store_cr) |
255 | 255 |
{ |
256 |
do_store_cr(PARAM(1)); |
|
256 |
do_store_cr(env, T0, PARAM(1));
|
|
257 | 257 |
RETURN(); |
258 | 258 |
} |
259 | 259 |
|
... | ... | |
279 | 279 |
|
280 | 280 |
PPC_OP(load_xer) |
281 | 281 |
{ |
282 |
do_load_xer();
|
|
282 |
T0 = do_load_xer(env);
|
|
283 | 283 |
RETURN(); |
284 | 284 |
} |
285 | 285 |
|
286 | 286 |
PPC_OP(store_xer) |
287 | 287 |
{ |
288 |
do_store_xer(); |
|
288 |
do_store_xer(env, T0);
|
|
289 | 289 |
RETURN(); |
290 | 290 |
} |
291 | 291 |
|
292 | 292 |
PPC_OP(load_msr) |
293 | 293 |
{ |
294 |
do_load_msr();
|
|
294 |
T0 = do_load_msr(env);
|
|
295 | 295 |
RETURN(); |
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
PPC_OP(store_msr) |
299 | 299 |
{ |
300 |
do_store_msr(); |
|
300 |
do_store_msr(env, T0);
|
|
301 | 301 |
RETURN(); |
302 | 302 |
} |
303 | 303 |
|
... | ... | |
378 | 378 |
T0 = regs->IBAT[PARAM(1)][PARAM(2)]; |
379 | 379 |
} |
380 | 380 |
|
381 |
PPC_OP(store_ibat)
|
|
381 |
void op_store_ibatu (void)
|
|
382 | 382 |
{ |
383 |
do_store_ibat(PARAM(1), PARAM(2)); |
|
383 |
do_store_ibatu(env, PARAM1, T0); |
|
384 |
RETURN(); |
|
385 |
} |
|
386 |
|
|
387 |
void op_store_ibatl (void) |
|
388 |
{ |
|
389 |
#if 1 |
|
390 |
env->IBAT[1][PARAM1] = T0; |
|
391 |
#else |
|
392 |
do_store_ibatl(env, PARAM1, T0); |
|
393 |
#endif |
|
394 |
RETURN(); |
|
384 | 395 |
} |
385 | 396 |
|
386 | 397 |
PPC_OP(load_dbat) |
... | ... | |
388 | 399 |
T0 = regs->DBAT[PARAM(1)][PARAM(2)]; |
389 | 400 |
} |
390 | 401 |
|
391 |
PPC_OP(store_dbat) |
|
402 |
void op_store_dbatu (void) |
|
403 |
{ |
|
404 |
do_store_dbatu(env, PARAM1, T0); |
|
405 |
RETURN(); |
|
406 |
} |
|
407 |
|
|
408 |
void op_store_dbatl (void) |
|
392 | 409 |
{ |
393 |
do_store_dbat(PARAM(1), PARAM(2)); |
|
410 |
#if 1 |
|
411 |
env->DBAT[1][PARAM1] = T0; |
|
412 |
#else |
|
413 |
do_store_dbatl(env, PARAM1, T0); |
|
414 |
#endif |
|
415 |
RETURN(); |
|
394 | 416 |
} |
395 | 417 |
|
396 | 418 |
/* FPSCR */ |
397 | 419 |
PPC_OP(load_fpscr) |
398 | 420 |
{ |
399 |
do_load_fpscr();
|
|
421 |
FT0 = do_load_fpscr(env);
|
|
400 | 422 |
RETURN(); |
401 | 423 |
} |
402 | 424 |
|
403 | 425 |
PPC_OP(store_fpscr) |
404 | 426 |
{ |
405 |
do_store_fpscr(PARAM(1));
|
|
427 |
do_store_fpscr(env, FT0, PARAM1);
|
|
406 | 428 |
RETURN(); |
407 | 429 |
} |
408 | 430 |
|
... | ... | |
1362 | 1384 |
/* Return from interrupt */ |
1363 | 1385 |
PPC_OP(rfi) |
1364 | 1386 |
{ |
1365 |
regs->nip = regs->spr[SRR0] & ~0x00000003; |
|
1387 |
regs->nip = regs->spr[SPR_SRR0] & ~0x00000003;
|
|
1366 | 1388 |
#if 1 // TRY |
1367 |
T0 = regs->spr[SRR1] & ~0xFFF00000; |
|
1389 |
T0 = regs->spr[SPR_SRR1] & ~0xFFF00000;
|
|
1368 | 1390 |
#else |
1369 |
T0 = regs->spr[SRR1] & ~0xFFFF0000; |
|
1370 |
#endif |
|
1371 |
do_store_msr(); |
|
1372 |
#if defined (DEBUG_OP) |
|
1373 |
dump_rfi(); |
|
1391 |
T0 = regs->spr[SPR_SRR1] & ~0xFFFF0000; |
|
1374 | 1392 |
#endif |
1375 |
// do_tlbia();
|
|
1393 |
do_store_msr(env, T0);
|
|
1376 | 1394 |
do_raise_exception(EXCP_RFI); |
1377 | 1395 |
RETURN(); |
1378 | 1396 |
} |
... | ... | |
1420 | 1438 |
do_tlbie(); |
1421 | 1439 |
RETURN(); |
1422 | 1440 |
} |
1441 |
|
|
1442 |
void op_store_pir (void) |
|
1443 |
{ |
|
1444 |
env->spr[SPR_PIR] = T0 & 0x0000000FUL; |
|
1445 |
RETURN(); |
|
1446 |
} |
Also available in: Unified diff