Commit Graph

122299 Commits

Author SHA1 Message Date
Marcel Moolenaar
ea54941449 Replace our local UART_SIGMASK_* with the global SER_MASK_*. 2006-02-24 05:40:17 +00:00
Marcel Moolenaar
0bb90c9d57 When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4)
or scc(4) to grab the device by default. In fact, we probably shouldn't
even claim the device at all...
2006-02-24 05:36:44 +00:00
Marcel Moolenaar
2d5118050a MFp4:
Stop using our local UART_IPEND_* and instead use the global SER_INT_*
as defined in <sys/serial.h>.
2006-02-24 02:42:26 +00:00
Marcel Moolenaar
6fcbf91d09 MFp4:
o  Add defines for the 5 interrupt sources typical for serial devices.
   These defines can be used for more finegrained interrupt handling
   between drivers that cooperatively handle multiple serial ports.
o  Add defines for the various bitmasks applicable when all information
   is passed between drivers as a single integral.
2006-02-24 02:24:10 +00:00
Marcel Moolenaar
061ba7bb43 MFp4:
style(9): <tab> after #define
2006-02-24 02:16:09 +00:00
Marcel Moolenaar
c9ccf50a36 MFp4:
Return BUS_PROBE_LOW_PRIORITY for a successful probe. This is in
preparation of the introduction of scc(4), which is going to handle
SCCs in the near future.
2006-02-24 02:06:57 +00:00
Marcel Moolenaar
1ba1685b25 MFp4:
Add CHAN_A & CHAN_B for channel register offsets.
While here, fix a comment.
2006-02-24 02:03:35 +00:00
Marcel Moolenaar
9465d7f13a Remove dev/uart/uart_if.m from the default MFILES (in kmod.mk) and
instead define MFILES appropriately for the uart(4) module build.
2006-02-24 01:49:36 +00:00
Jung-uk Kim
6637b6368e - Back out 1.155. I mismerged my ancient local patch. Luckily it was
completely noop.
- Geometry sanitization for non-interactive mode is moved to correct place.

Reported by:	Anton Yuzhaninov <citrin at citrin dot ru>
Pointyhat:	me
2006-02-23 23:41:42 +00:00
Markus Brueffer
adcddbf0b1 - Use official version strings for LMP and HCI version reporting and add
version strings up to Bluetooth 2.0
- Update manufacturer list

Approved by:	emax
MFC after:	3 days
2006-02-23 23:19:12 +00:00
Daniel Eischen
aa8eff60a3 Eliminate a race condition in timed waits (cv, mutex, and sleeps).
MFC Candidate.

PR:	93592
2006-02-23 21:34:08 +00:00
Qing Li
4b8e98d632 This patch fixes the problem where the current TCP code can not handle
simultaneous open. Both the bug and the patch were verified using the
ANVL test suite.

PR:		kern/74935
Submitted by:	qingli (before I became committer)
Reviewed by:	andre
MFC after:	5 days
2006-02-23 21:14:34 +00:00
Wojciech A. Koszek
d2f4defee2 Fix the way in which median is calculated. If the data source has even
number of data points, value should be calculated by adding two middle
elements and dividing them by 2.

