static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset,

                              ram_addr_t *ram_addr_abs)

{

    RAMBlock *block = NULL;



    qemu_mutex_lock(&rs->src_page_req_mutex);

    if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {

        struct RAMSrcPageRequest *entry =

                                QSIMPLEQ_FIRST(&rs->src_page_requests);

        block = entry->rb;

        *offset = entry->offset;

        *ram_addr_abs = (entry->offset + entry->rb->offset) &

                        TARGET_PAGE_MASK;



        if (entry->len > TARGET_PAGE_SIZE) {

            entry->len -= TARGET_PAGE_SIZE;

            entry->offset += TARGET_PAGE_SIZE;

        } else {

            memory_region_unref(block->mr);

            QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req);

            g_free(entry);

        }

    }

    qemu_mutex_unlock(&rs->src_page_req_mutex);



    return block;

}

static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset,

                              ram_addr_t *ram_addr_abs)

{

    RAMBlock *block = NULL;



    qemu_mutex_lock(&rs->src_page_req_mutex);

    if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {

        struct RAMSrcPageRequest *entry =

                                QSIMPLEQ_FIRST(&rs->src_page_requests);

        block = entry->rb;

        *offset = entry->offset;

        *ram_addr_abs = (entry->offset + entry->rb->offset) &

                        TARGET_PAGE_MASK;



        if (entry->len > TARGET_PAGE_SIZE) {

            entry->len -= TARGET_PAGE_SIZE;

            entry->offset += TARGET_PAGE_SIZE;

        } else {

            memory_region_unref(block->mr);

            QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req);

            g_free(entry);

        }

    }

    qemu_mutex_unlock(&rs->src_page_req_mutex);



    return block;

}

                              ram_addr_t *ram_addr_abs)         *ram_addr_abs = (entry->offset + entry->rb->offset) &                         TARGET_PAGE_MASK;
static RAMBlock *FUNC_0(RAMState *rs, ram_addr_t *offset,

                              ram_addr_t *ram_addr_abs)

{

    RAMBlock *block = NULL;



    qemu_mutex_lock(&rs->src_page_req_mutex);

    if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {

        struct RAMSrcPageRequest *VAR_0 =

                                QSIMPLEQ_FIRST(&rs->src_page_requests);

        block = VAR_0->rb;

        *offset = VAR_0->offset;

        *ram_addr_abs = (VAR_0->offset + VAR_0->rb->offset) &

                        TARGET_PAGE_MASK;



        if (VAR_0->len > TARGET_PAGE_SIZE) {

            VAR_0->len -= TARGET_PAGE_SIZE;

            VAR_0->offset += TARGET_PAGE_SIZE;

        } else {

            memory_region_unref(block->mr);

            QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req);

            g_free(VAR_0);

        }

    }

    qemu_mutex_unlock(&rs->src_page_req_mutex);



    return block;

}

static RAMBlock *FUNC_0(RAMState *rs, ram_addr_t *offset,
ram_addr_t *ram_addr_abs)
{ RAMBlock *block = NULL; qemu_mutex_lock(&rs->src_page_req_mutex); if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) { struct RAMSrcPageRequest *VAR_0 =
QSIMPLEQ_FIRST(&rs->src_page_requests); block = VAR_0->rb; *offset = VAR_0->offset; *ram_addr_abs = (VAR_0->offset + VAR_0->rb->offset) &
TARGET_PAGE_MASK; if (VAR_0->len > TARGET_PAGE_SIZE) { VAR_0->len -= TARGET_PAGE_SIZE; VAR_0->offset += TARGET_PAGE_SIZE; } else { memory_region_unref(block->mr); QSIMPLEQ_REMOVE_HEAD(&rs->src_page_requests, next_req); g_free(VAR_0); } } qemu_mutex_unlock(&rs->src_page_req_mutex); return block; }