From 831031ce006ba1a31ac2b8d4a02b765ef71736de Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 14 Sep 1996 10:53:48 +0000 Subject: [PATCH] Attached simple external ddb commands `show rtc', `show pgrpdump' and `show cbstat'. The pgrpdump code was previously controlled by `#ifdef DEBUG'. --- sys/amd64/amd64/tsc.c | 12 +++++++----- sys/amd64/isa/clock.c | 12 +++++++----- sys/i386/i386/tsc.c | 12 +++++++----- sys/i386/isa/clock.c | 12 +++++++----- sys/isa/atrtc.c | 12 +++++++----- sys/kern/kern_proc.c | 15 +++++++-------- sys/kern/subr_clist.c | 9 ++++----- sys/kern/tty_subr.c | 9 ++++----- 8 files changed, 50 insertions(+), 43 deletions(-) diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index 3413dca89b46..54a83d0580cc 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.67 1996/08/02 21:16:26 bde Exp $ + * $Id: clock.c,v 1.68 1996/09/14 04:27:39 bde Exp $ */ /* @@ -47,7 +47,7 @@ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include @@ -323,16 +323,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ static int getit(void) diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 3413dca89b46..54a83d0580cc 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.67 1996/08/02 21:16:26 bde Exp $ + * $Id: clock.c,v 1.68 1996/09/14 04:27:39 bde Exp $ */ /* @@ -47,7 +47,7 @@ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include @@ -323,16 +323,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ static int getit(void) diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index 3413dca89b46..54a83d0580cc 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.67 1996/08/02 21:16:26 bde Exp $ + * $Id: clock.c,v 1.68 1996/09/14 04:27:39 bde Exp $ */ /* @@ -47,7 +47,7 @@ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include @@ -323,16 +323,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ static int getit(void) diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 3413dca89b46..54a83d0580cc 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.67 1996/08/02 21:16:26 bde Exp $ + * $Id: clock.c,v 1.68 1996/09/14 04:27:39 bde Exp $ */ /* @@ -47,7 +47,7 @@ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include @@ -323,16 +323,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ static int getit(void) diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 3413dca89b46..54a83d0580cc 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.67 1996/08/02 21:16:26 bde Exp $ + * $Id: clock.c,v 1.68 1996/09/14 04:27:39 bde Exp $ */ /* @@ -47,7 +47,7 @@ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include @@ -323,16 +323,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ static int getit(void) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index c1afc924c63e..8ed6b01e0272 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 - * $Id: kern_proc.c,v 1.20 1996/06/12 05:07:30 gpalmer Exp $ + * $Id: kern_proc.c,v 1.21 1996/07/09 16:51:10 wollman Exp $ */ #include @@ -77,9 +77,6 @@ LIST_HEAD(uihashhead, uidinfo) *uihashtbl; static u_long uihash; /* size of hash table - 1 */ static void orphanpg __P((struct pgrp *pg)); -#ifdef DEBUG -static void DDB_pgrpdump __P((void)); -#endif /* * Other process lists @@ -366,9 +363,11 @@ orphanpg(pg) } } -#ifdef DEBUG -static void -DDB_pgrpdump() +#include "opt_ddb.h" +#ifdef DDB +#include + +DB_SHOW_COMMAND(pgrpdump, pgrpdump) { register struct pgrp *pgrp; register struct proc *p; @@ -391,7 +390,7 @@ DDB_pgrpdump() } } } -#endif /* DEBUG */ +#endif /* DDB */ /* * Fill in an eproc structure for the specified process. diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index 0d175faf5298..7c04317c7f26 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -24,13 +24,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tty_subr.c,v 1.21 1996/01/04 21:12:23 wollman Exp $ + * $Id: tty_subr.c,v 1.22 1996/04/08 01:22:00 davidg Exp $ */ /* * clist support routines */ -#include "opt_ddb.h" #include #include @@ -57,11 +56,11 @@ static void cblock_alloc_cblocks __P((int number)); static void cblock_free __P((struct cblock *cblockp)); static void cblock_free_cblocks __P((int number)); +#include "opt_ddb.h" #ifdef DDB -static void DDB_cbstat __P((void)); +#include -static void -DDB_cbstat() +DB_SHOW_COMMAND(cbstat, cbstat) { printf( "tot = %d (active = %d, free = %d (reserved = %d, slush = %d))\n", diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 0d175faf5298..7c04317c7f26 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -24,13 +24,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tty_subr.c,v 1.21 1996/01/04 21:12:23 wollman Exp $ + * $Id: tty_subr.c,v 1.22 1996/04/08 01:22:00 davidg Exp $ */ /* * clist support routines */ -#include "opt_ddb.h" #include #include @@ -57,11 +56,11 @@ static void cblock_alloc_cblocks __P((int number)); static void cblock_free __P((struct cblock *cblockp)); static void cblock_free_cblocks __P((int number)); +#include "opt_ddb.h" #ifdef DDB -static void DDB_cbstat __P((void)); +#include -static void -DDB_cbstat() +DB_SHOW_COMMAND(cbstat, cbstat) { printf( "tot = %d (active = %d, free = %d (reserved = %d, slush = %d))\n",