void *rom_add_blob(const char *name, const void *blob, size_t len,

                   hwaddr addr, const char *fw_file_name,

                   FWCfgReadCallback fw_callback, void *callback_opaque)

{

    Rom *rom;

    void *data = NULL;



    rom           = g_malloc0(sizeof(*rom));

    rom->name     = g_strdup(name);

    rom->addr     = addr;

    rom->romsize  = len;

    rom->datasize = len;

    rom->data     = g_malloc0(rom->datasize);

    memcpy(rom->data, blob, len);

    rom_insert(rom);

    if (fw_file_name && fw_cfg) {

        char devpath[100];



        snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);



        if (rom_file_has_mr) {

            data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);

        } else {

            data = rom->data;

        }



        fw_cfg_add_file_callback(fw_cfg, fw_file_name,

                                 fw_callback, callback_opaque,

                                 data, rom->romsize);

    }

    return data;

}

void *rom_add_blob(const char *name, const void *blob, size_t len,

                   hwaddr addr, const char *fw_file_name,

                   FWCfgReadCallback fw_callback, void *callback_opaque)

{

    Rom *rom;

    void *data = NULL;



    rom           = g_malloc0(sizeof(*rom));

    rom->name     = g_strdup(name);

    rom->addr     = addr;

    rom->romsize  = len;

    rom->datasize = len;

    rom->data     = g_malloc0(rom->datasize);

    memcpy(rom->data, blob, len);

    rom_insert(rom);

    if (fw_file_name && fw_cfg) {

        char devpath[100];



        snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);



        if (rom_file_has_mr) {

            data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);

        } else {

            data = rom->data;

        }



        fw_cfg_add_file_callback(fw_cfg, fw_file_name,

                                 fw_callback, callback_opaque,

                                 data, rom->romsize);

    }

    return data;

}

void *rom_add_blob(const char *name, const void *blob, size_t len,     void *data = NULL;     return data; void *rom_add_blob(const char *name, const void *blob, size_t len,
void *FUNC_0(const char *VAR_0, const void *VAR_1, size_t VAR_2,

                   hwaddr VAR_3, const char *VAR_4,

                   FWCfgReadCallback VAR_5, void *VAR_6)

{

    Rom *rom;

    void *VAR_7 = NULL;



    rom           = g_malloc0(sizeof(*rom));

    rom->VAR_0     = g_strdup(VAR_0);

    rom->VAR_3     = VAR_3;

    rom->romsize  = VAR_2;

    rom->datasize = VAR_2;

    rom->VAR_7     = g_malloc0(rom->datasize);

    memcpy(rom->VAR_7, VAR_1, VAR_2);

    rom_insert(rom);

    if (VAR_4 && fw_cfg) {

        char VAR_8[100];



        snprintf(VAR_8, sizeof(VAR_8), "/rom@%s", VAR_4);



        if (rom_file_has_mr) {

            VAR_7 = rom_set_mr(rom, OBJECT(fw_cfg), VAR_8);

        } else {

            VAR_7 = rom->VAR_7;

        }



        fw_cfg_add_file_callback(fw_cfg, VAR_4,

                                 VAR_5, VAR_6,

                                 VAR_7, rom->romsize);

    }

    return VAR_7;

}

void *FUNC_0(const char *VAR_0, const void *VAR_1, size_t VAR_2,
hwaddr VAR_3, const char *VAR_4,
FWCfgReadCallback VAR_5, void *VAR_6)
{ Rom *rom; void *VAR_7 = NULL; rom           = g_malloc0(sizeof(*rom)); rom->VAR_0     = g_strdup(VAR_0); rom->VAR_3     = VAR_3; rom->romsize  = VAR_2; rom->datasize = VAR_2; rom->VAR_7     = g_malloc0(rom->datasize); memcpy(rom->VAR_7, VAR_1, VAR_2); rom_insert(rom); if (VAR_4 && fw_cfg) { char VAR_8[100]; snprintf(VAR_8, sizeof(VAR_8), "/rom@%s", VAR_4); if (rom_file_has_mr) { VAR_7 = rom_set_mr(rom, OBJECT(fw_cfg), VAR_8); } else { VAR_7 = rom->VAR_7; } fw_cfg_add_file_callback(fw_cfg, VAR_4,
VAR_5, VAR_6,
VAR_7, rom->romsize); } return VAR_7; }