From: Bernhard Kauer <kauer@os.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Patch: PIC-i8259 does not work in single mode
Date: Thu, 29 Mar 2007 17:38:07 +0200 [thread overview]
Message-ID: <20070329153807.GC24080@silo.inf.tu-dresden.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 165 bytes --]
The PIC-i8259 does not work in single mode, where only the master PIC is used.
The attached patch fixes the initialization part for single mode.
Bernhard Kauer
[-- Attachment #2: qemu_pic_single.diff --]
[-- Type: text/plain, Size: 1874 bytes --]
Index: i8259.c
===================================================================
RCS file: /sources/qemu/qemu/hw/i8259.c,v
retrieving revision 1.20
diff -u -r1.20 i8259.c
--- i8259.c 24 Jan 2007 01:47:51 -0000 1.20
+++ i8259.c 26 Mar 2007 17:01:18 -0000
@@ -44,6 +44,7 @@
uint8_t rotate_on_auto_eoi;
uint8_t special_fully_nested_mode;
uint8_t init4; /* true if 4 byte init */
+ uint8_t single_mode; /* true if slave pic is not initialized */
uint8_t elcr; /* PIIX edge/trigger selection*/
uint8_t elcr_mask;
PicState2 *pics_state;
@@ -278,6 +279,7 @@
s->rotate_on_auto_eoi = 0;
s->special_fully_nested_mode = 0;
s->init4 = 0;
+ s->single_mode = 0;
/* Note: ELCR is not reset */
}
@@ -298,8 +300,7 @@
s->pics_state->irq_request(s->pics_state->irq_request_opaque, 0);
s->init_state = 1;
s->init4 = val & 1;
- if (val & 0x02)
- hw_error("single mode not supported");
+ s->single_mode = val & 2;
if (val & 0x08)
hw_error("level sensitive irq not supported");
} else if (val & 0x08) {
@@ -356,7 +357,7 @@
break;
case 1:
s->irq_base = val & 0xf8;
- s->init_state = 2;
+ s->init_state = s->single_mode && s->init4 ? 3 : 2;
break;
case 2:
if (s->init4) {
@@ -468,6 +469,7 @@
qemu_put_8s(f, &s->rotate_on_auto_eoi);
qemu_put_8s(f, &s->special_fully_nested_mode);
qemu_put_8s(f, &s->init4);
+ qemu_put_8s(f, &s->single_mode);
qemu_put_8s(f, &s->elcr);
}
@@ -492,6 +494,7 @@
qemu_get_8s(f, &s->rotate_on_auto_eoi);
qemu_get_8s(f, &s->special_fully_nested_mode);
qemu_get_8s(f, &s->init4);
+ qemu_get_8s(f, &s->single_mode);
qemu_get_8s(f, &s->elcr);
return 0;
}
reply other threads:[~2007-03-29 15:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070329153807.GC24080@silo.inf.tu-dresden.de \
--to=kauer@os.inf.tu-dresden.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).