From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5942] Parallel port reset
Date: Sun, 07 Dec 2008 23:26:09 +0000 [thread overview]
Message-ID: <E1L9T0r-0001if-Lj@cvs.savannah.gnu.org> (raw)
Revision: 5942
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5942
Author: aurel32
Date: 2008-12-07 23:26:09 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
Parallel port reset
Attached patch adds a reset handler to parallel port, so it gets correct
register values after a reset.
(Herv?\195?\169 Poussineau)
Modified Paths:
--------------
trunk/hw/parallel.c
Modified: trunk/hw/parallel.c
===================================================================
--- trunk/hw/parallel.c 2008-12-07 23:00:00 UTC (rev 5941)
+++ trunk/hw/parallel.c 2008-12-07 23:26:09 UTC (rev 5942)
@@ -418,8 +418,10 @@
return ret;
}
-static void parallel_reset(ParallelState *s, qemu_irq irq, CharDriverState *chr)
+static void parallel_reset(void *opaque)
{
+ ParallelState *s = opaque;
+
s->datar = ~0;
s->dataw = ~0;
s->status = PARA_STS_BUSY;
@@ -430,9 +432,7 @@
s->control = PARA_CTR_SELECT;
s->control |= PARA_CTR_INIT;
s->control |= 0xc0;
- s->irq = irq;
s->irq_pending = 0;
- s->chr = chr;
s->hw_driver = 0;
s->epp_timeout = 0;
s->last_read_offset = ~0U;
@@ -447,7 +447,10 @@
s = qemu_mallocz(sizeof(ParallelState));
if (!s)
return NULL;
- parallel_reset(s, irq, chr);
+ s->irq = irq;
+ s->chr = chr;
+ parallel_reset(s);
+ qemu_register_reset(parallel_reset, s);
if (qemu_chr_ioctl(chr, CHR_IOCTL_PP_READ_STATUS, &dummy) == 0) {
s->hw_driver = 1;
@@ -538,8 +541,11 @@
s = qemu_mallocz(sizeof(ParallelState));
if (!s)
return NULL;
- parallel_reset(s, irq, chr);
+ s->irq = irq;
+ s->chr = chr;
s->it_shift = it_shift;
+ parallel_reset(s);
+ qemu_register_reset(parallel_reset, s);
io_sw = cpu_register_io_memory(0, parallel_mm_read_sw, parallel_mm_write_sw, s);
cpu_register_physical_memory(base, 8 << it_shift, io_sw);
reply other threads:[~2008-12-07 23:26 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=E1L9T0r-0001if-Lj@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--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).