static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size,

                           uint32_t node, Error **errp)

{

    sPAPRDRConnector *drc;

    sPAPRDRConnectorClass *drck;

    uint32_t nr_lmbs = size/SPAPR_MEMORY_BLOCK_SIZE;

    int i, fdt_offset, fdt_size;

    void *fdt;



    for (i = 0; i < nr_lmbs; i++) {

        drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,

                addr/SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);



        fdt = create_device_tree(&fdt_size);

        fdt_offset = spapr_populate_memory_node(fdt, node, addr,

                                                SPAPR_MEMORY_BLOCK_SIZE);



        drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

        drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    /* send hotplug notification to the

     * guest only in case of hotplugged memory

     */

    if (dev->hotplugged) {

       spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);

    }

}

static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size,

                           uint32_t node, Error **errp)

{

    sPAPRDRConnector *drc;

    sPAPRDRConnectorClass *drck;

    uint32_t nr_lmbs = size/SPAPR_MEMORY_BLOCK_SIZE;

    int i, fdt_offset, fdt_size;

    void *fdt;



    for (i = 0; i < nr_lmbs; i++) {

        drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,

                addr/SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);



        fdt = create_device_tree(&fdt_size);

        fdt_offset = spapr_populate_memory_node(fdt, node, addr,

                                                SPAPR_MEMORY_BLOCK_SIZE);



        drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

        drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    





    if (dev->hotplugged) {

       spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);

    }

}

static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size,                            uint32_t node, Error **errp)        spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);
static void FUNC_0(DeviceState *VAR_0, uint64_t VAR_1, uint64_t VAR_2,

                           uint32_t VAR_3, Error **VAR_4)

{

    sPAPRDRConnector *drc;

    sPAPRDRConnectorClass *drck;

    uint32_t nr_lmbs = VAR_2/SPAPR_MEMORY_BLOCK_SIZE;

    int VAR_5, VAR_6, VAR_7;

    void *VAR_8;



    for (VAR_5 = 0; VAR_5 < nr_lmbs; VAR_5++) {

        drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,

                VAR_1/SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);



        VAR_8 = create_device_tree(&VAR_7);

        VAR_6 = spapr_populate_memory_node(VAR_8, VAR_3, VAR_1,

                                                SPAPR_MEMORY_BLOCK_SIZE);



        drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);

        drck->attach(drc, VAR_0, VAR_8, VAR_6, !VAR_0->hotplugged, VAR_4);

        VAR_1 += SPAPR_MEMORY_BLOCK_SIZE;

    }

    





    if (VAR_0->hotplugged) {

       spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs);

    }

}

static void FUNC_0(DeviceState *VAR_0, uint64_t VAR_1, uint64_t VAR_2,
uint32_t VAR_3, Error **VAR_4)
{ sPAPRDRConnector *drc; sPAPRDRConnectorClass *drck; uint32_t nr_lmbs = VAR_2/SPAPR_MEMORY_BLOCK_SIZE; int VAR_5, VAR_6, VAR_7; void *VAR_8; for (VAR_5 = 0; VAR_5 < nr_lmbs; VAR_5++) { drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB,
VAR_1/SPAPR_MEMORY_BLOCK_SIZE); g_assert(drc); VAR_8 = create_device_tree(&VAR_7); VAR_6 = spapr_populate_memory_node(VAR_8, VAR_3, VAR_1,
SPAPR_MEMORY_BLOCK_SIZE); drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); drck->attach(drc, VAR_0, VAR_8, VAR_6, !VAR_0->hotplugged, VAR_4); VAR_1 += SPAPR_MEMORY_BLOCK_SIZE; } if (VAR_0->hotplugged) { spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs); } }