Revision 2be17ebd hw/slavio_misc.c
b/hw/slavio_misc.c | ||
---|---|---|
51 | 51 |
uint32_t sysctrl; |
52 | 52 |
uint16_t leds; |
53 | 53 |
CPUState *env; |
54 |
qemu_irq fdc_tc; |
|
54 | 55 |
} MiscState; |
55 | 56 |
|
56 | 57 |
#define MISC_SIZE 1 |
... | ... | |
66 | 67 |
#define MISC_MDM 0x01b00000 |
67 | 68 |
#define MISC_SYS 0x01f00000 |
68 | 69 |
|
70 |
#define AUX1_TC 0x02 |
|
71 |
|
|
69 | 72 |
#define AUX2_PWROFF 0x01 |
70 | 73 |
#define AUX2_PWRINTCLR 0x02 |
71 | 74 |
#define AUX2_PWRFAIL 0x20 |
... | ... | |
175 | 178 |
MiscState *s = opaque; |
176 | 179 |
|
177 | 180 |
MISC_DPRINTF("Write aux1 %2.2x\n", val & 0xff); |
181 |
if (val & AUX1_TC) { |
|
182 |
// Send a pulse to floppy terminal count line |
|
183 |
if (s->fdc_tc) { |
|
184 |
qemu_irq_raise(s->fdc_tc); |
|
185 |
qemu_irq_lower(s->fdc_tc); |
|
186 |
} |
|
187 |
val &= ~AUX1_TC; |
|
188 |
} |
|
178 | 189 |
s->aux1 = val & 0xff; |
179 | 190 |
} |
180 | 191 |
|
... | ... | |
407 | 418 |
void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base, |
408 | 419 |
target_phys_addr_t aux1_base, |
409 | 420 |
target_phys_addr_t aux2_base, qemu_irq irq, |
410 |
CPUState *env) |
|
421 |
CPUState *env, qemu_irq **fdc_tc)
|
|
411 | 422 |
{ |
412 | 423 |
int io; |
413 | 424 |
MiscState *s; |
... | ... | |
462 | 473 |
|
463 | 474 |
s->irq = irq; |
464 | 475 |
s->env = env; |
476 |
*fdc_tc = &s->fdc_tc; |
|
465 | 477 |
|
466 | 478 |
register_savevm("slavio_misc", base, 1, slavio_misc_save, slavio_misc_load, |
467 | 479 |
s); |
Also available in: Unified diff