projects
/
qemu
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix check for lswi (Jocelyn Mayer)
[qemu]
/
target-ppc
/
translate.c
diff --git
a/target-ppc/translate.c
b/target-ppc/translate.c
index
34f92bd
..
f6df06b
100644
(file)
--- a/
target-ppc/translate.c
+++ b/
target-ppc/translate.c
@@
-1229,10
+1229,10
@@
GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00000001, PPC_INTEGER)
if (nb == 0)
nb = 32;
nr = nb / 4;
if (nb == 0)
nb = 32;
nr = nb / 4;
- if (((start + nr) > 32 && start <= ra && (start + nr - 32) >= ra) ||
- ((start + nr) <= 32 && start <= ra && (start + nr) >= ra)) {
+ if (((start + nr) > 32 && start <= ra && (start + nr - 32) > ra) ||
+ ((start + nr) <= 32 && start <= ra && (start + nr) > ra)) {
RET_EXCP(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_LSWX);
RET_EXCP(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_LSWX);
- }
+ }
if (ra == 0) {
gen_op_set_T0(0);
} else {
if (ra == 0) {
gen_op_set_T0(0);
} else {
@@
-1302,8
+1302,14
@@
GEN_HANDLER(isync, 0x13, 0x16, 0xFF, 0x03FF0801, PPC_MEM)
/* lwarx */
#if defined(CONFIG_USER_ONLY)
/* lwarx */
#if defined(CONFIG_USER_ONLY)
+#define op_lwarx() gen_op_lwarx_raw()
#define op_stwcx() gen_op_stwcx_raw()
#else
#define op_stwcx() gen_op_stwcx_raw()
#else
+#define op_lwarx() (*gen_op_lwarx[ctx->mem_idx])()
+static GenOpFunc *gen_op_lwarx[] = {
+ &gen_op_lwarx_user,
+ &gen_op_lwarx_kernel,
+};
#define op_stwcx() (*gen_op_stwcx[ctx->mem_idx])()
static GenOpFunc *gen_op_stwcx[] = {
&gen_op_stwcx_user,
#define op_stwcx() (*gen_op_stwcx[ctx->mem_idx])()
static GenOpFunc *gen_op_stwcx[] = {
&gen_op_stwcx_user,
@@
-1320,9
+1326,8
@@
GEN_HANDLER(lwarx, 0x1F, 0x14, 0xFF, 0x00000001, PPC_RES)
gen_op_load_gpr_T1(rB(ctx->opcode));
gen_op_add();
}
gen_op_load_gpr_T1(rB(ctx->opcode));
gen_op_add();
}
- op_ldst(lwz);
+ op_lwarx();
gen_op_store_T1_gpr(rD(ctx->opcode));
gen_op_store_T1_gpr(rD(ctx->opcode));
- gen_op_set_reservation();
}
/* stwcx. */
}
/* stwcx. */
@@
-2992,7
+2997,7
@@
CPUPPCState *cpu_ppc_init(void)
if (create_ppc_proc(ppc_opcodes, env->spr[PVR]) < 0)
return NULL;
init_spr_rights(env->spr[PVR]);
if (create_ppc_proc(ppc_opcodes, env->spr[PVR]) < 0)
return NULL;
init_spr_rights(env->spr[PVR]);
- tlb_flush(env);
+ tlb_flush(env, 1);
#if defined (DO_SINGLE_STEP)
/* Single step trace mode */
msr_se = 1;
#if defined (DO_SINGLE_STEP)
/* Single step trace mode */
msr_se = 1;
@@
-3169,9
+3174,11
@@
int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
while (lj <= j)
gen_opc_instr_start[lj++] = 0;
tb->size = 0;
while (lj <= j)
gen_opc_instr_start[lj++] = 0;
tb->size = 0;
+#if 0
if (loglevel > 0) {
page_dump(logfile);
}
if (loglevel > 0) {
page_dump(logfile);
}
+#endif
} else {
tb->size = (uint32_t)ctx.nip - pc_start;
}
} else {
tb->size = (uint32_t)ctx.nip - pc_start;
}