struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,

                BlockDriverState *bd, qemu_irq irq, qemu_irq dma[],

                omap_clk fclk, omap_clk iclk)

{

    struct omap_mmc_s *s = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));



    s->irq = irq;

    s->dma = dma;

    s->clk = fclk;

    s->lines = 4;

    s->rev = 2;



    omap_mmc_reset(s);



    memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc",

                          omap_l4_region_size(ta, 0));

    omap_l4_attach(ta, 0, &s->iomem);



    /* Instantiate the storage */

    s->card = sd_init(bd, false);

    if (s->card == NULL) {

        exit(1);

    }



    s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];

    sd_set_cb(s->card, NULL, s->cdet);



    return s;

}

struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,

                BlockDriverState *bd, qemu_irq irq, qemu_irq dma[],

                omap_clk fclk, omap_clk iclk)

{

    struct omap_mmc_s *s = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));



    s->irq = irq;

    s->dma = dma;

    s->clk = fclk;

    s->lines = 4;

    s->rev = 2;



    omap_mmc_reset(s);



    memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc",

                          omap_l4_region_size(ta, 0));

    omap_l4_attach(ta, 0, &s->iomem);



    

    s->card = sd_init(bd, false);

    if (s->card == NULL) {

        exit(1);

    }



    s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];

    sd_set_cb(s->card, NULL, s->cdet);



    return s;

}

    s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];
struct omap_mmc_s *FUNC_0(struct omap_target_agent_s *VAR_0,

                BlockDriverState *VAR_1, qemu_irq VAR_2, qemu_irq VAR_3[],

                omap_clk VAR_4, omap_clk VAR_5)

{

    struct omap_mmc_s *VAR_6 = (struct omap_mmc_s *)

            g_malloc0(sizeof(struct omap_mmc_s));



    VAR_6->VAR_2 = VAR_2;

    VAR_6->VAR_3 = VAR_3;

    VAR_6->clk = VAR_4;

    VAR_6->lines = 4;

    VAR_6->rev = 2;



    omap_mmc_reset(VAR_6);



    memory_region_init_io(&VAR_6->iomem, NULL, &omap_mmc_ops, VAR_6, "omap.mmc",

                          omap_l4_region_size(VAR_0, 0));

    omap_l4_attach(VAR_0, 0, &VAR_6->iomem);



    

    VAR_6->card = sd_init(VAR_1, false);

    if (VAR_6->card == NULL) {

        exit(1);

    }



    VAR_6->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, VAR_6, 1)[0];

    sd_set_cb(VAR_6->card, NULL, VAR_6->cdet);



    return VAR_6;

}

struct omap_mmc_s *FUNC_0(struct omap_target_agent_s *VAR_0,
BlockDriverState *VAR_1, qemu_irq VAR_2, qemu_irq VAR_3[],
omap_clk VAR_4, omap_clk VAR_5)
{ struct omap_mmc_s *VAR_6 = (struct omap_mmc_s *)
g_malloc0(sizeof(struct omap_mmc_s)); VAR_6->VAR_2 = VAR_2; VAR_6->VAR_3 = VAR_3; VAR_6->clk = VAR_4; VAR_6->lines = 4; VAR_6->rev = 2; omap_mmc_reset(VAR_6); memory_region_init_io(&VAR_6->iomem, NULL, &omap_mmc_ops, VAR_6, "omap.mmc",
omap_l4_region_size(VAR_0, 0)); omap_l4_attach(VAR_0, 0, &VAR_6->iomem); VAR_6->card = sd_init(VAR_1, false); if (VAR_6->card == NULL) { exit(1); } VAR_6->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, VAR_6, 1)[0]; sd_set_cb(VAR_6->card, NULL, VAR_6->cdet); return VAR_6; }