Commit Graph

48070 Commits

Author SHA1 Message Date
Nate Lawson
6f41379967 Add a comment separator. 2004-07-14 22:09:32 +00:00
Robert Watson
6f7d64c44a Add a note indicating that the eh_prototype field used to construct
ethernet headers is unsynchronized.
2004-07-14 20:31:37 +00:00
Robert Watson
c61340f374 Add a mutex ng_tty_mtx to protect the global variable ngt_unit. Note
that the locking of globals here isn't complete, and there's also a
locking issue relating to calling into and out of the tty code.
2004-07-14 20:31:05 +00:00
Robert Watson
489264ddae Add ng_ppp_latencies_mtx, a global mutex to protect the latency list.
Note that the table is a hack, and so is this mutex.

Reviewed by:	glebius
2004-07-14 20:29:54 +00:00
Robert Watson
544fc3d562 Introduce a new mutex, ng_fec_mtx, to protect the global unit list to
synchronization allocation of FEC unit numbers.

Reviewed by:	glebius
2004-07-14 20:27:33 +00:00
Robert Watson
dffa5be1a4 Introduce a new mutex, ng_eiface_mtx, to protect the global unit list
lock used to synchronize allocation of unit numbers for new netgraph
ethernet interfaces.

Reviewed by:	glebius
2004-07-14 20:26:29 +00:00
Robert Watson
9a668fa4d8 Introduce a new mutex, ng_iface_mtx, to protect the global unit list
lock used to synchronize allocation of unit numbers for new netgraph
interfaces.

Reviewed by:	glebius
Tested by:	glebius
2004-07-14 20:24:21 +00:00
Mark Santcroos
9b7b2aeff6 Some laptops report the "design-capacity" instead of the "real-capacity"
when the battery is fully charged. That breaks some of the arithmetic in
calculating the remaining capacity (ends up with more than 100%).
This commit makes sure the max is 100.

Approved by:	njl
2004-07-14 19:31:31 +00:00
Christian S.J. Peron
ed6c545cf0 In addition to the real user ID check, do an explicit jail
check to ensure that the caller is not prison root.

The intention is to fix file descriptor creation so that
prison root can not use the last remaining file descriptors.
This privilege should be reserved for non-jailed root users.

Approved by:	bmilekic (mentor)
2004-07-14 19:04:31 +00:00
John Baldwin
0c9cb34441 Correct bounds check in lapic_create().
Submitted by:	"Ted Unangst" tedu at coverity.com
2004-07-14 18:12:15 +00:00
Dag-Erling Smørgrav
09a23520c0 Unbreak LINT: device card no longer takes a count. 2004-07-14 17:50:08 +00:00
Poul-Henning Kamp
d8d3d4158b Make sure to update the mnt_stats before UFS1 extattr tried to
do I/O on the device.  Otherwise the blocksize is undefined in the
buffer cache.
2004-07-14 14:19:32 +00:00
Max Laier
bfe4641596 Fix a copy-and-paste-o in IFQ_DRV_PREPEND - all pointyhats to me.
While here also fix a (not less stupid) braino in IFQ_DRV_PURGE.

Reported-by:	clement
Tested-by:	clement (_PREPEND in sis(4))
2004-07-14 13:31:41 +00:00
Peter Wemm
6897c4aef7 Like on i386, eliminate pv_ptem (which was suggested by alc). This
reduces the size of the pv_entry structure a small but significant amount.

This is implemented a little differently because it isn't so cheap to get
the physical address of the page tabke page on amd64.. instead of it
being directly accessible from the top level page directory, it is now
two additional tree levels down.  However.. In almost all cases, we
recently had the physical address if the page table page a short while
before we needed it, but it slipped through our fingers.  This patch
saves it for when we do need it.  Also, for the one case where we do not
have the ptp paddr, we are always running in curproc context and so we
can do a vtopte-like trick.  I've implemented vtopde() for this purpose.

There is still a CYA entry in pmap_unuse_pt() that needs to be removed.  I
think it can be removed now but I forgot to test with it gone.
2004-07-14 07:13:35 +00:00
Warner Losh
16629bd982 Remove fdc_alloc_resources, which should have happened in last commit. 2004-07-14 07:04:17 +00:00
Alfred Perlstein
67543ab1e3 Make FIOASYNC, FIOSETOWN and FIOGETOWN work on kqueues. 2004-07-14 07:02:03 +00:00
Warner Losh
aad6416500 Fix the pccard attachment to have a chance of working.
Move the resource allocation into the bus front ends.
2004-07-14 06:59:58 +00:00
Takanori Watanabe
8c4c207db4 Follow PnP location string change in acpi.c. 2004-07-14 06:58:39 +00:00
Alfred Perlstein
215bb69ffa do { } while(0) KNOTE macro, whitespace 2004-07-14 06:47:32 +00:00
Alan Cox
4b6df2ead7 Additional pmap locking 2004-07-14 05:49:44 +00:00
Robert Watson
66ea137d89 Switch snoop device to using C99 initialization for struct linesw. 2004-07-14 05:32:55 +00:00
Robert Watson
efe0ab01b2 Convert SLIP to using C99 structure initialization for its struct
linesw.
2004-07-14 05:01:40 +00:00
Alan Cox
8b6587f4c5 In pmap_remove_pages(), when clearing a pte, update the corresponding
page's dirty mask.

