Revision 5fafdf24 hw/i8259.c
b/hw/i8259.c | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* QEMU 8259 interrupt controller emulation |
3 |
*
|
|
3 |
* |
|
4 | 4 |
* Copyright (c) 2003-2004 Fabrice Bellard |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | 7 |
* of this software and associated documentation files (the "Software"), to deal |
8 | 8 |
* in the Software without restriction, including without limitation the rights |
... | ... | |
152 | 152 |
{ |
153 | 153 |
int i; |
154 | 154 |
for(i = 0; i < 2; i++) { |
155 |
printf("pic%d: imr=%x irr=%x padd=%d\n",
|
|
156 |
i, s->pics[i].imr, s->pics[i].irr,
|
|
155 |
printf("pic%d: imr=%x irr=%x padd=%d\n", |
|
156 |
i, s->pics[i].imr, s->pics[i].irr, |
|
157 | 157 |
s->pics[i].priority_add); |
158 |
|
|
158 |
|
|
159 | 159 |
} |
160 | 160 |
} |
161 | 161 |
printf("pic: cpu_interrupt\n"); |
... | ... | |
243 | 243 |
intno = s->pics[0].irq_base + irq; |
244 | 244 |
} |
245 | 245 |
pic_update_irq(s); |
246 |
|
|
246 |
|
|
247 | 247 |
#ifdef DEBUG_IRQ_LATENCY |
248 |
printf("IRQ%d latency=%0.3fus\n",
|
|
249 |
irq,
|
|
248 |
printf("IRQ%d latency=%0.3fus\n", |
|
249 |
irq, |
|
250 | 250 |
(double)(qemu_get_clock(vm_clock) - irq_time[irq]) * 1000000.0 / ticks_per_sec); |
251 | 251 |
#endif |
252 | 252 |
#if defined(DEBUG_PIC) |
... | ... | |
429 | 429 |
ret = pic_poll_read(&s->pics[1], 0x80) + 8; |
430 | 430 |
/* Prepare for ISR read */ |
431 | 431 |
s->pics[0].read_reg_select = 1; |
432 |
|
|
432 |
|
|
433 | 433 |
return ret; |
434 | 434 |
} |
435 | 435 |
|
... | ... | |
448 | 448 |
static void pic_save(QEMUFile *f, void *opaque) |
449 | 449 |
{ |
450 | 450 |
PicState *s = opaque; |
451 |
|
|
451 |
|
|
452 | 452 |
qemu_put_8s(f, &s->last_irr); |
453 | 453 |
qemu_put_8s(f, &s->irr); |
454 | 454 |
qemu_put_8s(f, &s->imr); |
... | ... | |
470 | 470 |
static int pic_load(QEMUFile *f, void *opaque, int version_id) |
471 | 471 |
{ |
472 | 472 |
PicState *s = opaque; |
473 |
|
|
473 |
|
|
474 | 474 |
if (version_id != 1) |
475 | 475 |
return -EINVAL; |
476 | 476 |
|
... | ... | |
510 | 510 |
{ |
511 | 511 |
int i; |
512 | 512 |
PicState *s; |
513 |
|
|
513 |
|
|
514 | 514 |
if (!isa_pic) |
515 | 515 |
return; |
516 | 516 |
|
517 | 517 |
for(i=0;i<2;i++) { |
518 | 518 |
s = &isa_pic->pics[i]; |
519 | 519 |
term_printf("pic%d: irr=%02x imr=%02x isr=%02x hprio=%d irq_base=%02x rr_sel=%d elcr=%02x fnm=%d\n", |
520 |
i, s->irr, s->imr, s->isr, s->priority_add,
|
|
521 |
s->irq_base, s->read_reg_select, s->elcr,
|
|
520 |
i, s->irr, s->imr, s->isr, s->priority_add, |
|
521 |
s->irq_base, s->read_reg_select, s->elcr, |
|
522 | 522 |
s->special_fully_nested_mode); |
523 | 523 |
} |
524 | 524 |
} |
Also available in: Unified diff