diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2002-06-18 21:30:37 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2002-06-18 21:30:37 +0000 |
commit | 90312e83bd816303d467436dbe2b0519108834f2 (patch) | |
tree | e59c17b9c6f153be7cb57be48355a858e1eee1e9 /sys | |
parent | 881107f895a1cc002a567fb92db4d4e972734a43 (diff) | |
download | FreeBSD-src-90312e83bd816303d467436dbe2b0519108834f2.zip FreeBSD-src-90312e83bd816303d467436dbe2b0519108834f2.tar.gz |
Make the speed used by gdb over serial settable in the kernel configuration.
This facilitates the use in circumstances where you are using a serial
console as well. GDB doesn't support anything higher than 9600 baud (19k2
if you are lucky), but the console does.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/options | 2 | ||||
-rw-r--r-- | sys/conf/options.i386 | 1 | ||||
-rw-r--r-- | sys/conf/options.ia64 | 2 | ||||
-rw-r--r-- | sys/conf/options.pc98 | 1 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 70 | ||||
-rw-r--r-- | sys/dev/sio/sioreg.h | 5 | ||||
-rw-r--r-- | sys/pc98/cbus/sio.c | 41 | ||||
-rw-r--r-- | sys/pc98/pc98/sio.c | 41 |
8 files changed, 108 insertions, 55 deletions
diff --git a/sys/conf/options b/sys/conf/options index ead5091..39258a0 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -69,10 +69,12 @@ COMPAT_43 opt_compat.h COMPAT_SUNOS opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR +CONSPEED opt_comconsole.h DDB DDB_NOKLDSYM opt_ddb.h DDB_UNATTENDED opt_ddb.h GDB_REMOTE_CHAT opt_ddb.h +GDBSPEED opt_ddb.h NODEVFS opt_devfs.h HW_WDOG KTRACE diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 42f07d2..9f0d22d 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -14,7 +14,6 @@ PERFMON opt_perfmon.h POWERFAIL_NMI opt_trap.h AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h -CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h diff --git a/sys/conf/options.ia64 b/sys/conf/options.ia64 index 2679d9b..ed3650f 100644 --- a/sys/conf/options.ia64 +++ b/sys/conf/options.ia64 @@ -15,8 +15,6 @@ PPC_DEBUG opt_ppc.h SHOW_BUSYBUFS PANIC_REBOOT_WAIT_TIME opt_panic.h -CONSPEED opt_comconsole.h - MAXCONS opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index 861d939..49325cb 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -14,7 +14,6 @@ PERFMON opt_perfmon.h POWERFAIL_NMI opt_trap.h AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h -CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 64205370..085fdb8 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -332,14 +332,12 @@ int comconsole = -1; static volatile speed_t comdefaultrate = CONSPEED; static u_long comdefaultrclk = DEFAULT_RCLK; SYSCTL_ULONG(_machdep, OID_AUTO, conrclk, CTLFLAG_RW, &comdefaultrclk, 0, ""); -#ifdef __alpha__ -static volatile speed_t gdbdefaultrate = CONSPEED; -#endif +static speed_t gdbdefaultrate = GDBSPEED; +SYSCTL_UINT(_machdep, OID_AUTO, gdbspeed, CTLFLAG_RW, + &gdbdefaultrate, GDBSPEED, ""); static u_int com_events; /* input chars + weighted output completions */ static Port_t siocniobase; -#ifndef __alpha__ -static int siocnunit; -#endif +static int siocnunit = -1; static Port_t siogdbiobase; static int siogdbunit = -1; static void *sio_slow_ih; @@ -3126,13 +3124,17 @@ siocncheckc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); if (inb(iobase + com_lsr) & LSR_RXRDY) c = inb(iobase + com_data); else @@ -3151,13 +3153,17 @@ siocngetc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); while (!(inb(iobase + com_lsr) & LSR_RXRDY)) ; c = inb(iobase + com_data); @@ -3175,18 +3181,22 @@ siocnputc(dev, c) int s; struct siocnstate sp; Port_t iobase; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); need_unlock = 0; if (sio_inited == 2 && !mtx_owned(&sio_lock)) { mtx_lock_spin(&sio_lock); need_unlock = 1; } - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); @@ -3201,12 +3211,20 @@ siogdbgetc() { int c; Port_t iobase; + speed_t speed; int s; struct siocnstate sp; - iobase = siogdbiobase; + if (minor(dev) == siocnunit) { + iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } + s = spltty(); - siocnopen(&sp, iobase, gdbdefaultrate); + siocnopen(&sp, iobase, speed); while (!(inb(iobase + com_lsr) & LSR_RXRDY)) ; c = inb(iobase + com_data); @@ -3219,11 +3237,21 @@ void siogdbputc(c) int c; { + Port_t iobase; + speed_t speed; int s; struct siocnstate sp; + if (minor(dev) == siocnunit) { + iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } + s = spltty(); - siocnopen(&sp, siogdbiobase, gdbdefaultrate); + siocnopen(&sp, iobase, speed); siocntxwait(siogdbiobase); outb(siogdbiobase + com_data, c); siocnclose(&sp, siogdbiobase); diff --git a/sys/dev/sio/sioreg.h b/sys/dev/sio/sioreg.h index 072aa0f..e0ba5ad 100644 --- a/sys/dev/sio/sioreg.h +++ b/sys/dev/sio/sioreg.h @@ -123,4 +123,9 @@ #define CONSPEED 9600 #endif +/* default serial gdb speed if not set with sysctl or probed from boot */ +#ifndef GDBSPEED +#define GDBSPEED CONSPEED +#endif + #define IO_COMSIZE 8 /* 8250, 16x50 com controllers */ diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 7ff3816..85b073c 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -430,9 +430,9 @@ int comconsole = -1; static volatile speed_t comdefaultrate = CONSPEED; static u_long comdefaultrclk = DEFAULT_RCLK; SYSCTL_ULONG(_machdep, OID_AUTO, conrclk, CTLFLAG_RW, &comdefaultrclk, 0, ""); -#ifdef __alpha__ -static volatile speed_t gdbdefaultrate = CONSPEED; -#endif +static speed_t gdbdefaultrate = GDBSPEED; +SYSCTL_UINT(_machdep, OID_AUTO, gdbspeed, CTLFLAG_RW, + &gdbdefaultrate, GDBSPEED, ""); static u_int com_events; /* input chars + weighted output completions */ static Port_t siocniobase; #ifndef __alpha__ @@ -4359,13 +4359,17 @@ siocncheckc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); if (inb(iobase + com_lsr) & LSR_RXRDY) c = inb(iobase + com_data); else @@ -4384,13 +4388,17 @@ siocngetc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); while (!(inb(iobase + com_lsr) & LSR_RXRDY)) ; c = inb(iobase + com_data); @@ -4409,17 +4417,20 @@ siocnputc(dev, c) struct siocnstate sp; Port_t iobase; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); need_unlock = 0; if (sio_inited == 2 && !mtx_owned(&sio_lock)) { mtx_lock_spin(&sio_lock); need_unlock = 1; } - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index 7ff3816..85b073c 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -430,9 +430,9 @@ int comconsole = -1; static volatile speed_t comdefaultrate = CONSPEED; static u_long comdefaultrclk = DEFAULT_RCLK; SYSCTL_ULONG(_machdep, OID_AUTO, conrclk, CTLFLAG_RW, &comdefaultrclk, 0, ""); -#ifdef __alpha__ -static volatile speed_t gdbdefaultrate = CONSPEED; -#endif +static speed_t gdbdefaultrate = GDBSPEED; +SYSCTL_UINT(_machdep, OID_AUTO, gdbspeed, CTLFLAG_RW, + &gdbdefaultrate, GDBSPEED, ""); static u_int com_events; /* input chars + weighted output completions */ static Port_t siocniobase; #ifndef __alpha__ @@ -4359,13 +4359,17 @@ siocncheckc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); if (inb(iobase + com_lsr) & LSR_RXRDY) c = inb(iobase + com_data); else @@ -4384,13 +4388,17 @@ siocngetc(dev) Port_t iobase; int s; struct siocnstate sp; + speed_t speed; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); while (!(inb(iobase + com_lsr) & LSR_RXRDY)) ; c = inb(iobase + com_data); @@ -4409,17 +4417,20 @@ siocnputc(dev, c) struct siocnstate sp; Port_t iobase; - if (minor(dev) == siogdbunit) - iobase = siogdbiobase; - else + if (minor(dev) == siocnunit) { iobase = siocniobase; + speed = comdefaultrate; + } else { + iobase = siogdbiobase; + speed = gdbdefaultrate; + } s = spltty(); need_unlock = 0; if (sio_inited == 2 && !mtx_owned(&sio_lock)) { mtx_lock_spin(&sio_lock); need_unlock = 1; } - siocnopen(&sp, iobase, comdefaultrate); + siocnopen(&sp, iobase, speed); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); |