Revision 6f7e9aec hw/fdc.c
b/hw/fdc.c | ||
---|---|---|
94 | 94 |
uint8_t ro; /* Is read-only */ |
95 | 95 |
} fdrive_t; |
96 | 96 |
|
97 |
#ifdef TARGET_SPARC |
|
98 |
/* XXX: suppress those hacks */ |
|
99 |
#define DMA_read_memory(a,b,c,d) |
|
100 |
#define DMA_write_memory(a,b,c,d) |
|
101 |
void DMA_register_channel (int nchan, |
|
102 |
DMA_transfer_handler transfer_handler, |
|
103 |
void *opaque) |
|
104 |
{ |
|
105 |
} |
|
106 |
#define DMA_hold_DREQ(a) |
|
107 |
#define DMA_release_DREQ(a) |
|
108 |
#define DMA_get_channel_mode(a) (0) |
|
109 |
#define DMA_schedule(a) |
|
110 |
#endif |
|
111 |
|
|
112 | 97 |
static void fd_init (fdrive_t *drv, BlockDriverState *bs) |
113 | 98 |
{ |
114 | 99 |
/* Drive */ |
... | ... | |
423 | 408 |
uint32_t retval; |
424 | 409 |
|
425 | 410 |
switch (reg & 0x07) { |
411 |
#ifdef TARGET_SPARC |
|
412 |
case 0x00: |
|
413 |
// Identify to Linux as S82078B |
|
414 |
retval = fdctrl_read_statusB(fdctrl); |
|
415 |
break; |
|
416 |
#endif |
|
426 | 417 |
case 0x01: |
427 | 418 |
retval = fdctrl_read_statusB(fdctrl); |
428 | 419 |
break; |
... | ... | |
577 | 568 |
|
578 | 569 |
static void fdctrl_raise_irq (fdctrl_t *fdctrl, uint8_t status) |
579 | 570 |
{ |
571 |
#ifdef TARGET_SPARC |
|
572 |
// Sparc mutation |
|
573 |
if (!fdctrl->dma_en) { |
|
574 |
fdctrl->state &= ~FD_CTRL_BUSY; |
|
575 |
fdctrl->int_status = status; |
|
576 |
return; |
|
577 |
} |
|
578 |
#endif |
|
580 | 579 |
if (~(fdctrl->state & FD_CTRL_INTR)) { |
581 | 580 |
pic_set_irq(fdctrl->irq_lvl, 1); |
582 | 581 |
fdctrl->state |= FD_CTRL_INTR; |
... | ... | |
980 | 979 |
len = dma_len - fdctrl->data_pos; |
981 | 980 |
if (len + rel_pos > FD_SECTOR_LEN) |
982 | 981 |
len = FD_SECTOR_LEN - rel_pos; |
983 |
FLOPPY_DPRINTF("copy %d bytes (%d %d %d) %d pos %d %02x %02x "
|
|
984 |
"(%d-0x%08x 0x%08x)\n", len, size, fdctrl->data_pos,
|
|
982 |
FLOPPY_DPRINTF("copy %d bytes (%d %d %d) %d pos %d %02x " |
|
983 |
"(%d-0x%08x 0x%08x)\n", len, dma_len, fdctrl->data_pos,
|
|
985 | 984 |
fdctrl->data_len, fdctrl->cur_drv, cur_drv->head, |
986 | 985 |
cur_drv->track, cur_drv->sect, fd_sector(cur_drv), |
987 |
fd_sector(cur_drv) * 512, addr);
|
|
986 |
fd_sector(cur_drv) * 512); |
|
988 | 987 |
if (fdctrl->data_dir != FD_DIR_WRITE || |
989 | 988 |
len < FD_SECTOR_LEN || rel_pos != 0) { |
990 | 989 |
/* READ & SCAN commands and realign to a sector for WRITE */ |
... | ... | |
1045 | 1044 |
FLOPPY_DPRINTF("seek to next sector (%d %02x %02x => %d) (%d)\n", |
1046 | 1045 |
cur_drv->head, cur_drv->track, cur_drv->sect, |
1047 | 1046 |
fd_sector(cur_drv), |
1048 |
fdctrl->data_pos - size);
|
|
1047 |
fdctrl->data_pos - len);
|
|
1049 | 1048 |
/* XXX: cur_drv->sect >= cur_drv->last_sect should be an |
1050 | 1049 |
error in fact */ |
1051 | 1050 |
if (cur_drv->sect >= cur_drv->last_sect || |
Also available in: Unified diff