Commit Graph

48099 Commits

Author SHA1 Message Date
davidxu
0a29616acf Add ptrace_clear_single_step(), alpha already has it for years, the function
will be used by ptrace to clear a thread's single step state.
2004-07-13 07:22:56 +00:00
davidxu
1920ad199e Add code to support debugging threaded process.
1. Add tm_lwpid into kse_thr_mailbox to indicate which kernel
   thread current user thread is running on. Add tm_dflags into
   kse_thr_mailbox, the flags is written by debugger, it tells
   UTS and kernel what should be done when the process is being
   debugged, current, there two flags TMDF_SSTEP and TMDF_DONOTRUNUSER.

   TMDF_SSTEP is used to tell kernel to turn on single stepping,
   or turn off if it is not set.

   TMDF_DONOTRUNUSER is used to tell kernel to schedule upcall
   whenever possible, to UTS, it means do not run the user thread
   until debugger clears it, this behaviour is necessary because
   gdb wants to resume only one thread when the thread's pc is
   at a breakpoint, and thread needs to go forward, in order to
   avoid other threads sneak pass the breakpoints, it needs to remove
   breakpoint, only wants one thread to go. Also, add km_lwp to
   kse_mailbox, the lwp id is copied to kse_thr_mailbox at context
   switch time when process is not being debugged, so when process
   is attached, debugger can map kernel thread to user thread.

2. Add p_xthread to proc strcuture and td_xsig to thread structure.
   p_xthread is used by a thread when it wants to report event
   to debugger, every thread can set the pointer, especially, when
   it is used in ptracestop, it is the last thread reporting event
   will win the race. Every thread has a td_xsig to exchange signal
   with debugger, thread uses TDF_XSIG flag to indicate it is reporting
   signal to debugger, if the flag is not cleared, thread will keep
   retrying until it is cleared by debugger, p_xthread may be
   used by debugger to indicate CURRENT thread. The p_xstat is still
   in proc structure to keep wait() to work, in future, we may
   just use td_xsig.

3. Add TDF_DBSUSPEND flag, the flag is used by debugger to suspend
   a thread. When process stops, debugger can set the flag for
   thread, thread will check the flag in thread_suspend_check,
   enters a loop, unless it is cleared by debugger, process is
   detached or process is existing. The flag is also checked in
   ptracestop, so debugger can temporarily suspend a thread even
   if the thread wants to exchange signal.

4. Current, in ptrace, we always resume all threads, but if a thread
   has already a TDF_DBSUSPEND flag set by debugger, it won't run.

Encouraged by: marcel, julian, deischen
2004-07-13 07:20:10 +00:00
alfred
51b3793545 Do not call sorecieve() in the context of a socket callback as it causes
lock order reversals so->inpcb since we're called with the socket lock
held.
2004-07-13 07:05:38 +00:00
alc
ea85f85ed9 Simplify pmap_protect(). 2004-07-13 06:54:23 +00:00
alfred
b4f778e20c Turn off SO_REUSEADDR and SO_REUSEPORT, they were causing EADDRINUSE
to be returned from the protocol stack.

Pointy hat to me for not groking what those options _really_ mean.
2004-07-13 05:42:59 +00:00
alc
ea94acfaa6 Push down the acquisition and release of the page queues lock into
pmap_remove_pages().  (The implementation of pmap_remove_pages() is
optional.  If pmap_remove_pages() is unimplemented, the acquisition and
release of the page queues lock is unnecessary.)

Remove spl calls from the alpha, arm, and ia64 pmap_remove_pages().
2004-07-13 02:49:22 +00:00
imp
d35148311b Set fdc_dev in attach 2004-07-13 02:44:40 +00:00
imp
02b4d8a438 Don't depend on implicit include of machine/bus.h in sys/rman.h, but instead
explicitly include it.
2004-07-13 02:42:23 +00:00
imp
420555b333 pccard no longer requires a count because the floppy driver that
nominally had a non-working reference to card.h has been removed.
2004-07-13 02:37:40 +00:00
imp
bdcd057a4e Remove even more references to generating usbdevs_data.h, et al.
Noticed by: njl
2004-07-12 23:11:09 +00:00
imp
3c84bfe26f Remove the instructions for regenerating usbdevs.h: that's now no
longer necessary.
2004-07-12 22:57:06 +00:00
grehan
60a55c7a06 Rename low-level code ddb -> db. Use KDB instead of DDB.
Fix bug in setup of stack frame where 8 bytes wasn't being
saved for the callee's frame pointer and saved LR.
2004-07-12 22:32:08 +00:00
grehan
94e8bc7955 Bring into KDB new order. 2004-07-12 22:26:20 +00:00
grehan
f05f1634a3 - DDB -> KDB, with kdb routines
- ddb -> db for low-level trapcode
- implement makectx. I think it only matters that the stack is setup
  correctly.
