From 36f696517b1723d627b79aa924bac7c678de01b0 Mon Sep 17 00:00:00 2001 From: j_mayer Date: Sun, 18 Mar 2007 08:47:10 +0000 Subject: As icbi is not a priviledge instruction and is treated as a load by the MMU it needs to be implemented for every MMU translation mode. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2492 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/translate.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'target-ppc/translate.c') diff --git a/target-ppc/translate.c b/target-ppc/translate.c index e5c2812..82919a5 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3069,17 +3069,48 @@ GEN_HANDLER(dcbz, 0x1F, 0x16, 0x1F, 0x03E00001, PPC_CACHE) } /* icbi */ +#define op_icbi() (*gen_op_icbi[ctx->mem_idx])() +#if defined(TARGET_PPC64) +#if defined(CONFIG_USER_ONLY) +static GenOpFunc *gen_op_icbi[] = { + &gen_op_icbi_raw, + &gen_op_icbi_raw, + &gen_op_icbi_64_raw, + &gen_op_icbi_64_raw, +}; +#else +static GenOpFunc *gen_op_icbi[] = { + &gen_op_icbi_user, + &gen_op_icbi_user, + &gen_op_icbi_kernel, + &gen_op_icbi_kernel, + &gen_op_icbi_64_user, + &gen_op_icbi_64_user, + &gen_op_icbi_64_kernel, + &gen_op_icbi_64_kernel, +}; +#endif +#else +#if defined(CONFIG_USER_ONLY) +static GenOpFunc *gen_op_icbi[] = { + &gen_op_icbi_raw, + &gen_op_icbi_raw, +}; +#else +static GenOpFunc *gen_op_icbi[] = { + &gen_op_icbi_user, + &gen_op_icbi_user, + &gen_op_icbi_kernel, + &gen_op_icbi_kernel, +}; +#endif +#endif GEN_HANDLER(icbi, 0x1F, 0x16, 0x1E, 0x03E00001, PPC_CACHE) { /* NIP cannot be restored if the memory exception comes from an helper */ gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); -#if defined(TARGET_PPC64) - if (ctx->sf_mode) - gen_op_icbi_64(); - else -#endif - gen_op_icbi(); + op_icbi(); RET_STOP(ctx); } -- cgit v1.1