Commit Graph

47907 Commits

Author SHA1 Message Date
Marcel Moolenaar
f33ca0c961 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
o  Change comments accordingly.
2004-07-10 21:45:58 +00:00
Robert Watson
7e17bc9f26 When the MT_SONAME mbuf is popped off of a receive socket buffer
associated with a PR_ADDR protocol, make sure to update the m_nextpkt
pointer of the new head mbuf on the chain to point to the next record.
Otherwise, when we release the socket buffer mutex, the socket buffer
mbuf chain may be in an inconsistent state.
2004-07-10 21:43:35 +00:00
Marcel Moolenaar
82ebaee7a3 Update for the KDB framework:
o  Check kdb_active instead of db_active and do so unconditionally.
2004-07-10 21:43:23 +00:00
Marcel Moolenaar
eba21ad501 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  s/WITNESS_DDB/WITNESS_KDB/g
o  s/witness_ddb/witness_kdb/g
o  Rename the debug.witness_ddb sysctl to debug.witness_kdb.
o  Call kdb_backtrace() instead of backtrace().
o  Call kdb_enter() instead Debugger().
o  Assert kdb_active instead of db_active.
2004-07-10 21:42:16 +00:00
Marcel Moolenaar
2c3490b1a8 Update for the KDB framework:
o  Call kdb_backtrace() instead of backtrace().
2004-07-10 21:38:22 +00:00
Marcel Moolenaar
ecb01c64d2 Make the GDB dynamic linker hooks (r_debug_state) conditional upon
GDB instead of DDB.
2004-07-10 21:37:30 +00:00
Marcel Moolenaar
2d50560abc Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_enter() instead of Debugger().
o  Call kdb_backtrace() instead of db_print_backtrace() or backtrace().

kern_mutex.c:
o  Replace checks for db_active with checks for kdb_active and make
   them unconditional.

kern_shutdown.c:
o  s/DDB_UNATTENDED/KDB_UNATTENDED/g
o  s/DDB_TRACE/KDB_TRACE/g
o  Save the TID of the thread doing the kernel dump so the debugger
   knows which thread to select as the current when debugging the
   kernel core file.
o  Clear kdb_active instead of db_active and do so unconditionally.
o  Remove backtrace() implementation.

kern_synch.c:
o  Call kdb_reenter() instead of db_error().
2004-07-10 21:36:01 +00:00
Marcel Moolenaar
89cf7c254d Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_enter() instead of Debugger().
o  Remove local (static) variable in_debugger. Use kdb_active instead.
2004-07-10 21:24:36 +00:00
Marcel Moolenaar
6d408d58d0 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:21:55 +00:00
Marcel Moolenaar
e2fb7a7be0 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 21:21:13 +00:00
Marcel Moolenaar
4ea4f1f97e Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:20:11 +00:00
Marcel Moolenaar
5ff374a09a Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() insteadof db_alt_break().
2004-07-10 21:18:33 +00:00
Marcel Moolenaar
591bc192b3 Update for the KDB framework:
o  Call kdb_enter() instead of breakpoint().
o  Call kdb_alt_break() instead of db_alt_break().
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:16:01 +00:00
Marcel Moolenaar
2110bd83fd Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:14:20 +00:00
Marcel Moolenaar
b8c48216b1 Remove DDB. The one user of this macro has been changed to use BVDDB.
Yes, DDB is unrelated to the debugger with the same acronym. Hence,
the change.
2004-07-10 21:13:28 +00:00
Marcel Moolenaar
23decc8a2f s/DDB/BVDDB/g
Note that DDB is unrelated to the debugger with the same acronym.
2004-07-10 21:12:27 +00:00
Marcel Moolenaar
d86bfb99a7 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
2004-07-10 21:09:47 +00:00
Marcel Moolenaar
8cabb94fde Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
o  Call kdb_enter() instead of breakpoint().
2004-07-10 21:07:44 +00:00
Marcel Moolenaar
d89b8fc48a Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:06:08 +00:00
Marcel Moolenaar
3e1e192231 Update for the KDB framework:
o  Make debugging code dependent upon KDB instead of DDB.
2004-07-10 21:05:14 +00:00
Marcel Moolenaar
c6ca21fb13 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
o  Don't make such calls conditional upon KDB instead of DDB because
   they're already conditional upon EN_DEBUG.