- bring over ddb_trap_glue and rename to db_trap_glue
2004-07-12 22:25:09 +00:00
grehan
a33f31931d No need for ddb option. Never a need for ipkdb option. 2004-07-12 22:22:53 +00:00
grehan
4505b37f92 Catch up with gratuitous ddb -> db renaming 2004-07-12 22:22:09 +00:00
grehan
7ab8fbe2ac Bring into line with KDB. Bring in NetBSD updates for backtrace routine,
although it really needs a decent re-work.
2004-07-12 22:21:34 +00:00
grehan
2312a73897 Remove unused NetBSD code. Bring mem r/w routines into here in line
with sparc64, although keep the size deref checks: they are useful
when accessing PCI space where some devices may not implement byte
access.
2004-07-12 22:20:01 +00:00
grehan
a73dd12638 Gratuitous namechange to avoid low-level association with ddb. 2004-07-12 22:18:02 +00:00
grehan
9006058072 Add prototype for KDB's makectx routine 2004-07-12 22:17:20 +00:00
grehan
e272511bfa Remove old NetBSD-derived unused code and stuff that is now obsolete
due to KDB.
2004-07-12 22:16:50 +00:00
grehan
a9b5e762ae DDB -> KDB, and rename low-level trap handler to avoid name conflict. 2004-07-12 22:16:04 +00:00
grehan
e0f0e7381e kdb.h for PowerPC. Stubs for now. 2004-07-12 22:15:03 +00:00
grehan
a0724f3f5a Add new KDB option, and also drop in long-held fxp/dc eth drivers. 2004-07-12 22:14:21 +00:00
grehan
8d3be5dece db_memrw.c has been subsumed into db_interface.c ala sparc64 2004-07-12 22:13:27 +00:00
imp
72524b7544 Remove stray line with just a tab
Remove usbdevs_data.h, it isn't used by the module

Noticed by: Pawel Worach
2004-07-12 21:59:06 +00:00
dwmalone
6ff1185c1d Rename Alfred's kern_setsockopt to so_setsockopt, as this seems a
a better name. I have a kern_[sg]etsockopt which I plan to commit
shortly, but the arguments to these function will be quite different
from so_setsockopt.

Approved by:	alfred
2004-07-12 21:42:33 +00:00
cognet
1176e2e3a5 Update to kdb. 2004-07-12 21:25:01 +00:00
cognet
7563f4f40c Remove the kbd_trap() declaration. 2004-07-12 21:24:21 +00:00
cognet
a5d0266aaa Protect setjmp.h with #ifndef _MACHINE_SETJMP_H_. 2004-07-12 21:23:58 +00:00
cognet
3884d9a863 Forward declare "struct pcb", so that one does not need to include
<machine/pcb.h> before including <machine/pmap.h>.
2004-07-12 21:22:40 +00:00
cognet
b0940860cf Implement a stub breakpoint(). 2004-07-12 21:20:38 +00:00
cognet
5c9c269caa Implement makectx(). 2004-07-12 21:19:43 +00:00
cognet
017c5d391c Prototype makectx(). 2004-07-12 21:19:22 +00:00
cognet
668e7d838d Import bus_memio.h and bus_pio.h for arm. 2004-07-12 21:18:30 +00:00
cognet
5eba49c6e6 Import a kdb.h for arm, which contains stubs right now. 2004-07-12 21:17:51 +00:00
njl
7c75fe7d97 Remove unnecessary softc bzero calls. 2004-07-12 21:15:36 +00:00
njl
462b2a5e44 Add the ability to detach a battery. Now batteries that are detached are
also removed from the battery list.
2004-07-12 20:53:04 +00:00
njl
7b5fb1c0fe Update in preparation for adding the ACPI attachment.
* Add an fdtype ivar.  This will be the equivalent of fd->type.
* Move enabling the FIFO to the end of attach.
* Unify reset code into fdc_initial_reset().
* Add fdc_write_ivar().
* Update isa and pccard attachments accordingly.
* Set the flags unconditionally in probe since they may be overridden by
  other probe routines.  Both before and now, we're depending on probe
  being called a final time on the winning driver so the flags we get are
  the ones we intended.
* Use the bus accessor macros instead of defining our own.
* Remove duplicate assigns of fd->type.
2004-07-12 20:49:26 +00:00
rwatson
f1f1364540 Constify 'rpcclnt_backoff'. 2004-07-12 19:37:08 +00:00
rwatson
a5ff7bc1e6 Constify 'spx_backoff'. 2004-07-12 19:35:29 +00:00
rwatson
9d5e898163 After each label in tcp_input(), assert the inpcbinfo and inpcb lock
state that we expect.
2004-07-12 19:28:07 +00:00
rwatson
9183ed533a Procotol control block locking for netatalk DDP. 2004-07-12 18:39:59 +00:00
rwatson
d0f3949724 Imperfect synchronization solution to imperfect code: use a static 256
byte buffer in the stack for temporary printf results rather than a
global buffer without synchronization.
2004-07-12 18:37:31 +00:00
rwatson
de62cbb6dd Remove 'Not used' comment: at_org_code is used, just not in netatalk/. 2004-07-12 18:35:30 +00:00
alc
f591650a79 Remove an unused and unimplemented sysctl. (For the record, it was marked
as unimplemented in revision 1.129 nearly six years ago.)
2004-07-12 17:45:37 +00:00
mtm
8e8f80bd23 writers must hold both sched_lock and the process lock; therefore, readers
need only obtain the process lock.
2004-07-12 15:28:31 +00:00
rwatson
2fbca9279f Remove 'td = curthread' that shadows the arguments to coda_root().
Missed by:	alfred
2004-07-12 14:11:26 +00:00
dfr
cd0778386d Add fwip module. 2004-07-12 13:13:17 +00:00
dfr
6c40a2c3b2 Add fwip module.
Submitted by: simokawa
2004-07-12 13:12:56 +00:00