From e5a0927394502ac7d7d0383c523490eb35f773dc Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sat, 27 Aug 2011 14:24:27 +0000 Subject: [PATCH] Follow up to r225203 refining break-to-debugger run-time configuration improvements: (1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h MFC after: 3 weeks Approved by: re (bz) --- sys/arm/at91/uart_dev_at91usart.c | 23 +++-------------------- sys/conf/options | 5 ++--- sys/ddb/db_break.c | 2 -- sys/dev/cfe/cfe_console.c | 2 -- sys/dev/dcons/dcons_os.c | 1 - sys/dev/ofw/ofw_console.c | 1 - sys/dev/sio/sio.c | 1 - sys/dev/uart/uart_core.c | 4 ---- sys/modules/dcons/Makefile | 5 +---- sys/modules/sio/Makefile | 2 +- sys/pc98/cbus/sio.c | 1 - sys/powerpc/mambo/mambo_console.c | 2 -- 12 files changed, 7 insertions(+), 42 deletions(-) diff --git a/sys/arm/at91/uart_dev_at91usart.c b/sys/arm/at91/uart_dev_at91usart.c index 94ea9de1d275..f3d21aae5a0f 100644 --- a/sys/arm/at91/uart_dev_at91usart.c +++ b/sys/arm/at91/uart_dev_at91usart.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include @@ -485,25 +483,10 @@ at91_usart_bus_param(struct uart_softc *sc, int baudrate, int databits, static __inline void at91_rx_put(struct uart_softc *sc, int key) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { - if ((kdb_brk = kdb_alt_break(key, &sc->sc_altbrk)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } - } +#if defined(KDB) + if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) + kdb_alt_break(key, &sc->sc_altbrk); #endif uart_rx_put(sc, key); } diff --git a/sys/conf/options b/sys/conf/options index 27fdbedacb60..b36a644b9e52 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -47,6 +47,8 @@ TWA_DEBUG opt_twa.h TWA_FLASH_FIRMWARE opt_twa.h # Debugging options. +ALT_BREAK_TO_DEBUGGER opt_kdb.h +BREAK_TO_DEBUGGER opt_kdb.h DDB DDB_BUFR_SIZE opt_ddb.h DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h @@ -637,9 +639,6 @@ BKTR_SIS_VIA_MODE opt_bktr.h BKTR_USE_FREEBSD_SMBUS opt_bktr.h BKTR_NEW_MSP34XX_DRIVER opt_bktr.h -BREAK_TO_DEBUGGER opt_comconsole.h -ALT_BREAK_TO_DEBUGGER opt_comconsole.h - # Options to support PPS UART_PPS_ON_CTS opt_uart.h diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index ac0c87418487..02833ec0a828 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include diff --git a/sys/dev/cfe/cfe_console.c b/sys/dev/cfe/cfe_console.c index f3946c571ecc..5a6b0a2bf9ba 100644 --- a/sys/dev/cfe/cfe_console.c +++ b/sys/dev/cfe/cfe_console.c @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index 53ac612f6ba8..b7de4148ef74 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -64,7 +64,6 @@ #include #include -#include "opt_comconsole.h" #include "opt_dcons.h" #include "opt_kdb.h" #include "opt_gdb.h" diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index b4a949c1f19f..62dbe51e87e0 100644 --- a/sys/dev/ofw/ofw_console.c +++ b/sys/dev/ofw/ofw_console.c @@ -26,7 +26,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_ofw.h" #include diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 1f2590f8918d..7e2054e2070c 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c index 5bd582b1a043..9260d063b990 100644 --- a/sys/dev/uart/uart_core.c +++ b/sys/dev/uart/uart_core.c @@ -27,10 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef KLD_MODULE -#include "opt_comconsole.h" -#endif - #include #include #include diff --git a/sys/modules/dcons/Makefile b/sys/modules/dcons/Makefile index 604242503971..4a08b6592381 100644 --- a/sys/modules/dcons/Makefile +++ b/sys/modules/dcons/Makefile @@ -5,7 +5,7 @@ KMOD = dcons SRCS = dcons.c dcons.h dcons_os.c dcons_os.h \ - opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h opt_comconsole.h + opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h .if !defined(KERNBUILDDIR) opt_kdb.h: @@ -13,9 +13,6 @@ opt_kdb.h: opt_ddb.h: echo "#define DDB 1" > $@ - -opt_comconsole.h: - echo "#define ALT_BREAK_TO_DEBUGGER 1" > $@ .endif CFLAGS+= -I${.CURDIR}/../.. diff --git a/sys/modules/sio/Makefile b/sys/modules/sio/Makefile index dc683ba31f3f..057e9c614d42 100644 --- a/sys/modules/sio/Makefile +++ b/sys/modules/sio/Makefile @@ -7,7 +7,7 @@ KMOD= sio SRCS= bus_if.h card_if.h device_if.h isa_if.h pci_if.h serdev_if.h \ - opt_comconsole.h opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ + opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ sio.c sio_pccard.c sio_pci.c sio_puc.c pccarddevs.h .if ${MACHINE} == "pc98" SRCS+= sio_cbus.c diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index bbac9d3aee17..959726f2f019 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -31,7 +31,6 @@ * from: i386/isa sio.c,v 1.234 */ -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" diff --git a/sys/powerpc/mambo/mambo_console.c b/sys/powerpc/mambo/mambo_console.c index 553071c63f38..880ef57b1470 100644 --- a/sys/powerpc/mambo/mambo_console.c +++ b/sys/powerpc/mambo/mambo_console.c @@ -25,8 +25,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include