2004-07-10 21:03:52 +00:00
Marcel Moolenaar
ed9c21cd74 Update for the KDB framework:
o  Use kdb_alt_break() to handle the alternate break sequence instead
   of handcoding it here.
o  Remove GDB kluges to make this driver work with the pre-KDB remote
   GDB code.
o  Call kdb_enter() instead of Debugger().

Note that with this commit the dcons(4) driver cannot be used for
remote debugging anymore. This driver has to use the new GDB debug
port interface instead. Such has not been done yet.
2004-07-10 21:02:17 +00:00
Marcel Moolenaar
a0eb4d1051 Update for the KDB framework:
o  Remove inclusion of opt_ddb.h
o  Make debugging code conditional upon KDB.
2004-07-10 20:57:43 +00:00
Marcel Moolenaar
124ea6b5ac Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 20:56:43 +00:00
Marcel Moolenaar
bc1c6224b7 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().

While here, remove a redundant return.
2004-07-10 20:55:15 +00:00
Marcel Moolenaar
65eceb95f8 Update for the KDB framework:
o  Remove inclusion of opt_ddb.h.
o  Call kdb_enter() instead of Debugger().
o  Make debugging code conditional upon KDB.
2004-07-10 20:50:19 +00:00
Marcel Moolenaar
f65de26bf6 Update for the KDB debugger framework:
o  Make debugging code conditional upon KDB.
o  Use kdb_backtrace() instead of backtrace().
o  Remove inclusion of opt_ddb.h.
2004-07-10 20:45:47 +00:00
Marcel Moolenaar
f77971009d Hook the KDB frontend into the build. 2004-07-10 20:35:00 +00:00
Marcel Moolenaar
5a39cbaf69 Implement makectx(). The makectx() function is used by KDB to create
a PCB from a trapframe for purposes of unwinding the stack. The PCB
is used as the thread context and all but the thread that entered the
debugger has a valid PCB.
This function can also be used to create a context for the threads
running on the CPUs that have been stopped when the debugger got
entered. This however is not done at the time of this commit.
2004-07-10 19:56:00 +00:00
Marcel Moolenaar
0aefe3632e Add new options for the KDB framework. This commit merely adds them and
in particular not without removing the options they replace or in the
proper location in this file. The purpose of this commit is to make it
possible to commit changes in parts without causing massive build
breakages. At least, that's the intend. I have no idea if it actually
works out as I hope...
2004-07-10 19:34:06 +00:00
Marcel Moolenaar
cbc174356c Introduce the KDB debugger frontend. The frontend provides a framework
in which multiple (presumably different) debugger backends can be
configured and which provides basic services to those backends.
Besides providing services to backends, it also serves as the single
point of contact for any and all code that wants to make use of the
debugger functions, such as entering the debugger or handling of the
alternate break sequence. For this purpose, the frontend has been
made non-optional.
All debugger requests are forwarded or handed over to the current
backend, if applicable. Selection of the current backend is done by
the debug.kdb.current sysctl. A list of configured backends can be
obtained with the debug.kdb.available sysctl. One can enter the
debugger by writing to the debug.kdb.enter sysctl.
2004-07-10 18:40:12 +00:00
Marcel Moolenaar
89438367ae Add support for uart(4) being a debug port for the GDB backend. 2004-07-10 18:08:38 +00:00
Marcel Moolenaar
72d44f31a6 Introduce the GDB debugger backend for the new KDB framework. The
backend improves over the old GDB support in the following ways:
o  Unified implementation with minimal MD code.
o  A simple interface for devices to register themselves as debug
   ports, ala consoles.
o  Compression by using run-length encoding.
o  Implements GDB threading support.
2004-07-10 17:47:22 +00:00
Poul-Henning Kamp
552afd9c12 Clean up and wash struct iovec and struct uio handling.
Add copyiniov() which copies a struct iovec array in from userland into
a malloc'ed struct iovec.  Caller frees.

Change uiofromiov() to malloc the uio (caller frees) and name it
copyinuio() which is more appropriate.

Add cloneuio() which returns a malloc'ed copy.  Caller frees.

