From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4288] FDC fix 8/10 (Herv?\195?\169 Poussineau):
Date: Tue, 29 Apr 2008 16:17:43 +0000 [thread overview]
Message-ID: <E1JqsWV-0002wo-Ny@cvs.savannah.gnu.org> (raw)
Revision: 4288
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4288
Author: blueswir1
Date: 2008-04-29 16:17:42 +0000 (Tue, 29 Apr 2008)
Log Message:
-----------
FDC fix 8/10 (Herv?\195?\169 Poussineau):
- Replaces bootsel field by the whole tdr register. It may be easier if we want to later add support for tapes.
Modified Paths:
--------------
trunk/hw/fdc.c
Modified: trunk/hw/fdc.c
===================================================================
--- trunk/hw/fdc.c 2008-04-29 16:17:08 UTC (rev 4287)
+++ trunk/hw/fdc.c 2008-04-29 16:17:42 UTC (rev 4288)
@@ -467,10 +467,10 @@
uint8_t sra;
uint8_t srb;
uint8_t dor;
+ uint8_t tdr;
uint8_t dsr;
uint8_t msr;
uint8_t cur_drv;
- uint8_t bootsel;
uint8_t status0;
uint8_t status1;
uint8_t status2;
@@ -606,13 +606,13 @@
/* Controller state */
qemu_put_8s(f, &s->sra);
qemu_put_8s(f, &s->srb);
+ qemu_put_8s(f, &s->tdr);
qemu_put_8s(f, &s->dsr);
qemu_put_8s(f, &s->msr);
qemu_put_8s(f, &s->status0);
qemu_put_8s(f, &s->status1);
qemu_put_8s(f, &s->status2);
qemu_put_8s(f, &s->cur_drv);
- qemu_put_8s(f, &s->bootsel);
/* Command FIFO */
qemu_put_buffer(f, s->fifo, FD_SECTOR_LEN);
qemu_put_be32s(f, &s->data_pos);
@@ -651,13 +651,13 @@
/* Controller state */
qemu_get_8s(f, &s->sra);
qemu_get_8s(f, &s->srb);
+ qemu_get_8s(f, &s->tdr);
qemu_get_8s(f, &s->dsr);
qemu_get_8s(f, &s->msr);
qemu_get_8s(f, &s->status0);
qemu_get_8s(f, &s->status1);
qemu_get_8s(f, &s->status2);
qemu_get_8s(f, &s->cur_drv);
- qemu_get_8s(f, &s->bootsel);
/* Command FIFO */
qemu_get_buffer(f, s->fifo, FD_SECTOR_LEN);
qemu_get_be32s(f, &s->data_pos);
@@ -762,12 +762,15 @@
static inline fdrive_t *drv0 (fdctrl_t *fdctrl)
{
- return &fdctrl->drives[fdctrl->bootsel];
+ return &fdctrl->drives[(fdctrl->tdr & FD_TDR_BOOTSEL) >> 2];
}
static inline fdrive_t *drv1 (fdctrl_t *fdctrl)
{
- return &fdctrl->drives[1 - fdctrl->bootsel];
+ if ((fdctrl->tdr & FD_TDR_BOOTSEL) < (1 << 2))
+ return &fdctrl->drives[1];
+ else
+ return &fdctrl->drives[0];
}
static fdrive_t *get_cur_drv (fdctrl_t *fdctrl)
@@ -848,11 +851,8 @@
/* Tape drive register : 0x03 */
static uint32_t fdctrl_read_tape (fdctrl_t *fdctrl)
{
- uint32_t retval = 0;
+ uint32_t retval = fdctrl->tdr;
- /* Disk boot selection indicator */
- retval |= fdctrl->bootsel << 2;
- /* Tape indicators: never allowed */
FLOPPY_DPRINTF("tape drive register: 0x%02x\n", retval);
return retval;
@@ -867,7 +867,7 @@
}
FLOPPY_DPRINTF("tape drive register set to 0x%02x\n", value);
/* Disk boot selection indicator */
- fdctrl->bootsel = (value & FD_TDR_BOOTSEL) >> 2;
+ fdctrl->tdr = value & FD_TDR_BOOTSEL;
/* Tape indicators: never allow */
}
reply other threads:[~2008-04-29 16:17 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=E1JqsWV-0002wo-Ny@cvs.savannah.gnu.org \
--to=blauwirbel@gmail.com \
--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).