Date: Sat, 10 Jul 2004 22:04:33 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 56999 for review Message-ID: <200407102204.i6AM4XGX043108@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=56999 Change 56999 by rwatson@rwatson_paprika on 2004/07/10 22:03:58 Integrate netperf_socket. Loop back a couple of minor soreceive() tweaks relating to locking assertions and socket buffer consistency while the socket buffer lock is released. Affected files ... .. //depot/projects/netperf_socket/sys/alpha/alpha/gdb_machdep.c#1 branch .. //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#6 integrate .. //depot/projects/netperf_socket/sys/alpha/include/gdb_machdep.h#1 branch .. //depot/projects/netperf_socket/sys/alpha/include/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/alpha/include/pcb.h#2 integrate .. //depot/projects/netperf_socket/sys/alpha/tlsb/zs_tlsb.c#6 integrate .. //depot/projects/netperf_socket/sys/amd64/amd64/gdb_machdep.c#1 branch .. //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#9 integrate .. //depot/projects/netperf_socket/sys/amd64/include/gdb_machdep.h#1 branch .. //depot/projects/netperf_socket/sys/amd64/include/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/amd64/include/pcb.h#5 integrate .. //depot/projects/netperf_socket/sys/cam/scsi/scsi_low.h#2 integrate .. //depot/projects/netperf_socket/sys/compat/linux/linux_socket.c#3 integrate .. //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#14 integrate .. //depot/projects/netperf_socket/sys/compat/svr4/svr4_stream.c#4 integrate .. //depot/projects/netperf_socket/sys/conf/files#37 integrate .. //depot/projects/netperf_socket/sys/conf/options#19 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/Osd/OsdDebug.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ct/ct.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/dcons/dcons.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/en/midway.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/led/led.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/ncv/ncr53c500.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/nsp/nsp.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ofw/ofw_console.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/sab/sab.c#9 integrate .. //depot/projects/netperf_socket/sys/dev/sound/isa/mss.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/sound/pcm/sound.h#7 integrate .. //depot/projects/netperf_socket/sys/dev/stg/tmc18c30.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/uart/uart_core.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/uart/uart_dbg.c#1 branch .. //depot/projects/netperf_socket/sys/dev/vinum/vinumhdr.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/vinum/vinuminterrupt.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/vinum/vinumioctl.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/vinum/vinummemory.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/zs/zs.c#8 integrate .. //depot/projects/netperf_socket/sys/fs/nullfs/null_subr.c#3 integrate .. //depot/projects/netperf_socket/sys/fs/nullfs/null_vfsops.c#3 integrate .. //depot/projects/netperf_socket/sys/fs/smbfs/smbfs_node.c#3 integrate .. //depot/projects/netperf_socket/sys/gdb/gdb.h#1 branch .. //depot/projects/netperf_socket/sys/gdb/gdb_int.h#1 branch .. //depot/projects/netperf_socket/sys/gdb/gdb_main.c#1 branch .. //depot/projects/netperf_socket/sys/gdb/gdb_packet.c#1 branch .. //depot/projects/netperf_socket/sys/gnu/ext2fs/ext2_subr.c#3 integrate .. //depot/projects/netperf_socket/sys/i386/i386/gdb_machdep.c#1 branch .. //depot/projects/netperf_socket/sys/i386/i386/machdep.c#8 integrate .. //depot/projects/netperf_socket/sys/i386/include/gdb_machdep.h#1 branch .. //depot/projects/netperf_socket/sys/i386/include/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/i386/include/pcb.h#3 integrate .. //depot/projects/netperf_socket/sys/i386/isa/pcvt/pcvt_hdr.h#6 integrate .. //depot/projects/netperf_socket/sys/i386/isa/pcvt/pcvt_kbd.c#3 integrate .. //depot/projects/netperf_socket/sys/ia64/ia64/gdb_machdep.c#1 branch .. //depot/projects/netperf_socket/sys/ia64/ia64/machdep.c#5 integrate .. //depot/projects/netperf_socket/sys/ia64/include/gdb_machdep.h#1 branch .. //depot/projects/netperf_socket/sys/ia64/include/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/ia64/include/pcb.h#2 integrate .. //depot/projects/netperf_socket/sys/kern/kern_clock.c#8 integrate .. //depot/projects/netperf_socket/sys/kern/kern_ktrace.c#4 integrate .. //depot/projects/netperf_socket/sys/kern/kern_malloc.c#5 integrate .. //depot/projects/netperf_socket/sys/kern/kern_mutex.c#5 integrate .. //depot/projects/netperf_socket/sys/kern/kern_shutdown.c#7 integrate .. //depot/projects/netperf_socket/sys/kern/kern_subr.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/kern_switch.c#4 integrate .. //depot/projects/netperf_socket/sys/kern/kern_synch.c#11 integrate .. //depot/projects/netperf_socket/sys/kern/link_elf.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/sched_ule.c#13 integrate .. //depot/projects/netperf_socket/sys/kern/subr_kdb.c#1 branch .. //depot/projects/netperf_socket/sys/kern/subr_prf.c#5 integrate .. //depot/projects/netperf_socket/sys/kern/subr_witness.c#7 integrate .. //depot/projects/netperf_socket/sys/kern/sys_generic.c#5 integrate .. //depot/projects/netperf_socket/sys/kern/tty_cons.c#5 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_socket.c#29 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_syscalls.c#23 integrate .. //depot/projects/netperf_socket/sys/kern/vfs_mount.c#10 integrate .. //depot/projects/netperf_socket/sys/kern/vfs_subr.c#13 integrate .. //depot/projects/netperf_socket/sys/kern/vfs_vnops.c#7 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_base.c#7 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_socket.c#4 integrate .. //depot/projects/netperf_socket/sys/pci/ncr.c#4 integrate .. //depot/projects/netperf_socket/sys/security/mac_test/mac_test.c#6 integrate .. //depot/projects/netperf_socket/sys/sparc64/include/gdb_machdep.h#1 branch .. //depot/projects/netperf_socket/sys/sparc64/include/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/sparc64/include/pcb.h#2 integrate .. //depot/projects/netperf_socket/sys/sparc64/sparc64/gdb_machdep.c#1 branch .. //depot/projects/netperf_socket/sys/sparc64/sparc64/machdep.c#3 integrate .. //depot/projects/netperf_socket/sys/sys/kdb.h#1 branch .. //depot/projects/netperf_socket/sys/sys/systm.h#6 integrate .. //depot/projects/netperf_socket/sys/sys/uio.h#5 integrate .. //depot/projects/netperf_socket/sys/ufs/ffs/ffs_softdep.c#5 integrate .. //depot/projects/netperf_socket/sys/ufs/ffs/ffs_subr.c#3 integrate Differences ... ==== //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#6 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.220 2004/06/11 11:16:17 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.221 2004/07/10 19:55:58 marcel Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -1989,6 +1989,29 @@ #endif } +/* + * Construct a PCB from a trapframe. This is called from kdb_trap() where + * we want to start a backtrace from the function that caused us to enter + * the debugger. We have the context in the trapframe, but base the trace + * on the PCB. The PCB doesn't have to be perfect, as long as it contains + * enough for a backtrace. + */ +void +makectx(struct trapframe *tf, struct pcb *pcb) +{ + + pcb->pcb_context[0] = tf->tf_regs[FRAME_S0]; + pcb->pcb_context[1] = tf->tf_regs[FRAME_S1]; + pcb->pcb_context[2] = tf->tf_regs[FRAME_S2]; + pcb->pcb_context[3] = tf->tf_regs[FRAME_S3]; + pcb->pcb_context[4] = tf->tf_regs[FRAME_S4]; + pcb->pcb_context[5] = tf->tf_regs[FRAME_S5]; + pcb->pcb_context[6] = tf->tf_regs[FRAME_S6]; + pcb->pcb_context[7] = tf->tf_regs[FRAME_PC]; + pcb->pcb_context[8] = tf->tf_regs[FRAME_PS]; + pcb->pcb_hw.apcb_ksp = tf->tf_regs[FRAME_SP]; +} + int fill_regs(td, regs) struct thread *td; ==== //depot/projects/netperf_socket/sys/alpha/include/pcb.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/pcb.h,v 1.9 2003/08/17 06:42:07 marcel Exp $ */ +/* $FreeBSD: src/sys/alpha/include/pcb.h,v 1.10 2004/07/10 19:55:58 marcel Exp $ */ /* From: NetBSD: pcb.h,v 1.6 1997/04/06 08:47:33 cgd Exp */ /* @@ -58,6 +58,7 @@ }; #ifdef _KERNEL +void makectx(struct trapframe *, struct pcb *); void savectx(struct pcb *); #endif ==== //depot/projects/netperf_socket/sys/alpha/tlsb/zs_tlsb.c#6 (text+ko) ==== @@ -31,13 +31,12 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/tlsb/zs_tlsb.c,v 1.45 2004/06/16 09:46:27 phk Exp $"); - -#include "opt_ddb.h" +__FBSDID("$FreeBSD: src/sys/alpha/tlsb/zs_tlsb.c,v 1.46 2004/07/10 20:50:19 marcel Exp $"); #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/kdb.h> #include <sys/module.h> #include <sys/bus.h> #include <sys/conf.h> @@ -497,9 +496,9 @@ while (zs_get_status(base, 0) & 1) { c = zs_get_data(base, 0); -#ifdef DDB +#ifdef KDB if (c == CTRL('\\')) - Debugger("manual escape to debugger"); + kdb_enter("manual escape to debugger"); #endif if (tp && (tp->t_state & TS_ISOPEN)) ttyld_rint(tp, c); @@ -512,9 +511,9 @@ while (zs_get_status(base, 1) & 1) { c = zs_get_data(base, 1); -#ifdef DDB +#ifdef KDB if (c == CTRL('\\')) - Debugger("manual escape to debugger"); + kdb_enter("manual escape to debugger"); #endif if (tp && (tp->t_state & TS_ISOPEN)) ttyld_rint(tp, c); ==== //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#9 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.611 2004/07/08 01:31:13 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.612 2004/07/10 19:55:58 marcel Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -1265,6 +1265,27 @@ pcpu->pc_acpi_id = 0xffffffff; } +/* + * Construct a PCB from a trapframe. This is called from kdb_trap() where + * we want to start a backtrace from the function that caused us to enter + * the debugger. We have the context in the trapframe, but base the trace + * on the PCB. The PCB doesn't have to be perfect, as long as it contains + * enough for a backtrace. + */ +void +makectx(struct trapframe *tf, struct pcb *pcb) +{ + + pcb->pcb_r12 = tf->tf_r12; + pcb->pcb_r13 = tf->tf_r13; + pcb->pcb_r14 = tf->tf_r14; + pcb->pcb_r15 = tf->tf_r15; + pcb->pcb_rbp = tf->tf_rbp; + pcb->pcb_rbx = tf->tf_rbx; + pcb->pcb_rip = tf->tf_rip; + pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; +} + int ptrace_set_pc(struct thread *td, unsigned long addr) { ==== //depot/projects/netperf_socket/sys/amd64/include/pcb.h#5 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)pcb.h 5.10 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.59 2004/05/16 22:43:57 peter Exp $ + * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.60 2004/07/10 19:55:58 marcel Exp $ */ #ifndef _AMD64_PCB_H_ @@ -78,6 +78,9 @@ }; #ifdef _KERNEL +struct trapframe; + +void makectx(struct trapframe *, struct pcb *); void savectx(struct pcb *); #endif ==== //depot/projects/netperf_socket/sys/cam/scsi/scsi_low.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/cam/scsi/scsi_low.h,v 1.6 2002/09/23 18:54:28 alfred Exp $ */ +/* $FreeBSD: src/sys/cam/scsi/scsi_low.h,v 1.7 2004/07/10 20:54:01 marcel Exp $ */ /* $NecBSD: scsi_low.h,v 1.24.10.5 2001/06/26 07:31:46 honda Exp $ */ /* $NetBSD$ */ @@ -66,6 +66,7 @@ #ifdef __FreeBSD__ #include <sys/device_port.h> +#include <sys/kdb.h> #include <cam/cam.h> #include <cam/cam_ccb.h> #include <cam/cam_sim.h> @@ -86,7 +87,7 @@ #ifdef __FreeBSD__ #undef MSG_IDENTIFY -#define SCSI_LOW_DEBUGGER(dev) Debugger((dev)) +#define SCSI_LOW_DEBUGGER(dev) kdb_enter(dev) #define SCSI_LOW_DELAY(mu) DELAY((mu)) #define SCSI_LOW_SPLSCSI splcam #define SCSI_LOW_BZERO(pt, size) bzero((pt), (size)) ==== //depot/projects/netperf_socket/sys/compat/linux/linux_socket.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.46 2004/07/08 10:18:07 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.47 2004/07/10 15:42:16 phk Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -993,35 +993,22 @@ { struct linux_sendmsg_args linux_args; struct msghdr msg; - struct iovec aiov[UIO_SMALLIOV], *iov; + struct iovec *iov; int error; - if ((error = copyin(args, &linux_args, sizeof(linux_args)))) + error = copyin(args, &linux_args, sizeof(linux_args)); + if (error) return (error); - error = copyin(linux_args.msg, &msg, sizeof(msg)); if (error) return (error); - if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { - if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) - return (EMSGSIZE); - MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, - M_WAITOK); - } else { - iov = aiov; - } - if (msg.msg_iovlen && - (error = copyin(msg.msg_iov, iov, - (unsigned)(msg.msg_iovlen * sizeof (struct iovec))))) - goto done; + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); + if (error) + return (error); msg.msg_iov = iov; msg.msg_flags = 0; - error = linux_sendit(td, linux_args.s, &msg, linux_args.flags); -done: - if (iov != aiov) - FREE(iov, M_IOV); + free(iov, M_IOV); return (error); } ==== //depot/projects/netperf_socket/sys/compat/ndis/subr_ntoskrnl.c#14 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.38 2004/06/07 01:22:48 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.39 2004/07/10 20:55:15 marcel Exp $"); #include <sys/ctype.h> #include <sys/unistd.h> @@ -44,6 +44,7 @@ #include <sys/mutex.h> #include <sys/callout.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/proc.h> #include <sys/kthread.h> @@ -1632,8 +1633,8 @@ __stdcall static void ntoskrnl_debugger(void) { - Debugger("ntoskrnl_debugger(): breakpoint"); - return; + + kdb_enter("ntoskrnl_debugger(): breakpoint"); } static void ==== //depot/projects/netperf_socket/sys/compat/svr4/svr4_stream.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.48 2004/06/17 17:16:41 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.49 2004/07/10 15:42:16 phk Exp $"); #define COMPAT_43 1 @@ -163,8 +163,7 @@ int len, error; struct socket *so; #ifdef KTRACE - struct iovec *ktriov = NULL; - struct uio ktruio; + struct uio *ktruio = NULL; #endif if ((error = fgetsock(td, s, &so, NULL)) != 0) @@ -212,13 +211,8 @@ control = 0; } #ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) { - int iovlen = auio.uio_iovcnt * sizeof (struct iovec); - - MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); - bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); - ktruio = auio; - } + if (KTRPOINT(td, KTR_GENIO)) + ktruio = cloneuio(&auio); #endif len = auio.uio_resid; error = so->so_proto->pr_usrreqs->pru_sosend(so, to, &auio, 0, control, @@ -236,13 +230,9 @@ if (error == 0) td->td_retval[0] = len - auio.uio_resid; #ifdef KTRACE - if (ktriov != NULL) { - if (error == 0) { - ktruio.uio_iov = ktriov; - ktruio.uio_resid = td->td_retval[0]; - ktrgenio(s, UIO_WRITE, &ktruio, error); - } - FREE(ktriov, M_TEMP); + if (ktruio != NULL) { + ktruio->uio_resid = td->td_retval[0]; + ktrgenio(s, UIO_WRITE, ktruio, error); } #endif bad: @@ -269,8 +259,7 @@ struct socket *so; struct sockaddr *fromsa = 0; #ifdef KTRACE - struct iovec *ktriov = NULL; - struct uio ktruio; + struct uio *ktruio = NULL; #endif if ((error = fgetsock(td, s, &so, NULL)) != 0) @@ -299,13 +288,8 @@ } } #ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) { - int iovlen = auio.uio_iovcnt * sizeof (struct iovec); - - MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); - bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen); - ktruio = auio; - } + if (KTRPOINT(td, KTR_GENIO)) + ktruio = cloneuio(&auio); #endif len = auio.uio_resid; error = so->so_proto->pr_usrreqs->pru_soreceive(so, &fromsa, &auio, @@ -317,13 +301,9 @@ error = 0; } #ifdef KTRACE - if (ktriov != NULL) { - if (error == 0) { - ktruio.uio_iov = ktriov; - ktruio.uio_resid = len - auio.uio_resid; - ktrgenio(s, UIO_READ, &ktruio, error); - } - FREE(ktriov, M_TEMP); + if (ktruio != NULL) { + ktruio->uio_resid = len - auio.uio_resid; + ktrgenio(s, UIO_READ, ktruio, error); } #endif if (error) ==== //depot/projects/netperf_socket/sys/conf/files#37 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.925 2004/07/08 22:35:34 brian Exp $ +# $FreeBSD: src/sys/conf/files,v 1.926 2004/07/10 20:35:00 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1128,6 +1128,7 @@ kern/subr_disk.c standard kern/subr_eventhandler.c standard kern/subr_hints.c standard +kern/subr_kdb.c standard kern/subr_kobj.c standard kern/subr_log.c standard kern/subr_mbpool.c optional libmbpool ==== //depot/projects/netperf_socket/sys/conf/options#19 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.462 2004/07/08 22:35:34 brian Exp $ +# $FreeBSD: src/sys/conf/options,v 1.463 2004/07/10 19:34:06 marcel Exp $ # # On the handling of kernel options # @@ -30,6 +30,15 @@ # If filename is missing, the default is # opt_<name-of-option-in-lower-case>.h +# XXX temporary +GDB +KDB opt_global.h +KDB_TRACE opt_kdb.h +KDB_UNATTENDED opt_kdb.h +WITNESS_KDB opt_witness.h +SC_DISABLE_KDBKEY opt_syscons.h + + AAC_DEBUG opt_aac.h AHC_ALLOW_MEMIO opt_aic7xxx.h AHC_TMODE_ENABLE opt_aic7xxx.h ==== //depot/projects/netperf_socket/sys/dev/acpica/Osd/OsdDebug.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/Osd/OsdDebug.c,v 1.7 2004/04/14 16:24:28 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/Osd/OsdDebug.c,v 1.8 2004/07/10 20:56:43 marcel Exp $ */ /* @@ -33,6 +33,7 @@ #include "opt_ddb.h" #include <sys/param.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/bus.h> #include <machine/bus.h> @@ -79,12 +80,12 @@ fatal = (ACPI_SIGNAL_FATAL_INFO *)Info; printf("ACPI fatal signal, type 0x%x code 0x%x argument 0x%x", fatal->Type, fatal->Code, fatal->Argument); - Debugger("AcpiOsSignal"); + kdb_enter("AcpiOsSignal"); break; case ACPI_SIGNAL_BREAKPOINT: message = (char *)Info; - Debugger(message); + kdb_enter(message); break; default: ==== //depot/projects/netperf_socket/sys/dev/ct/ct.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ /* $NecBSD: ct.c,v 1.13.12.5 2001/06/26 07:31:53 honda Exp $ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ct/ct.c,v 1.8 2004/03/13 19:46:27 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ct/ct.c,v 1.9 2004/07/10 20:57:43 marcel Exp $"); /* $NetBSD$ */ #define CT_DEBUG @@ -39,8 +39,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ddb.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -1003,10 +1001,10 @@ scsi_low_print(slp, NULL); printf("%s: scsi_status 0x%x\n\n", slp->sl_xname, (u_int) scsi_status); -#ifdef DDB +#ifdef KDB if (ct_debug > 1) SCSI_LOW_DEBUGGER("ct"); -#endif /* DDB */ +#endif /* KDB */ } #endif /* CT_DEBUG */ ==== //depot/projects/netperf_socket/sys/dev/dcons/dcons.c#7 (text+ko) ==== @@ -32,10 +32,11 @@ * SUCH DAMAGE. * * $Id: dcons.c,v 1.65 2003/10/24 03:24:55 simokawa Exp $ - * $FreeBSD: src/sys/dev/dcons/dcons.c,v 1.12 2004/06/17 17:16:43 phk Exp $ + * $FreeBSD: src/sys/dev/dcons/dcons.c,v 1.13 2004/07/10 21:02:17 marcel Exp $ */ #include <sys/param.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/systm.h> @@ -73,13 +74,8 @@ #define DCONS_FORCE_CONSOLE 0 /* mostly for FreeBSD-4 */ #endif -#ifndef DCONS_FORCE_GDB -#define DCONS_FORCE_GDB 1 -#endif - #if __FreeBSD_version >= 500101 #define CONS_NODEV 1 /* for latest current */ -static struct consdev gdbconsdev; #endif @@ -132,7 +128,6 @@ struct cdev *dev; struct dcons_ch o, i; int brk_state; -#define DC_GDB 1 int flags; } sc[DCONS_NPORT]; static void dcons_tty_start(struct tty *); @@ -373,27 +368,10 @@ ch->pos = 0; } -#if DDB && ALT_BREAK_TO_DEBUGGER - switch (dc->brk_state) { - case STATE1: - if (c == KEY_TILDE) - dc->brk_state = STATE2; - else - dc->brk_state = STATE0; - break; - case STATE2: - dc->brk_state = STATE0; - if (c == KEY_CTRLB) { -#if DCONS_FORCE_GDB - if (dc->flags & DC_GDB) - boothowto |= RB_GDB; +#if KDB && ALT_BREAK_TO_DEBUGGER + if (kdb_alt_break(c, &dc->brk_state)) + breakpoint(); #endif - breakpoint(); - } - } - if (c == KEY_CR) - dc->brk_state = STATE1; -#endif return (c); } @@ -486,20 +464,6 @@ dcons_init_port(1, offset, size - size0); dg.buf->version = htonl(DCONS_VERSION); dg.buf->magic = ntohl(DCONS_MAGIC); - -#if DDB && DCONS_FORCE_GDB -#if CONS_NODEV - gdbconsdev.cn_arg = (void *)&sc[DCONS_GDB]; -#if __FreeBSD_version >= 501109 - sprintf(gdbconsdev.cn_name, "dgdb"); -#endif - gdb_arg = &gdbconsdev; -#else - gdbdev = makedev(CDEV_MAJOR, DCONS_GDB); -#endif - gdb_getc = dcons_cngetc; - gdb_putc = dcons_cnputc; -#endif drv_init = 1; return 0; @@ -535,7 +499,6 @@ int polltime; dcons_attach_port(DCONS_CON, "dcons", 0); - dcons_attach_port(DCONS_GDB, "dgdb", DC_GDB); #if __FreeBSD_version < 500000 callout_init(&dcons_callout); #else @@ -594,18 +557,10 @@ case MOD_UNLOAD: printf("dcons: unload\n"); callout_stop(&dcons_callout); -#if DDB && DCONS_FORCE_GDB -#if CONS_NODEV - gdb_arg = NULL; -#else - gdbdev = NULL; -#endif -#endif #if __FreeBSD_version >= 500000 cnremove(&dcons_consdev); #endif dcons_detach(DCONS_CON); - dcons_detach(DCONS_GDB); dg.buf->magic = 0; contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); ==== //depot/projects/netperf_socket/sys/dev/en/midway.c#3 (text+ko) ==== @@ -33,7 +33,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/en/midway.c,v 1.61 2004/02/29 09:25:59 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/en/midway.c,v 1.62 2004/07/10 21:03:52 marcel Exp $"); /* * @@ -127,6 +127,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/kdb.h> #include <sys/queue.h> #include <sys/sockio.h> #include <sys/socket.h> @@ -2442,9 +2443,7 @@ if_printf(&sc->ifatm.ifnet, "unexpected interrupt=0x%b, " "resetting\n", reg, MID_INTBITS); #ifdef EN_DEBUG -#ifdef DDB - Debugger("en: unexpected error"); -#endif /* DDB */ + kdb_enter("en: unexpected error"); sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING; /* FREEZE! */ #else en_reset_ul(sc); ==== //depot/projects/netperf_socket/sys/dev/led/led.c#5 (text+ko) ==== @@ -9,7 +9,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/led/led.c,v 1.12 2004/06/17 17:16:44 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/led/led.c,v 1.13 2004/07/10 15:38:27 phk Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -86,8 +86,6 @@ if (uio->uio_resid > 512) return (EINVAL); s2 = s = malloc(uio->uio_resid + 1, M_DEVBUF, M_WAITOK); - if (s == NULL) - return (ENOMEM); s[uio->uio_resid] = '\0'; error = uiomove(s, uio->uio_resid, uio); if (error) { ==== //depot/projects/netperf_socket/sys/dev/ncv/ncr53c500.c#3 (text+ko) ==== @@ -37,8 +37,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ncv/ncr53c500.c,v 1.9 2004/03/13 19:46:27 peter Exp $"); -#include "opt_ddb.h" +__FBSDID("$FreeBSD: src/sys/dev/ncv/ncr53c500.c,v 1.10 2004/07/10 21:05:14 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1036,10 +1035,10 @@ scsi_low_print(slp, NULL); printf("%s st %x ist %x\n\n", slp->sl_xname, status, ireason); -#ifdef DDB +#ifdef KDB if (ncv_debug > 1) SCSI_LOW_DEBUGGER("ncv"); -#endif /* DDB */ +#endif /* KDB */ } #endif /* NCV_DEBUG */ ==== //depot/projects/netperf_socket/sys/dev/nsp/nsp.c#3 (text+ko) ==== @@ -40,8 +40,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/nsp/nsp.c,v 1.11 2004/03/13 19:46:27 peter Exp $"); -#include "opt_ddb.h" +__FBSDID("$FreeBSD: src/sys/dev/nsp/nsp.c,v 1.12 2004/07/10 21:06:08 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1534,10 +1533,10 @@ { nsp_error(sc, "current status", isrc, ph, irqphs); scsi_low_print(slp, NULL); -#ifdef DDB +#ifdef KDB if (nsp_debug > 1) SCSI_LOW_DEBUGGER("nsp"); -#endif /* DDB */ +#endif /* KDB */ } #endif /* NSP_DEBUG */ ==== //depot/projects/netperf_socket/sys/dev/ofw/ofw_console.c#8 (text+ko) ==== @@ -24,13 +24,13 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ofw/ofw_console.c,v 1.25 2004/06/24 02:57:11 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ofw/ofw_console.c,v 1.26 2004/07/10 21:07:44 marcel Exp $"); -#include "opt_ddb.h" #include "opt_comconsole.h" #include "opt_ofw.h" #include <sys/param.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/systm.h> #include <sys/types.h> @@ -64,7 +64,7 @@ static struct callout_handle ofw_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); -#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) static int alt_break_state; #endif @@ -276,9 +276,9 @@ } } -#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) - if (db_alt_break(ch, &alt_break_state)) - breakpoint(); +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) + if (kdb_alt_break(ch, &alt_break_state)) + kdb_enter("Break sequence on console"); #endif return (ch); @@ -290,9 +290,9 @@ unsigned char ch; if (OF_read(stdin, &ch, 1) > 0) { -#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) - if (db_alt_break(ch, &alt_break_state)) - breakpoint(); +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) + if (kdb_alt_break(ch, &alt_break_state)) + kdb_enter("Break sequence on console"); #endif return (ch); } ==== //depot/projects/netperf_socket/sys/dev/sab/sab.c#9 (text+ko) ==== @@ -36,13 +36,12 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/sab/sab.c,v 1.32 2004/07/01 15:19:08 mp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sab/sab.c,v 1.33 2004/07/10 21:09:47 marcel Exp $"); /* * SAB82532 Dual UART driver */ -#include "opt_ddb.h" #include "opt_comconsole.h" #include <sys/param.h> @@ -52,6 +51,7 @@ #include <sys/cons.h> #include <sys/fcntl.h> #include <sys/interrupt.h> +#include <sys/kdb.h> #include <sys/kernel.h> #include <sys/ktr.h> #include <sys/mutex.h> @@ -64,8 +64,6 @@ #include <sys/syslog.h> #include <sys/tty.h> -#include <ddb/ddb.h> - #include <dev/ofw/openfirm.h> #include <sparc64/ebus/ebusvar.h> @@ -557,9 +555,10 @@ if (len != 0) { for (i = 0; i < len; i++) { c = SAB_READ(sc, SAB_RFIFO); -#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) if (sc->sc_console != 0 && (i & 1) == 0) - brk = db_alt_break(c, &sc->sc_alt_break_state); + brk = kdb_alt_break(c, + &sc->sc_alt_break_state); #endif *sc->sc_iput++ = c; if (sc->sc_iput == sc->sc_ibuf + sizeof(sc->sc_ibuf)) @@ -606,7 +605,7 @@ if (brk != 0) breakpoint(); - + return (needsoft); } ==== //depot/projects/netperf_socket/sys/dev/sound/isa/mss.c#4 (text+ko) ==== @@ -29,7 +29,7 @@ #include <dev/sound/pcm/sound.h> -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.88 2004/04/14 14:57:48 green Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.89 2004/07/10 21:12:27 marcel Exp $"); /* board-specific include files */ #include <dev/sound/isa/mss.h> @@ -1104,7 +1104,7 @@ if (reason & 1) { DEB(printf("one more try...\n");) if (--loops) goto again; - else DDB(printf("intr, but mc11 not set\n");) + else BVDDB(printf("intr, but mc11 not set\n");) } if (loops == 0) BVDDB(printf("intr, nothing in mcir11 0x%02x\n", mc11)); mss_unlock(mss); ==== //depot/projects/netperf_socket/sys/dev/sound/pcm/sound.h#7 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.59 2004/06/16 09:46:57 phk Exp $ + * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.60 2004/07/10 21:13:28 marcel Exp $ */ /* @@ -196,7 +196,6 @@ * DDB/DEB to enable/disable debugging stuff * BVDDB to enable debugging when bootverbose */ -#define DDB(x) x /* XXX */ #define BVDDB(x) if (bootverbose) x #ifndef DEB ==== //depot/projects/netperf_socket/sys/dev/stg/tmc18c30.c#3 (text+ko) ==== @@ -39,8 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/stg/tmc18c30.c,v 1.11 2004/03/13 19:46:27 peter Exp $"); -#include "opt_ddb.h" +__FBSDID("$FreeBSD: src/sys/dev/stg/tmc18c30.c,v 1.12 2004/07/10 21:14:20 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1068,10 +1067,10 @@ scsi_low_print(slp, NULL); printf("%s: st %x ist %x\n\n", slp->sl_xname, status, astatus); -#ifdef DDB +#ifdef KDB if (stg_debug > 1) SCSI_LOW_DEBUGGER("stg"); -#endif /* DDB */ +#endif /* KDB */ } #endif /* STG_DEBUG */ ==== //depot/projects/netperf_socket/sys/dev/uart/uart_core.c#4 (text+ko) ==== @@ -25,11 +25,10 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.9 2004/05/04 05:54:02 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.10 2004/07/10 21:16:01 marcel Exp $"); #ifndef KLD_MODULE #include "opt_comconsole.h" -#include "opt_ddb.h" #endif #include <sys/param.h> >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407102204.i6AM4XGX043108>