static int ppc_hash64_pte_update_flags(struct mmu_ctx_hash64 *ctx,

                                       target_ulong *pte1p,

                                       int ret, int rw)

{

    int store = 0;



    /* Update page flags */

    if (!(*pte1p & HPTE64_R_R)) {

        /* Update accessed flag */

        *pte1p |= HPTE64_R_R;

        store = 1;

    }

    if (!(*pte1p & HPTE64_R_C)) {

        if (rw == 1 && ret == 0) {

            /* Update changed flag */

            *pte1p |= HPTE64_R_C;

            store = 1;

        } else {

            /* Force page fault for first write access */

            ctx->prot &= ~PAGE_WRITE;

        }

    }



    return store;

}

static int ppc_hash64_pte_update_flags(struct mmu_ctx_hash64 *ctx,

                                       target_ulong *pte1p,

                                       int ret, int rw)

{

    int store = 0;



    

    if (!(*pte1p & HPTE64_R_R)) {

        

        *pte1p |= HPTE64_R_R;

        store = 1;

    }

    if (!(*pte1p & HPTE64_R_C)) {

        if (rw == 1 && ret == 0) {

            

            *pte1p |= HPTE64_R_C;

            store = 1;

        } else {

            

            ctx->prot &= ~PAGE_WRITE;

        }

    }



    return store;

}

static int FUNC_0(struct mmu_ctx_hash64 *VAR_0,

                                       target_ulong *VAR_1,

                                       int VAR_2, int VAR_3)

{

    int VAR_4 = 0;



    

    if (!(*VAR_1 & HPTE64_R_R)) {

        

        *VAR_1 |= HPTE64_R_R;

        VAR_4 = 1;

    }

    if (!(*VAR_1 & HPTE64_R_C)) {

        if (VAR_3 == 1 && VAR_2 == 0) {

            

            *VAR_1 |= HPTE64_R_C;

            VAR_4 = 1;

        } else {

            

            VAR_0->prot &= ~PAGE_WRITE;

        }

    }



    return VAR_4;

}

static int FUNC_0(struct mmu_ctx_hash64 *VAR_0,
target_ulong *VAR_1,
int VAR_2, int VAR_3)
{ int VAR_4 = 0; if (!(*VAR_1 & HPTE64_R_R)) { *VAR_1 |= HPTE64_R_R; VAR_4 = 1; } if (!(*VAR_1 & HPTE64_R_C)) { if (VAR_3 == 1 && VAR_2 == 0) { *VAR_1 |= HPTE64_R_C; VAR_4 = 1; } else { VAR_0->prot &= ~PAGE_WRITE; } } return VAR_4; }