static void sdhci_sdma_transfer_single_block(SDHCIState *s)

{

    int n;

    uint32_t datacnt = s->blksize & 0x0fff;



    if (s->trnmod & SDHC_TRNS_READ) {

        for (n = 0; n < datacnt; n++) {

            s->fifo_buffer[n] = sdbus_read_data(&s->sdbus);

        }

        dma_memory_write(&address_space_memory, s->sdmasysad, s->fifo_buffer,

                         datacnt);

    } else {

        dma_memory_read(&address_space_memory, s->sdmasysad, s->fifo_buffer,

                        datacnt);

        for (n = 0; n < datacnt; n++) {

            sdbus_write_data(&s->sdbus, s->fifo_buffer[n]);

        }

    }



    if (s->trnmod & SDHC_TRNS_BLK_CNT_EN) {

        s->blkcnt--;

    }



    sdhci_end_transfer(s);

}

static void sdhci_sdma_transfer_single_block(SDHCIState *s)

{

    int n;

    uint32_t datacnt = s->blksize & 0x0fff;



    if (s->trnmod & SDHC_TRNS_READ) {

        for (n = 0; n < datacnt; n++) {

            s->fifo_buffer[n] = sdbus_read_data(&s->sdbus);

        }

        dma_memory_write(&address_space_memory, s->sdmasysad, s->fifo_buffer,

                         datacnt);

    } else {

        dma_memory_read(&address_space_memory, s->sdmasysad, s->fifo_buffer,

                        datacnt);

        for (n = 0; n < datacnt; n++) {

            sdbus_write_data(&s->sdbus, s->fifo_buffer[n]);

        }

    }



    if (s->trnmod & SDHC_TRNS_BLK_CNT_EN) {

        s->blkcnt--;

    }



    sdhci_end_transfer(s);

}

static void FUNC_0(SDHCIState *VAR_0)

{

    int VAR_1;

    uint32_t datacnt = VAR_0->blksize & 0x0fff;



    if (VAR_0->trnmod & SDHC_TRNS_READ) {

        for (VAR_1 = 0; VAR_1 < datacnt; VAR_1++) {

            VAR_0->fifo_buffer[VAR_1] = sdbus_read_data(&VAR_0->sdbus);

        }

        dma_memory_write(&address_space_memory, VAR_0->sdmasysad, VAR_0->fifo_buffer,

                         datacnt);

    } else {

        dma_memory_read(&address_space_memory, VAR_0->sdmasysad, VAR_0->fifo_buffer,

                        datacnt);

        for (VAR_1 = 0; VAR_1 < datacnt; VAR_1++) {

            sdbus_write_data(&VAR_0->sdbus, VAR_0->fifo_buffer[VAR_1]);

        }

    }



    if (VAR_0->trnmod & SDHC_TRNS_BLK_CNT_EN) {

        VAR_0->blkcnt--;

    }



    sdhci_end_transfer(VAR_0);

}

static void FUNC_0(SDHCIState *VAR_0)
{ int VAR_1; uint32_t datacnt = VAR_0->blksize & 0x0fff; if (VAR_0->trnmod & SDHC_TRNS_READ) { for (VAR_1 = 0; VAR_1 < datacnt; VAR_1++) { VAR_0->fifo_buffer[VAR_1] = sdbus_read_data(&VAR_0->sdbus); } dma_memory_write(&address_space_memory, VAR_0->sdmasysad, VAR_0->fifo_buffer,
datacnt); } else { dma_memory_read(&address_space_memory, VAR_0->sdmasysad, VAR_0->fifo_buffer,
datacnt); for (VAR_1 = 0; VAR_1 < datacnt; VAR_1++) { sdbus_write_data(&VAR_0->sdbus, VAR_0->fifo_buffer[VAR_1]); } } if (VAR_0->trnmod & SDHC_TRNS_BLK_CNT_EN) { VAR_0->blkcnt--; } sdhci_end_transfer(VAR_0); }