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

{

    PageDesc *p;

    target_ulong addr;



    /* mmap_lock should already be held.  */

    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);

    if (flags & PAGE_WRITE)

        flags |= PAGE_WRITE_ORG;

    for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {

        p = page_find_alloc(addr >> TARGET_PAGE_BITS);

        /* We may be called for host regions that are outside guest

           address space.  */

        if (!p)

            return;

        /* if the write protection 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, NULL);

        }

        p->flags = flags;

    }

}

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

{

    PageDesc *p;

    target_ulong addr;



    

    start = start & TARGET_PAGE_MASK;

    end = TARGET_PAGE_ALIGN(end);

    if (flags & PAGE_WRITE)

        flags |= PAGE_WRITE_ORG;

    for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {

        p = page_find_alloc(addr >> TARGET_PAGE_BITS);

        



        if (!p)

            return;

        



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

            (flags & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0, NULL);

        }

        p->flags = flags;

    }

}

void FUNC_0(target_ulong VAR_0, target_ulong VAR_1, int VAR_2)

{

    PageDesc *p;

    target_ulong addr;



    

    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; addr < VAR_1; addr += TARGET_PAGE_SIZE) {

        p = page_find_alloc(addr >> TARGET_PAGE_BITS);

        



        if (!p)

            return;

        



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

            (VAR_2 & PAGE_WRITE) &&

            p->first_tb) {

            tb_invalidate_phys_page(addr, 0, NULL);

        }

        p->VAR_2 = VAR_2;

    }

}

void FUNC_0(target_ulong VAR_0, target_ulong VAR_1, int VAR_2)
{ PageDesc *p; target_ulong addr; 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; addr < VAR_1; addr += TARGET_PAGE_SIZE) { p = page_find_alloc(addr >> TARGET_PAGE_BITS); if (!p)
return; if (!(p->VAR_2 & PAGE_WRITE) &&
(VAR_2 & PAGE_WRITE) &&
p->first_tb) { tb_invalidate_phys_page(addr, 0, NULL); } p->VAR_2 = VAR_2; } }