Approved by:	cognet (mentor)
2006-02-23 20:46:10 +00:00
Søren Schmidt
28baad63bd Keep the parent device (in this case the channel) around in ata_request,
so we dont panic device removal or failure.
Clean up ata_fail_requests to prevent the queue munging to fail.
2006-02-23 20:15:22 +00:00
John Baldwin
de49f3252c Remove some dead code.
Coverity ID:	822
Found by:	Coverity Prevent
Reviewed by:	ariff
MFC after:	1 week
2006-02-23 19:23:55 +00:00
John Baldwin
b36f458861 Use the recently added msleep_spin() function to simplify the
callout_drain() logic.  We no longer need a separate non-spin mutex to
do sleep/wakeup with, instead we can now just use the one spin mutex to
manage all the callout functionality.
2006-02-23 19:13:12 +00:00
John Baldwin
9fc9d84b9b - Use callout_init_mtx() to initialize toffhandle callout using the fdc's
mutex.
- Don't use callout_drain() to stop the toffhandle callout while holding the
  fdc mutex (this could deadlock) in functions called from softclock
  (callouts aren't allowed to do voluntary sleeps).  Instead, use
  callout_stop().  Note that since we hold the associated mutex and are now
  using callout_init_mtx(), callout_stop() is just as effective as
  callout_drain().  (Though callout_drain() is still needed in detach to
  make sure softclock isn't contesting on our mutex before we destroy the
  mutex.)
- Remove unused callout 'tohandle' from softc.

MFC after:	1 week
2006-02-23 19:11:16 +00:00
Søren Schmidt
c94b3e542e In ata_cmd_allocate() only call ata_pci_allocate once.
found by:	jhb@
2006-02-23 18:52:15 +00:00
Julian Elischer
f47dba63bb Fix typo 2006-02-23 18:51:02 +00:00
John Baldwin
44a4a80962 Check the return value of copyin() and return an error if it fails.
Coverity ID:	839
Found by:	Coverity Prevent
MFC after:	1 week
Reviewed by:	ps, scottl
2006-02-23 18:05:38 +00:00
Andrew Gallatin
784daffb89 Unhook myri10ge from build in preparation for rename 2006-02-23 12:30:39 +00:00
David Xu
7e0221a251 1. Refine kern_sigtimedwait() to remove redundant code.
2. Fix a bug, if thread got a SIGKILL signal, call sigexit() to kill
   its process.

MFC after: 3 days
2006-02-23 09:24:19 +00:00
Hiroki Sato
b966c71acb Update version numbers in &release.*;. 2006-02-23 06:15:56 +00:00
David Xu
7c9a98f15b Code cleanup, simply compare with curproc. 2006-02-23 05:50:55 +00:00
Jeff Roberson
8febcfb92f - Use vfs_ref/rel to protect a mountpoint from going away while VFS_STATFS
is being called.  Be sure to grab the ref before we unlock the vnode to
   prevent the mount from disappearing.

Tested by:	kris
2006-02-23 05:18:07 +00:00
Jeff Roberson
a1db11fc40 - Release the mount ref once the vnode has been recycled rather than once
the last reference is dropped.  I forgot that vnodes can stick around
   for a very long time until processes discover that they are dead.  This
   means that a vnode reference is not sufficient to keep the mount
   referenced and even more code will be required to ref mount points.

Discovered by:	kris
2006-02-23 05:15:37 +00:00
David Xu
dc94f5e383 Move comments to more accurate place. 2006-02-23 03:42:17 +00:00
David Xu
c008d51784 Fix a sleep queue race for KSE thread.
Reviewed by: jhb
2006-02-23 00:13:58 +00:00
Sam Leffler
3e0ded9327 cleanup line break formatting
MFC after:	1 week
2006-02-23 00:07:10 +00:00
Wojciech A. Koszek
cd234bc8bc Add myself as a new src commiter:
+ extend calendar with my birth date

Approved by:    cognet (mentor)
Reviewed by:    cognet (mentor)
2006-02-22 22:02:04 +00:00
Sam Leffler
ed7b0743d7 test program to check cpu counting
MFC after:	1 week
2006-02-22 21:51:09 +00:00
John Baldwin
93d74675d6 G/C unused variable. 2006-02-22 21:47:04 +00:00
Sam Leffler
3f676959ae guard function decls with _KERNEL so user code can include this file
MFC after:	1 week
2006-02-22 21:38:33 +00:00
John-Mark Gurney
235811bfea allow timo to be 0 when mtx is not NULL (KASSERT allowed this as
pointed out by jhb)

Reviewed by:	jhb
MFC after:	3 days
2006-02-22 20:50:33 +00:00
John Baldwin
daad1cd74d Fixup some comments. Mutexes's are locked, not entered for several years
now and msleep blocks threads rather than processes.
2006-02-22 20:46:10 +00:00
John Baldwin
06ad42b2f7 Close some races between procfs/ptrace and exit(2):
- Reorder the events in exit(2) slightly so that we trigger the S_EXIT
  stop event earlier.  After we have signalled that, we set P_WEXIT and
  then wait for any processes with a hold on the vmspace via PHOLD to
  release it.  PHOLD now KASSERT()'s that P_WEXIT is clear when it is
  invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops
  to zero.
- Change proc_rwmem() to require that the processing read from has its
  vmspace held via PHOLD by the caller and get rid of all the junk to
  screw around with the vmspace reference count as we no longer need it.
- In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it
  doesn't exist.
- Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers
  FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem()
  to clear an earlier single-step simualted via a breakpoint).  We only
  do one to avoid races.  Also, by making the EINVAL error for unknown
  requests be part of the default: case in the switch, the various
  switch cases can now just break out to return which removes a _lot_ of
  duplicated PRELE and proc unlocks, etc.  Also, it fixes at least one bug
  where a LWP ptrace command could return EINVAL with the proc lock still
  held.
- Changed the locking for ptrace_single_step(), ptrace_set_pc(), and
  ptrace_clear_single_step() to always be called with the proc lock
  held (it was a mixed bag previously).  Alpha and arm have to drop
  the lock while the mess around with breakpoints, but other archs
  avoid extra lock release/acquires in ptrace().  I did have to fix a
  couple of other consumers in kern_kse and a few other places to
  hold the proc lock and PHOLD.

