Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Introduce machdep mca_disk_[un]busy(), which turn on/off...



details:   https://anonhg.NetBSD.org/src/rev/14baa605eb4c
branches:  trunk
changeset: 508917:14baa605eb4c
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Apr 22 11:52:18 2001 +0000

description:
Introduce machdep mca_disk_[un]busy(), which turn on/off disk LED.
Call as appropriate from the ESDI disk driver

diffstat:

 sys/arch/i386/include/mca_machdep.h |   8 +++++++-
 sys/arch/i386/mca/mca_machdep.c     |  23 ++++++++++++++++++++++-
 sys/dev/mca/ed_mca.c                |   6 +++++-
 3 files changed, 34 insertions(+), 3 deletions(-)

diffs (90 lines):

diff -r 7cd2318c981a -r 14baa605eb4c sys/arch/i386/include/mca_machdep.h
--- a/sys/arch/i386/include/mca_machdep.h       Sun Apr 22 11:51:45 2001 +0000
+++ b/sys/arch/i386/include/mca_machdep.h       Sun Apr 22 11:52:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mca_machdep.h,v 1.4 2000/07/09 10:35:11 jdolecek Exp $ */
+/*     $NetBSD: mca_machdep.h,v 1.5 2001/04/22 11:52:18 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -84,6 +84,12 @@
 void   mca_conf_write(mca_chipset_tag_t, int, int, int);
 void   mca_busprobe(void);
 
+/*
+ * These two are used to light disk busy LED on PS/2 during disk operations.
+ */
+void   mca_disk_busy(void);
+void   mca_disk_unbusy(void);
+
 /* MCA register addresses for IBM PS/2 */
 
 #define PS2_SYS_CTL_A          0x92    /* PS/2 System Control Port A */
diff -r 7cd2318c981a -r 14baa605eb4c sys/arch/i386/mca/mca_machdep.c
--- a/sys/arch/i386/mca/mca_machdep.c   Sun Apr 22 11:51:45 2001 +0000
+++ b/sys/arch/i386/mca/mca_machdep.c   Sun Apr 22 11:52:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mca_machdep.c,v 1.5 2001/04/22 11:51:45 jdolecek Exp $ */
+/*     $NetBSD: mca_machdep.c,v 1.6 2001/04/22 11:52:18 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -279,3 +279,24 @@
        MCA_system = (bios_features & FEATURE_MCABUS) ? 1 : 0;
 #endif /* 0 */
 }
+
+#define PORT_DISKLED   0x92
+#define DISKLED_ON     0x40
+
+/*
+ * Light disk busy LED on IBM PS/2.
+ */
+void
+mca_disk_busy(void)
+{
+       outb(PORT_DISKLED, inb(PORT_DISKLED) | DISKLED_ON);
+}
+
+/*
+ * Turn off disk LED on IBM PS/2.
+ */
+void
+mca_disk_unbusy(void)
+{
+       outb(PORT_DISKLED, inb(PORT_DISKLED) & ~DISKLED_ON);
+}
diff -r 7cd2318c981a -r 14baa605eb4c sys/dev/mca/ed_mca.c
--- a/sys/dev/mca/ed_mca.c      Sun Apr 22 11:51:45 2001 +0000
+++ b/sys/dev/mca/ed_mca.c      Sun Apr 22 11:52:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ed_mca.c,v 1.3 2001/04/22 11:32:49 jdolecek Exp $      */
+/*     $NetBSD: ed_mca.c,v 1.4 2001/04/22 11:52:18 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -63,6 +63,8 @@
 #include <machine/intr.h>
 #include <machine/bus.h>
 
+#include <dev/mca/mcavar.h>
+
 #include <dev/mca/edcreg.h>
 #include <dev/mca/edvar.h>
 #include <dev/mca/edcvar.h>
@@ -374,6 +376,7 @@
        /* Instrumentation. */
        disk_busy(&ed->sc_dk);
        ed->sc_flags |= EDF_DK_BUSY;
+       mca_disk_busy();
 
        /* Read or Write Data command */
        cmd_args[0] = 2;        /* Options 0000010 */
@@ -430,6 +433,7 @@
        if (ed->sc_flags & EDF_DK_BUSY) {
                disk_unbusy(&ed->sc_dk, (bp->b_bcount - bp->b_resid));
                ed->sc_flags &= ~EDF_DK_BUSY;
+               mca_disk_unbusy();
        }
 
        ed->sc_flags &= ~EDF_IODONE;



Home | Main Index | Thread Index | Old Index