static inline void gen_op_mfspr(DisasContext *ctx)

{

    void (*read_cb)(void *opaque, int gprn, int sprn);

    uint32_t sprn = SPR(ctx->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (ctx->mem_idx == 2)

        read_cb = ctx->spr_cb[sprn].hea_read;

    else if (ctx->mem_idx)

        read_cb = ctx->spr_cb[sprn].oea_read;

    else

#endif

        read_cb = ctx->spr_cb[sprn].uea_read;

    if (likely(read_cb != NULL)) {

        if (likely(read_cb != SPR_NOACCESS)) {

            (*read_cb)(ctx, rD(ctx->opcode), sprn);

        } else {

            /* Privilege exception */

            /* This is a hack to avoid warnings when running Linux:

             * this OS breaks the PowerPC virtualisation model,

             * allowing userland application to read the PVR

             */

            if (sprn != SPR_PVR) {

                qemu_log("Trying to read privileged spr %d %03x at "

                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

                printf("Trying to read privileged spr %d %03x at "

                       TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

            }

            gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        }

    } else {

        /* Not defined */

        qemu_log("Trying to read invalid spr %d %03x at "

                    TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

        printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",

               sprn, sprn, ctx->nip);

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);

    }

}

static inline void gen_op_mfspr(DisasContext *ctx)

{

    void (*read_cb)(void *opaque, int gprn, int sprn);

    uint32_t sprn = SPR(ctx->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (ctx->mem_idx == 2)

        read_cb = ctx->spr_cb[sprn].hea_read;

    else if (ctx->mem_idx)

        read_cb = ctx->spr_cb[sprn].oea_read;

    else

#endif

        read_cb = ctx->spr_cb[sprn].uea_read;

    if (likely(read_cb != NULL)) {

        if (likely(read_cb != SPR_NOACCESS)) {

            (*read_cb)(ctx, rD(ctx->opcode), sprn);

        } else {

            

            







            if (sprn != SPR_PVR) {

                qemu_log("Trying to read privileged spr %d %03x at "

                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

                printf("Trying to read privileged spr %d %03x at "

                       TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

            }

            gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);

        }

    } else {

        

        qemu_log("Trying to read invalid spr %d %03x at "

                    TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);

        printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",

               sprn, sprn, ctx->nip);

        gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);

    }

}

                qemu_log("Trying to read privileged spr %d %03x at "                          TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);                 printf("Trying to read privileged spr %d %03x at "                        TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);         qemu_log("Trying to read invalid spr %d %03x at "                     TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);         printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",                sprn, sprn, ctx->nip);                sprn, sprn, ctx->nip);
static inline void FUNC_0(DisasContext *VAR_0)

{

    void (*VAR_1)(void *VAR_2, int VAR_3, int VAR_4);

    uint32_t VAR_4 = SPR(VAR_0->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (VAR_0->mem_idx == 2)

        VAR_1 = VAR_0->spr_cb[VAR_4].hea_read;

    else if (VAR_0->mem_idx)

        VAR_1 = VAR_0->spr_cb[VAR_4].oea_read;

    else

#endif

        VAR_1 = VAR_0->spr_cb[VAR_4].uea_read;

    if (likely(VAR_1 != NULL)) {

        if (likely(VAR_1 != SPR_NOACCESS)) {

            (*VAR_1)(VAR_0, rD(VAR_0->opcode), VAR_4);

        } else {

            

            







            if (VAR_4 != SPR_PVR) {

                qemu_log("Trying to read privileged spr %d %03x at "

                         TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip);

                printf("Trying to read privileged spr %d %03x at "

                       TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip);

            }

            gen_inval_exception(VAR_0, POWERPC_EXCP_PRIV_REG);

        }

    } else {

        

        qemu_log("Trying to read invalid spr %d %03x at "

                    TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip);

        printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",

               VAR_4, VAR_4, VAR_0->nip);

        gen_inval_exception(VAR_0, POWERPC_EXCP_INVAL_SPR);

    }

}

static inline void FUNC_0(DisasContext *VAR_0)
{ void (*VAR_1)(void *VAR_2, int VAR_3, int VAR_4); uint32_t VAR_4 = SPR(VAR_0->opcode); #if !defined(CONFIG_USER_ONLY)
if (VAR_0->mem_idx == 2)
VAR_1 = VAR_0->spr_cb[VAR_4].hea_read; else if (VAR_0->mem_idx)
VAR_1 = VAR_0->spr_cb[VAR_4].oea_read; else
#endif
VAR_1 = VAR_0->spr_cb[VAR_4].uea_read; if (likely(VAR_1 != NULL)) { if (likely(VAR_1 != SPR_NOACCESS)) { (*VAR_1)(VAR_0, rD(VAR_0->opcode), VAR_4); } else { if (VAR_4 != SPR_PVR) { qemu_log("Trying to read privileged spr %d %03x at "
TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip); printf("Trying to read privileged spr %d %03x at "
TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip); } gen_inval_exception(VAR_0, POWERPC_EXCP_PRIV_REG); } } else { qemu_log("Trying to read invalid spr %d %03x at "
TARGET_FMT_lx "\n", VAR_4, VAR_4, VAR_0->nip); printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",
VAR_4, VAR_4, VAR_0->nip); gen_inval_exception(VAR_0, POWERPC_EXCP_INVAL_SPR); } }