提交 4f431960 编写于 作者: J j_mayer

No functional changes: remove dead code and fix indentation & wrapping lines.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3535 c046a42c-6fe2-441c-8c8c-71466251a162
上级 d8f699cb
......@@ -615,7 +615,8 @@ fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
fdctrl_reset(fdctrl, 0);
fdctrl->state = FD_CTRL_ACTIVE;
if (mem_mapped) {
io_mem = cpu_register_io_memory(0, fdctrl_mem_read, fdctrl_mem_write, fdctrl);
io_mem = cpu_register_io_memory(0, fdctrl_mem_read, fdctrl_mem_write,
fdctrl);
cpu_register_physical_memory(io_base, 0x08, io_mem);
} else {
register_ioport_read((uint32_t)io_base + 0x01, 5, 1, &fdctrl_read,
......@@ -856,6 +857,7 @@ static void fdctrl_write_rate (fdctrl_t *fdctrl, uint32_t value)
static int fdctrl_media_changed(fdrive_t *drv)
{
int ret;
if (!drv->bs)
return 0;
ret = bdrv_media_changed(drv->bs);
......@@ -1103,15 +1105,11 @@ static int fdctrl_transfer_handler (void *opaque, int nchan,
/* READ commands */
DMA_write_memory (nchan, fdctrl->fifo + rel_pos,
fdctrl->data_pos, len);
/* cpu_physical_memory_write(addr + fdctrl->data_pos, */
/* fdctrl->fifo + rel_pos, len); */
break;
case FD_DIR_WRITE:
/* WRITE commands */
DMA_read_memory (nchan, fdctrl->fifo + rel_pos,
fdctrl->data_pos, len);
/* cpu_physical_memory_read(addr + fdctrl->data_pos, */
/* fdctrl->fifo + rel_pos, len); */
if (bdrv_write(cur_drv->bs, fd_sector(cur_drv),
fdctrl->fifo, 1) < 0) {
FLOPPY_ERROR("writting sector %d\n", fd_sector(cur_drv));
......@@ -1125,8 +1123,6 @@ static int fdctrl_transfer_handler (void *opaque, int nchan,
uint8_t tmpbuf[FD_SECTOR_LEN];
int ret;
DMA_read_memory (nchan, tmpbuf, fdctrl->data_pos, len);
/* cpu_physical_memory_read(addr + fdctrl->data_pos, */
/* tmpbuf, len); */
ret = memcmp(tmpbuf, fdctrl->fifo + rel_pos, len);
if (ret == 0) {
status2 = 0x08;
......@@ -1175,7 +1171,7 @@ static int fdctrl_transfer_handler (void *opaque, int nchan,
}
}
}
end_transfer:
end_transfer:
len = fdctrl->data_pos - start_pos;
FLOPPY_DPRINTF("end transfer %d %d %d\n",
fdctrl->data_pos, len, fdctrl->data_len);
......@@ -1188,7 +1184,7 @@ end_transfer:
fdctrl->data_len -= len;
// if (fdctrl->data_len == 0)
fdctrl_stop_transfer(fdctrl, status0, status1, status2);
transfer_error:
transfer_error:
return len;
}
......@@ -1584,7 +1580,7 @@ static void fdctrl_write_data (fdctrl_t *fdctrl, uint32_t value)
return;
}
}
enqueue:
enqueue:
FLOPPY_DPRINTF("%s: %02x\n", __func__, value);
fdctrl->fifo[fdctrl->data_pos] = value;
if (++fdctrl->data_pos == fdctrl->data_len) {
......@@ -1856,6 +1852,7 @@ static void fdctrl_result_timer(void *opaque)
{
fdctrl_t *fdctrl = opaque;
fdrive_t *cur_drv = get_cur_drv(fdctrl);
/* Pretend we are spinning.
* This is needed for Coherent, which uses READ ID to check for
* sector interleaving.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册