Reviewed by:	gallatin@
2004-07-14 03:05:19 +00:00
Peter Wemm
707783de09 Regen 2004-07-14 00:03:51 +00:00
Peter Wemm
1174965ee2 Unmapped syscalls should be NOPROTO so that we don't get a duplicate
prototype.  (kldunloadf in this case)
2004-07-14 00:03:30 +00:00
Olivier Houchard
8908521788 In pmap_remove_pages(), when the pv_list is entry, we want to clean the
PG_WRITEABLE flag, not the PG_REFERENCED flag.

Submitted by:   alc
2004-07-13 22:40:59 +00:00
John Baldwin
6942d4339e Set TDF_NEEDRESCHED when a higher priority thread is scheduled in
sched_add() rather than just doing it in sched_wakeup().  The old
ithread preemption code used to set NEEDRESCHED unconditionally if it
didn't preempt which masked this bug in SCHED_4BSD.

Noticed by:	jake
Reported by:	kensmith, marcel
2004-07-13 20:49:13 +00:00
Poul-Henning Kamp
65a311fcb2 Give kldunload a -f(orce) argument.
Add a MOD_QUIESCE event for modules.  This should return error (EBUSY)
of the module is in use.

MOD_UNLOAD should now only fail if it is impossible (as opposed to
inconvenient) to unload the module.  Valid reasons are memory references
into the module which cannot be tracked down and eliminated.

When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is
not given, MOD_QUIESCE failing will also prevent the unload.

For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as
success.

Document that modules should return EOPNOTSUPP for unknown events.
2004-07-13 19:36:59 +00:00
Poul-Henning Kamp
1a946b9fef Add kldunloadf() system call. Stay tuned for follwing commit messages. 2004-07-13 19:35:11 +00:00
Nate Lawson
d40c0f5324 Clean up our pnpinfo and location strings. 2004-07-13 18:59:49 +00:00
Nate Lawson
edc136334b Call device_identify routines after doing the namespace walk. This is
needed so that sysresource objects are created first to reserve all regions,
then other devices can allocate from them.  Otherwise, acpi_timer (the only
ACPI device with an identify routine), would allocate its resources from
the nexus, causing the later sysresource reserve to fail.

Debugging by:	Taku YAMAMOTO, Andrea Campi
2004-07-13 17:57:41 +00:00
Poul-Henning Kamp
3f4324df4d Send the fla driver in the Attic 2004-07-13 17:44:17 +00:00
Poul-Henning Kamp
ec712659ef Desupport M-Systems DiskOnChip driver "fla" 2004-07-13 17:43:03 +00:00
Poul-Henning Kamp
49bddf0c9f fix compilation. 2004-07-13 16:33:38 +00:00
Warner Losh
4b5239229c oldcard's card device no longer requires a count 2004-07-13 16:11:34 +00:00
Ken Smith
546d42ad9d Rev 1.24 of sys/ptrace.h adds ptrace_clear_single_step() prototype
definition so this one causes "redundant declaration" error and breaks
Alpha kernel build.

Reviewed by:	gallatin@ and test build on beast
2004-07-13 16:11:04 +00:00
Stefan Farfeleder
439dfb0c35 Remove erroneous semicolons. 2004-07-13 16:06:19 +00:00
Yoshihiro Takahashi
64c232e672 Merged from recent fdc driver changes.
Make a separate function to check FDD type.
2004-07-13 13:14:37 +00:00
Colin Percival
65bba83fef Replace "uid != 0" with "suser(td->td_ucred) != 0" when checking if we've
hit the maximum number of processes.  The last ten processes are reserved
for the *non-jailed* superuser.
2004-07-13 13:10:07 +00:00
Yoshihiro Takahashi
61e878c58c MFi386: revision 1.213.
Fix miss merging in previous change.
2004-07-13 12:58:36 +00:00
Pawel Jakub Dawidek
f3b3b0ce27 Remove unused macro. 2004-07-13 12:01:29 +00:00
Pawel Jakub Dawidek
45c26487a7 Decrease log level of one debug message, so there is no hole (level 2
wasn't used at all).
2004-07-13 12:01:11 +00:00
Pawel Jakub Dawidek
71df072547 Minor sysctl description fixes.
Submitted by:	simon
2004-07-13 11:23:31 +00:00
Poul-Henning Kamp
d521eae21d Another LINT compilation fix 2004-07-13 09:47:27 +00:00
Poul-Henning Kamp
a546742dd7 Make LINT compile 2004-07-13 09:46:46 +00:00
Hidetoshi Shimokawa
20021e6afd Re-enable debugger port. 2004-07-13 09:41:45 +00:00
Hidetoshi Shimokawa
fbf96e52bb Replace DDB with KDB. 2004-07-13 09:37:49 +00:00
David Xu
4d47dc5549 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:33:40 +00:00
David Xu
ef9457becb Implement following commands: PT_CLEARSTEP, PT_SETSTEP, PT_SUSPEND
PT_RESUME, PT_GETNUMLWPS, PT_GETLWPLIST.
2004-07-13 07:25:24 +00:00
David Xu
53dbf30349 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