Use them throughout.
2004-07-10 15:42:16 +00:00
Poul-Henning Kamp
72118ea9fd Remove a pointless check. 2004-07-10 15:38:27 +00:00
Robert Watson
5c2b7a2273 Now socket buffer locks are being asserted at higher code blocks in
soreceive(), remove some leaf assertions that are redundant.
2004-07-10 04:38:06 +00:00
Robert Watson
32775a01da Assert socket buffer lock at strategic points between sections of code
in soreceive() to confirm we've moved from block to block properly
maintaining locking invariants.
2004-07-10 03:47:15 +00:00
Marius Strobl
64e6e863ac - Add missing <sys/module.h>. [1]
- Remove unused includes.
- Sort includes.

Reported by:	Pyun YongHyeon <yongari@kt-is.co.kr> [1]
2004-07-09 23:12:22 +00:00
John Baldwin
776b99ee1a Check the lock lists to see if they are empty directly rather than
assigning a pointer to the list and then dereferencing the pointer as a
second step.  When the first spin lock is acquired, curthread is not in
a critical section so it may be preempted and would end up using another
CPUs lock list instead of its own.

When this code was in witness_lock() this sequence was safe as curthread
was in a critical section already since witness_lock() is called after the
lock is acquired.

Tested by:	Daniel Lang dl at leo.org
2004-07-09 17:46:27 +00:00
Maksim Yevmenkin
6421d1dbcb Bump __FreeBSD_version
Reviewed by:	kris, ru
2004-07-09 16:57:24 +00:00
Olivier Houchard
0f2f1f7124 Do not bzero() the softc, as newbus does it for us. 2004-07-09 16:56:46 +00:00
Pawel Jakub Dawidek
4c55f05b89 Implement "FAST" mode for GEOM_STRIPE class and turn it on by default.
In this mode you can setup even very small stripe size and you can be
sure that only one I/O request will be send to every disks in stripe.
It consumes some more memory, but if allocation fails, it will fall
back to "ECONOMIC" mode.

It is about 10 times faster for small stripe size than "ECONOMIC" mode
and other RAID0 implementations. It is even recommended to use this
mode and small stripe size, so our requests are always splitted.

One can still use "ECONOMIC" mode by setting kern.geom.stripe.fast to 0.
It is also possible to setup maximum memory which "FAST" mode can consume,
by setting kern.geom.stripe.maxmem from /boot/loader.conf.
2004-07-09 14:30:09 +00:00
Poul-Henning Kamp
539bec4042 Only detach consumers which are attached when we wither stuff away.
Pointed out by:	pjd
2004-07-09 14:06:17 +00:00
Olivier Houchard
c8b9c2d913 Newbus returns a zeroed softc, so there's no need to call bzero() here. 2004-07-09 13:42:05 +00:00
Dag-Erling Smørgrav
195a6b21e4 Accumulate directory entries in a fixed-length sbuf, and uiomove them in
one go before returning.  This avoids calling uiomove() while holding
allproc_lock.

Don't adjust uio->uio_offset manually, uiomove() does that for us.

Don't drop allproc_lock before calling panic().

Suggested by:	alfred
2004-07-09 11:43:37 +00:00
Dag-Erling Smørgrav
520df27692 Cosmetic adjustment to previous commit: name the second argument to
sbuf_bcat() and sbuf_bcpy() "buf" rather than "data".
2004-07-09 11:37:44 +00:00
Dag-Erling Smørgrav
d751f0a935 Have sbuf_bcat() and sbuf_bcpy() take a const void * instead of a
const char *, since callers are likely to pass in pointers to all
kinds of structs and whatnot.
2004-07-09 11:35:30 +00:00
Peter Grehan
077a0fb8b6 - correctly set the return value for the copyin/out fault buffer to 1
so setfault would return correctly when a page fault was invalid
  (e.g. a syscall with a bad parameter).

  This caused an endless DSI loop, seen when running sendmail which
  does a setlogin() call with a NULL pointer.

- introduce KTR_SYSC tracing. expose the syscallnames[] array to
  make the tracing more readable.
2004-07-09 11:00:41 +00:00
Alan Cox
0049f8b27b Eliminate struct shm_handle. It is an unnecessary level of indirection to
a vm_object.
2004-07-09 05:28:38 +00:00
Bruce M Simpson
086e98c437 Use ETHER_IS_MULTICAST() consistently in ether_resolvemulti().
Reviewed by:	jmallett
2004-07-09 05:26:27 +00:00