From bc9db472d846e3b60c0fd5e39702ea355dba8046 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 31 Jul 2003 17:29:42 +0000 Subject: Update the 'ps', 'show pci', and 'show ktr' ddb commands to use the new pager callout instead of homerolling their own paging facility. --- sys/dev/pci/pci.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index f4681f1..e8e8245 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1274,19 +1274,19 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump) struct devlist *devlist_head; struct pci_conf *p; const char *name; - int i, error, none_count, nl; + int i, error, none_count, quit; none_count = 0; - nl = 0; /* get the head of the device queue */ devlist_head = &pci_devq; /* * Go through the list of devices and print out devices */ - for (error = 0, i = 0, + db_setup_paging(db_simple_pager, &quit, DB_LINES_PER_PAGE); + for (error = 0, i = 0, quit = 0, dinfo = STAILQ_FIRST(devlist_head); - (dinfo != NULL) && (error == 0) && (i < pci_numdevs); + (dinfo != NULL) && (error == 0) && (i < pci_numdevs) && !quit; dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { /* Populate pd_name and pd_unit */ @@ -1295,31 +1295,6 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump) name = device_get_name(dinfo->cfg.dev); p = &dinfo->conf; - /* - * XXX just take 20 for now... - */ - if (nl++ == 20) { - int c; - - db_printf("--More--"); - c = cngetc(); - db_printf("\r"); - /* - * A whole screenfull or just one line? - */ - switch (c) { - case '\n': /* just one line */ - nl = 20; - break; - case ' ': - nl = 0; /* another screenfull */ - break; - default: /* exit */ - db_printf("\n"); - return; - } - } - db_printf("%s%d@pci%d:%d:%d:\tclass=0x%06x card=0x%08x " "chip=0x%08x rev=0x%02x hdr=0x%02x\n", (name && *name) ? name : "none", -- cgit v1.1