void page_set_flags(target_ulong start, target_ulong end, int flags)

{

    target_ulong addr, len;



    /* This function should never be called with addresses outside the

       guest address space.  If this assert fires, it probably indicates

       a missing call to h2g_valid.  */

#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS

    assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));

#endif

    assert(start < end);

    assert_memory_lock();



    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);



    if (flags & PAGE_WRITE) {

        flags |= PAGE_WRITE_ORG;

    }



    for (addr = start, len = end - start;

         len != 0;

         len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {

        PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1);



        /* If the write protection bit is set, then we invalidate

           the code inside.  */

        if (!(p->flags & PAGE_WRITE) &&

            (flags & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0);

        }

        p->flags = flags;

    }

}

void page_set_flags(target_ulong start, target_ulong end, int flags)

{

    target_ulong addr, len;



    





#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS

    assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));

#endif

    assert(start < end);

    assert_memory_lock();



    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);



    if (flags & PAGE_WRITE) {

        flags |= PAGE_WRITE_ORG;

    }



    for (addr = start, len = end - start;

         len != 0;

         len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {

        PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1);



        



        if (!(p->flags & PAGE_WRITE) &&

            (flags & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0);

        }

        p->flags = flags;

    }

}

    assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
void FUNC_0(target_ulong VAR_0, target_ulong VAR_1, int VAR_2)

{

    target_ulong addr, len;



    





#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS

    assert(VAR_1 < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));

#endif

    assert(VAR_0 < VAR_1);

    assert_memory_lock();



    VAR_0 = VAR_0 & TARGET_PAGE_MASK;

    VAR_1 = TARGET_PAGE_ALIGN(VAR_1);



    if (VAR_2 & PAGE_WRITE) {

        VAR_2 |= PAGE_WRITE_ORG;

    }



    for (addr = VAR_0, len = VAR_1 - VAR_0;

         len != 0;

         len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {

        PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1);



        



        if (!(p->VAR_2 & PAGE_WRITE) &&

            (VAR_2 & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0);

        }

        p->VAR_2 = VAR_2;

    }

}

void FUNC_0(target_ulong VAR_0, target_ulong VAR_1, int VAR_2)
{ target_ulong addr, len; #if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
assert(VAR_1 < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif
assert(VAR_0 < VAR_1); assert_memory_lock(); VAR_0 = VAR_0 & TARGET_PAGE_MASK; VAR_1 = TARGET_PAGE_ALIGN(VAR_1); if (VAR_2 & PAGE_WRITE) { VAR_2 |= PAGE_WRITE_ORG; } for (addr = VAR_0, len = VAR_1 - VAR_0; len != 0; len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) { PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1); if (!(p->VAR_2 & PAGE_WRITE) &&
(VAR_2 & PAGE_WRITE) &&
p->first_tb) { tb_invalidate_phys_page(addr, 0); } p->VAR_2 = VAR_2; } }