Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/nubus Add debug routine as an aid for workin...



details:   https://anonhg.NetBSD.org/src/rev/893b2c1d0166
branches:  trunk
changeset: 473392:893b2c1d0166
user:      briggs <briggs%NetBSD.org@localhost>
date:      Tue Jun 01 03:26:42 1999 +0000

description:
Add debug routine as an aid for working out new nubus cards.

diffstat:

 sys/arch/mac68k/nubus/nubus.c |  42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r 5effd51726f4 -r 893b2c1d0166 sys/arch/mac68k/nubus/nubus.c
--- a/sys/arch/mac68k/nubus/nubus.c     Tue Jun 01 03:24:25 1999 +0000
+++ b/sys/arch/mac68k/nubus/nubus.c     Tue Jun 01 03:26:42 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nubus.c,v 1.45 1998/06/02 02:24:03 scottr Exp $        */
+/*     $NetBSD: nubus.c,v 1.46 1999/06/01 03:26:42 briggs Exp $        */
 
 /*
  * Copyright (c) 1995, 1996 Allen Briggs.  All rights reserved.
@@ -785,3 +785,43 @@
 
        return name_ret;
 }
+
+#ifdef DEBUG
+void
+nubus_scan_slot(bst, slotno)
+       bus_space_tag_t bst;
+       int slotno;
+{
+       int i=0, state=0;
+       char twirl[] = "-\\|/";
+       bus_space_handle_t sc_bsh;
+
+       if (bus_space_map(bst, NUBUS_SLOT2PA(slotno), NBMEMSIZE, 0, &sc_bsh)) {
+               printf("nubus_scan_slot: failed to map slot %d\n", slotno);
+               return;
+       }
+
+       printf("Scanning slot %c for accessible regions:\n",
+               slotno == 9 ? '9' : slotno - 10 + 'A');
+       for (i=0 ; i<NBMEMSIZE; i++) {
+               if (mac68k_bus_space_probe(bst, sc_bsh, i, 1)) {
+                       if (state == 0) {
+                               printf("\t0x%x-", i);
+                               state = 1;
+                       }
+               } else {
+                       if (state) {
+                               printf("0x%x\n", i);
+                               state = 0;
+                       }
+               }
+               if (i%100 == 0) {
+                       printf("%c\b", twirl[(i/100)%4]);
+               }
+       }
+       if (state) {
+               printf("0x%x\n", i);
+       }
+       return;
+}
+#endif



Home | Main Index | Thread Index | Old Index