Tested by:	ps (1 mostly, but some bits of 2-4 as well)
MFC after:	1 week
2006-02-22 18:57:50 +00:00
John Baldwin
57fb5e6097 - Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
  Uses of the BUS_*() versions in the implementation of foo_intr methods
  in bus drivers were not changed.  Mostly this just means that some
  drivers might start printing diagnostic messages like [FAST] when
  appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
  correctly in the mythical case of a machine with more than one ppbus.
2006-02-22 18:16:26 +00:00
John Baldwin
f8e3eeb519 Change pfs_visible() to optionally return a pointer to the process
associated with the passed in pfs_node.  If it does return a pointer, it
keeps the process locked.  This allows a lot of places that were calling
pfind() again right after pfs_visible() to not have to do that and avoids
races since we don't drop the proc lock just to turn around and lock it
again.  This will become more important with future changes to fix races
between procfs/ptrace and exit(2).  Also, removed a duplicate pfs_visible()
call in pfs_getextattr().

Reviewed by:	des
MFC after:	1 week
2006-02-22 17:24:54 +00:00
John Baldwin
54690b5679 Don't do a PHOLD() in kthread_create() w/o a matching PRELE() in
kthread_exit().  Rather than add the missing PRELE() I chose to just
axe the PHOLD() since it was redundant with the P_SYSTEM flag.

MFC after:	1 week
2006-02-22 17:21:45 +00:00
John Baldwin
7a61c1a3cb Hold the proc lock while calling proc_sstep() since the function asserts
it and remove a PRELE() that didn't have a matching PHOLD().  The calling
code already has a PHOLD anyway.

MFC after:	1 week
2006-02-22 17:20:37 +00:00
John Baldwin
3df4e47b1e Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so that
puc still prints out [FAST] on Peter's box.
2006-02-22 17:19:10 +00:00
John Baldwin
8f95fc2481 Various style and comment fixes.
Submitted by:	bde
2006-02-22 16:58:48 +00:00
Wayne Salamon
bc5504b942 Add pathname and/or vnode argument auditing for the following system calls:
quotactl, statfs, fstatfs, fchdir, chdir, chroot, open, mknod, mkfifo,
link, symlink, undelete, unlink, access, eaccess, stat, lstat, pathconf,
readlink, chflags, lchflags, fchflags, chmod, lchmod, fchmod, chown,
lchown, fchown, utimes, lutimes, futimes, truncate, ftruncate, fsync,
rename, mkdir, rmdir, getdirentries, revoke, lgetfh, getfh, extattrctl,
extattr_set_file, extattr_set_link, extattr_get_file, extattr_get_link,
extattr_delete_file, extattr_delete_link, extattr_list_file, extattr_list_link.

In many cases the pathname and vnode auditing is done within namei lookup
instead of directly in the system call.

Audit the remaining arguments to these system calls:
fstatfs, fchdir, open, mknod, chflags, lchflags, fchflags, chmod, lchmod,
fchmod, chown, lchown, fchown, futimes, ftruncate, fsync, mkdir,
getdirentries.
2006-02-22 16:04:20 +00:00
Yaroslav Tykhiy
c6136be413 Forgot to bump .Dd in the last commit. 2006-02-22 15:12:07 +00:00
Yaroslav Tykhiy
36ab780431 Tell the truth about a) how to get the first fileid, and
b) what return values from kldstat(2) can be expected.

Bump .Dd.

MFC after:	3 days
2006-02-22 15:11:12 +00:00
Gleb Smirnoff
9cc9484cb5 Back out 1.112,1.113. I don't have enough resources to fix breakages
introduced by this change.
2006-02-22 14:11:16 +00:00
Peter Edwards
d12dff713a If opendir(".") fails after descending into a subdirectory via
chdir(), be sure to undo the effects of the chdir before continuing.

Without this, after hitting a directory with mode 0111 (for example),
tar will get lost, and won't add any yet unvisted files to your
archive.  (Or possibly add the wrong files, I suppose...)

Reviewed By: kientzle@
2006-02-22 11:13:07 +00:00
Yaroslav Tykhiy
91387563e2 Document the relation between $command and $foo_program.
PR:		docs/68453
MFC after:	3 days
2006-02-22 10:57:19 +00:00
Pawel Jakub Dawidek
290c616103 Do not use bio structure after g_io_deliver(), it may not longer by valid.
Found and fixed by:	Vsevolod Lobko <seva@ip.net.ua>
MFC after:		3 days
2006-02-22 10:21:05 +00:00
Jeff Roberson
c5dcb84008 - Revert r1.406 until a solution can be found that doesn't break nfs. The
statfs handler in nfs will lock vnodes which may lead to deadlock or
   recursion.

Found by:	kris
Pointy hat to:	me
2006-02-22 09:52:25 +00:00