Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/stand/libsa Poll the next medium on both drive...
details: https://anonhg.NetBSD.org/src/rev/447144e2bcf9
branches: trunk
changeset: 763931:447144e2bcf9
user: isaki <isaki%NetBSD.org@localhost>
date: Thu Apr 07 13:38:21 2011 +0000
description:
Poll the next medium on both drive of #0 and #1.
diffstat:
sys/arch/x68k/stand/libsa/chdsk.c | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 deletions(-)
diffs (56 lines):
diff -r 9882c93cce34 -r 447144e2bcf9 sys/arch/x68k/stand/libsa/chdsk.c
--- a/sys/arch/x68k/stand/libsa/chdsk.c Thu Apr 07 11:02:24 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/chdsk.c Thu Apr 07 13:38:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chdsk.c,v 1.2 2009/01/12 07:56:31 tsutsui Exp $ */
+/* $NetBSD: chdsk.c,v 1.3 2011/04/07 13:38:21 isaki Exp $ */
/*
* Copyright (c) 2001 MINOURA Makoto.
@@ -38,20 +38,36 @@
{
if (strcmp(f->f_dev->dv_name, "fd") == 0) {
struct fd_softc *sc = f->f_devdata;
- int unit = (0x90 + sc->unit) << 8;
+ int drive[2];
+
+ drive[0] = 0x90 << 8;
+ drive[1] = 0x91 << 8;
- /* unlock */
- IOCS_B_DRVCHK(unit, 3);
- /* eject */
- IOCS_B_DRVCHK(unit, 1);
+ /* unlock current unit */
+ IOCS_B_DRVCHK(drive[sc->unit], 3);
+ /* eject current */
+ IOCS_B_DRVCHK(drive[sc->unit], 1);
awaitkey_1sec();
- /* prompt */
- IOCS_B_DRVCHK(unit, 4);
+ /* prompt both */
+ IOCS_B_DRVCHK(drive[0], 4);
+ IOCS_B_DRVCHK(drive[1], 4);
/* poll for medium */
- while ((IOCS_B_DRVCHK(unit, 0) & 2) == 0)
+ for (;;) {
+ if ((IOCS_B_DRVCHK(drive[0], 0) & 2)) {
+ sc->unit = 0;
+ break;
+ }
+ if ((IOCS_B_DRVCHK(drive[1], 0) & 2)) {
+ sc->unit = 1;
+ break;
+ }
awaitkey_1sec();
- /* lock */
- IOCS_B_DRVCHK(unit, 2);
+ }
+ /* prompt off */
+ IOCS_B_DRVCHK(drive[0], 5);
+ IOCS_B_DRVCHK(drive[1], 5);
+ /* lock new unit */
+ IOCS_B_DRVCHK(drive[sc->unit], 2);
}
return 0;
Home |
Main Index |
Thread Index |
Old Index