dragonfly.git
19 years agoExplicitly cast away the volatile for conversions and argument passings.
Joerg Sonnenberger [Tue, 1 Jun 2004 17:27:44 +0000 (17:27 +0000)]
Explicitly cast away the volatile for conversions and argument passings.
Deploy __DEVOLATILE.

19 years agoUse struct thread for kernel threads, not struct proc.
Joerg Sonnenberger [Tue, 1 Jun 2004 17:12:15 +0000 (17:12 +0000)]
Use struct thread for kernel threads, not struct proc.

19 years agoCorrect spelling.
Hiten Pandya [Tue, 1 Jun 2004 14:00:50 +0000 (14:00 +0000)]
Correct spelling.

Submitted-by: Tim Wickberg <me at k9mach3.org>

19 years agoRemove '-*- nroff -*-'.
Hiten Pandya [Tue, 1 Jun 2004 11:36:53 +0000 (11:36 +0000)]
Remove '-*- nroff -*-'.

Lets make a habit not to put editor-related magic into our base
files.  They are redundant and useless.

19 years agoStyle(9) cleanup:
Chris Pressey [Tue, 1 Jun 2004 01:15:59 +0000 (01:15 +0000)]
Style(9) cleanup:

- Remove `register' keywords.
- Single space after `switch'.
- No functional changes.

19 years agoPanic in udp_output() if a socket is found in an inconsistent state.
Jeffrey Hsu [Mon, 31 May 2004 23:53:14 +0000 (23:53 +0000)]
Panic in udp_output() if a socket is found in an inconsistent state.

19 years agoRemove unused error variable.
Eirik Nygaard [Mon, 31 May 2004 20:48:41 +0000 (20:48 +0000)]
Remove unused error variable.

Submitted-by: Dheeraj Reddy <dheerajs@comcast.net>
19 years agoSince RNDC does not yet support 'restart', use RCNG to restart named
Matthew Dillon [Mon, 31 May 2004 17:52:30 +0000 (17:52 +0000)]
Since RNDC does not yet support 'restart', use RCNG to restart named
instead of rolling our own.

Suggested-by: Brad Harvell <dfbrad@whatzit.org>
19 years agoFix the path to named's pid file.
Matthew Dillon [Mon, 31 May 2004 17:51:47 +0000 (17:51 +0000)]
Fix the path to named's pid file.

Submitted-by: Brad Harvell <dfbrad@whatzit.org>
19 years agoWhen doing a restart, sleep for 0.1 seconds after the kill to avoid racing
Matthew Dillon [Mon, 31 May 2004 17:50:39 +0000 (17:50 +0000)]
When doing a restart, sleep for 0.1 seconds after the kill to avoid racing
the kill in wait_for_pids() (which imposes a 2 second delay when the race
is lost).

19 years agoIn the root fs search use the correct unit number when checking for
Matthew Dillon [Mon, 31 May 2004 17:38:08 +0000 (17:38 +0000)]
In the root fs search use the correct unit number when checking for
device existinance.  The new device infrastructure often registers disk
unist separately, so looking up unit 0 when only unit N exists will not
succeed.  We might want to later augment this with the slice and partition
number (which are 0 at the time the search is made prior to the real lookup),
but this should work for now.

Submitted-by: Hiroki Sato <hrs@allbsd.org>
19 years agoTwo unused arguments were recently removed from pmap_init() without
Matthew Dillon [Mon, 31 May 2004 17:06:41 +0000 (17:06 +0000)]
Two unused arguments were recently removed from pmap_init() without
fixing the call or the prototype.  Fix those.

Reported-by: walt <wa1ter@myrealbox.com>
19 years agoDo not use the display function if the -o (opaque) or -x (hexdump)
Hiten Pandya [Mon, 31 May 2004 14:59:34 +0000 (14:59 +0000)]
Do not use the display function if the -o (opaque) or -x (hexdump)
arguments were provided to sysctl(8).

The display function is used when a sysctl node is registered as
`special' in sysctl(8), so instead of showing the normal "var:val"
output, it would format the values instead.  E.g. vm.loadavg.

19 years agoRemove an unimplemented advisory function, pmap_pageable(); there is
Hiten Pandya [Mon, 31 May 2004 11:43:49 +0000 (11:43 +0000)]
Remove an unimplemented advisory function, pmap_pageable(); there is
no pmap implementation in existance that requires it implemented.

Discussed-with:  Alan Cox <alc at freebsd.org>,
                 Matthew Dillon <dillon at backplane.com>

19 years agoRemove a stale comment: PG_DIRTY and PG_FILLED were removed in
Hiten Pandya [Mon, 31 May 2004 01:51:23 +0000 (01:51 +0000)]
Remove a stale comment: PG_DIRTY and PG_FILLED were removed in
revisions 1.17 and 1.12 respectively.

Noticed-by: Alan Cox <alc at freebsd.org>
19 years agoForce commit to clarify that the previous revision should have been
Hiten Pandya [Sat, 29 May 2004 09:53:58 +0000 (09:53 +0000)]
Force commit to clarify that the previous revision should have been
credited to:

YONETANI Tomokazu <qhwt+dragonfly-commit at les.ath.cx>

19 years agoAdjust include path so that the machine.h in ${.OBJDIR} is used
Hiten Pandya [Sat, 29 May 2004 09:51:43 +0000 (09:51 +0000)]
Adjust include path so that the machine.h in ${.OBJDIR} is used
instead of the one in src/contrib/top.

19 years agoFirst pass at updating top(1):
Hiten Pandya [Sat, 29 May 2004 05:11:15 +0000 (05:11 +0000)]
First pass at updating top(1):

* add command line option '-T' for displaying kernel threads
  such as pagedaemon, tcp_thread, and so on; the threads are
  now marked '<thread>' in the top(1) display.

* cleanup manipulation of COMMAND strings, insipired by a
  similar change in NetBSD's top(1).

* add a toggle for system processes, called 'S' so we dont
  need to restart top(1) to {un}display system processes.

* change some sprintf's to snprintfs for safety.

* update the sort/ordering top(1) commands so that it correctly
  displays kernel threads by priority time used etc.

* add a 'thr' sort order function so that kernel threads can be
  collected together in the top(1) display; this is useful when
  running it in batch mode.

* fix the screen width issue for terminals that have more than
  80 columns; this was necessary for showing threads properly in
  SMP mode.

* add ability for top(1) to sort kernel threads their priority
  (note, thread priorities are stored differently).

NOTE! top(1) is now using the contrib-patching framework just like
we do with GCC-3 so that it will be simple to update the base code
in the future if required.

CREDITS
Thanks go to Matthew Dillon <dillon@backplane.com> for reviewing the
patches and supplying me with an SMP machine to test the changes.

19 years agoMake sysctl_kern_proc() iterate through available cpus to retrieve the
Matthew Dillon [Sat, 29 May 2004 02:47:50 +0000 (02:47 +0000)]
Make sysctl_kern_proc() iterate through available cpus to retrieve the
list of threads installed on each one rather then just retrieve the threads
on the cpu it happens to have been called from.

To accomplish this, sysctl_kern_proc() now uses the new LWKT API to
migrate itself to each target cpu in order to safely access the thread
list on that cpu, ending up on the same cpu it started from.  The overhead
is nasty to be sure, but who cares when only 'top' and 'ps' and related
non-critical utilities use the feature?

19 years agooops.
David Rhodus [Fri, 28 May 2004 20:30:18 +0000 (20:30 +0000)]
oops.
make `pkg_add -r XFree86` work again by changing the Latest path back.

19 years agoAdd lwkt_setcpu_self(), a function which migrates the current thread to
Matthew Dillon [Fri, 28 May 2004 08:37:34 +0000 (08:37 +0000)]
Add lwkt_setcpu_self(), a function which migrates the current thread to
the specified cpu.  This will soon be used by sysctl_kern_proc() to
collect thread information across all available cpus (because it is only
legal to manipulate a thread on the cpu it belongs to).

Yes, you heard that right and, yes, the overhead is nasty... one whole
microsecond per cpu at least, possibly even two.  But who cares for
something like 'ps'?

In-conversation-with: Hiten Pandya <hmp@freebsd.org>

19 years agoInitialize the FP unit earlier in the AP boot sequence. This solves
Matthew Dillon [Thu, 27 May 2004 19:21:49 +0000 (19:21 +0000)]
Initialize the FP unit earlier in the AP boot sequence.  This solves
reported problems on MP systems not booting with mmxopt=1 .

Reported-by: Many. Thanks to David Rhodus for testing and debugging!
19 years agoAttach bind-9.2.4rc4 to the base system. Rip out bind-8 binaries and add
Matthew Dillon [Thu, 27 May 2004 18:15:43 +0000 (18:15 +0000)]
Attach bind-9.2.4rc4 to the base system.  Rip out bind-8 binaries and add
in / adjust for most bind-9 binaries.  Note that some pre-generated header
files have been hacked into /usr/src/usr.sbin/named and might have to be
regenerated from the original distribution when incorporating updates to
bind.  But, for the most part, the build is clean.

Clean up rc.d/named and etc/defaults/rc.conf, add a README file to
/etc/namedb describing setup requirements, and change the default
named.conf file and RCNG variables to (if named is enabled) run named in
a chrooted environment as user 'bind'.  Adapt the 'getroot' script that
I have used for many years to provide a better root.zone master methodology
instead of the root hints file that has been traditionally shipped.

Adjust the mtree files and distrib-dirs target to create the necessary
infrastructure in /etc/namedb for handling a chrooted named.

NOTE: bind-8 had 'ndc' and 'named-xfer'.  bind-8 has rndc and there is no
named-xfer (it is builtin to named).  nslookup still exists but is deprecated
in favor of 'dig', and the old dnskeygen/dnsquery mechanism has been replaced
by the newer dnssec-* mechanism.

19 years agoBring in the fictitious page wiring bug fixes from FreeBSD-5. Make additional
Matthew Dillon [Thu, 27 May 2004 00:38:58 +0000 (00:38 +0000)]
Bring in the fictitious page wiring bug fixes from FreeBSD-5.  Make additional
major changes to the APIs to clean them up (so this commit is substantially
different than what was committed to FreeBSD-5).

Obtained-from: Alan Cox <alc@cs.rice.edu> (FreeBSD-5)

19 years agoMask bits properly for pte_prot() in case it is called with additional
Matthew Dillon [Wed, 26 May 2004 23:34:25 +0000 (23:34 +0000)]
Mask bits properly for pte_prot() in case it is called with additional
VM_PROT_ bits.

Fix a wired memory leak bug in pmap_enter().  If a page wiring change is
made and the page has already been faulted in for read access, and a
write-fault occurs, pmap_enter() was losing track of the wiring count in
the pmap when it tried to optimize the RO->RW case in the page table.
This prevented the page table page from being freed and led to a memory leak.

The case is easily reproducable if you attempt to wire the data/bss crossover
page in a program (typically just declare a global variable in a small program
and mlock() its page, then exit without munlock()ing).  4K is lost each time
the program is run.

19 years agoANSIfication and cleanup. No functional changes.
Matthew Dillon [Wed, 26 May 2004 20:04:07 +0000 (20:04 +0000)]
ANSIfication and cleanup.  No functional changes.

Submitted-by: Tim Wickberg <me@k9mach3.org>
19 years agoCorrect a bug in the last commit, udev must be assigned from vp->v_udev, not
Matthew Dillon [Wed, 26 May 2004 19:11:08 +0000 (19:11 +0000)]
Correct a bug in the last commit, udev must be assigned from vp->v_udev, not
vp->v_rdev.

19 years agoCleanup warnings. No operational changes. Note that the original ACPICA
Matthew Dillon [Wed, 26 May 2004 19:10:00 +0000 (19:10 +0000)]
Cleanup warnings.  No operational changes.  Note that the original ACPICA
character device interface was already disabled prior to this commit.

19 years agoCleanup warnings. No operational changes.
Matthew Dillon [Wed, 26 May 2004 19:09:04 +0000 (19:09 +0000)]
Cleanup warnings.  No operational changes.

19 years agoConsolidate SYSCTL_DECL(_kern_ipc), move it to sys/sysctl.h as
Hiten Pandya [Wed, 26 May 2004 14:12:34 +0000 (14:12 +0000)]
Consolidate SYSCTL_DECL(_kern_ipc), move it to sys/sysctl.h as
a common second-level OID.

No operational changes.

19 years agopreload_delete_name() needs to use the same path munging that the other
Matthew Dillon [Wed, 26 May 2004 08:32:41 +0000 (08:32 +0000)]
preload_delete_name() needs to use the same path munging that the other
preload routines use, or it may not find the preloaded module.  Failure
to delete a preloaded module that is being unloaded can result in the
preloaded module being relocated twice if a later kldload occurs.

Found-by: Hiten Pandya <hmp@backplane.com>
19 years agocount_udev() was being called with the wrong argument.
Matthew Dillon [Wed, 26 May 2004 07:45:26 +0000 (07:45 +0000)]
count_udev() was being called with the wrong argument.

Submitted-by: Hiten Pandya <hmp@backplane.com>
19 years agoANSIfication and general cleanup. No operational changes.
Matthew Dillon [Wed, 26 May 2004 01:29:58 +0000 (01:29 +0000)]
ANSIfication and general cleanup.  No operational changes.

19 years agoCleanup cdevsw and dev reference counting ops to fix a warning that occurs
Matthew Dillon [Wed, 26 May 2004 01:14:36 +0000 (01:14 +0000)]
Cleanup cdevsw and dev reference counting ops to fix a warning that occurs
when a system is halted or rebooted.

19 years agoIncrement v_opencount before potentially blocking in dopen to avoid
Matthew Dillon [Wed, 26 May 2004 00:11:56 +0000 (00:11 +0000)]
Increment v_opencount before potentially blocking in dopen to avoid
a degenerate open/close case.

Suggested-by: Hiten Pandya <hmp@leaf.dragonflybsd.org>
19 years agoANSIfication and cleanup. No operational changes.
Matthew Dillon [Tue, 25 May 2004 18:54:26 +0000 (18:54 +0000)]
ANSIfication and cleanup.  No operational changes.

19 years agoThe extended mbr handling code was improperly using the b_dev from a
Matthew Dillon [Tue, 25 May 2004 18:46:35 +0000 (18:46 +0000)]
The extended mbr handling code was improperly using the b_dev from a
struct buf after its strategy call had been made.

Reported-by: Tim Wickberg <me@k9mach3.org>, walt <wa1ter@myrealbox.com>,
Fredrik Eriksson <dragonfly-bugs@omnib.org>, and others

19 years agoAdd missing . before An macro at the end.
Jeroen Ruigrok/asmodai [Tue, 25 May 2004 13:00:50 +0000 (13:00 +0000)]
Add missing . before An macro at the end.

19 years agoAdded mention of using MAKEDEV for when the target slice for installation
Justin C. Sherrill [Mon, 24 May 2004 14:00:04 +0000 (14:00 +0000)]
Added mention of using MAKEDEV for when the target slice for installation
is not ad0s1, as the rest of the file assumes.

Patch-from: Tim Wickberg <me@k9mach3.org>
Comment-text-slightly-modified-by: me
19 years agoWrap the VM MAP locking routines with _KERNEL, user-land has no
Hiten Pandya [Mon, 24 May 2004 07:25:36 +0000 (07:25 +0000)]
Wrap the VM MAP locking routines with _KERNEL, user-land has no
business with them.

This fixes quite a lot of sysutil/ ports indirectly, because
they include <sys/user.h> which ends up including <vm/vm_map.h>.

19 years agoRemove unneeded typecast.
David Rhodus [Fri, 21 May 2004 16:21:57 +0000 (16:21 +0000)]
Remove unneeded typecast.

19 years agoCleanup pass. Removed code that is not needed anymore.
David Rhodus [Fri, 21 May 2004 15:41:23 +0000 (15:41 +0000)]
Cleanup pass. Removed code that is not needed anymore.
Cleanup VOP_LEASE() uses and document.

Add in a debug function for buffer pool statistical information which can
be toggled via debug.syncprt.

19 years agoFix SYSCTL description style.
Hiten Pandya [Fri, 21 May 2004 14:26:28 +0000 (14:26 +0000)]
Fix SYSCTL description style.

19 years agoDocument the pmap_kenter_quick(9) function. While I am here, fix
Hiten Pandya [Fri, 21 May 2004 11:03:14 +0000 (11:03 +0000)]
Document the pmap_kenter_quick(9) function.  While I am here, fix
comment style for pmap_kenter(9).

19 years agoIt is DragonFly BSD, not FreeBSD. Correct config(8) files.
Hiten Pandya [Fri, 21 May 2004 10:47:45 +0000 (10:47 +0000)]
It is DragonFly BSD, not FreeBSD.  Correct config(8) files.

19 years agoThe default shell for the user `man' is nologin(8). Make the examples
Chris Pressey [Fri, 21 May 2004 05:27:12 +0000 (05:27 +0000)]
The default shell for the user `man' is nologin(8).  Make the examples
of su(1)'s usage (hopefully) more elucidating to new administrators in
light of this fact.

19 years agoPass the proper mask/match arguments to cdevsw_add() so the various sound
Matthew Dillon [Fri, 21 May 2004 01:14:27 +0000 (01:14 +0000)]
Pass the proper mask/match arguments to cdevsw_add() so the various sound
device minor numbers do not override each other's major numbers / cdevsw
structures.

Reported-by: Emiel Kollof <coolvibe@hackerheaven.org> and others
19 years agoGet rid of VM_WAIT and VM_WAITPFAULT crud, replace with calls to
Matthew Dillon [Thu, 20 May 2004 22:42:25 +0000 (22:42 +0000)]
Get rid of VM_WAIT and VM_WAITPFAULT crud, replace with calls to
vm_wait() and vm_waitpfault().  This is a non-operational change.

vm_page.c now uses the _vm_page_list_find() inline (which itself is only
in vm_page.c) for various critical path operations.

19 years agoCleanup pass. No operational changes.
Matthew Dillon [Thu, 20 May 2004 22:40:29 +0000 (22:40 +0000)]
Cleanup pass.  No operational changes.

19 years agoGet rid of obsolete PQ_ options.
Matthew Dillon [Thu, 20 May 2004 22:38:32 +0000 (22:38 +0000)]
Get rid of obsolete PQ_ options.

19 years agoCleanup pass. No operational changes.
Matthew Dillon [Thu, 20 May 2004 22:35:39 +0000 (22:35 +0000)]
Cleanup pass.  No operational changes.

19 years agoCleanup compile issues with the recent dev_t changes.
Matthew Dillon [Thu, 20 May 2004 21:47:23 +0000 (21:47 +0000)]
Cleanup compile issues with the recent dev_t changes.

19 years agoCleanup compile issues with the recent dev_t changes.
Matthew Dillon [Thu, 20 May 2004 21:44:00 +0000 (21:44 +0000)]
Cleanup compile issues with the recent dev_t changes.

19 years agoMake the primary PQ_ macros available to modules by creating the pageq
Matthew Dillon [Thu, 20 May 2004 21:40:52 +0000 (21:40 +0000)]
Make the primary PQ_ macros available to modules by creating the pageq
array based on the maximum cache size instead of the selected cache
size.   Remove obsolete PQ_ options (leaving only PQ_CACHESIZE).

Move the vm_page_list_find() inline out of vm_page.h and into vm_page.c,
and provide an external function for other modules that use it.

Remove the 'disable page coloring' option (that nobody has ever used),
and related conditionals.  Page coloring never hurts and is now always on
to some degree.

Suggested-by: Hiten Pandya <hmp@backplane.com>
Agreed-with: Alan Cox <alc@cs.rice.edu>

19 years agoClarify how our `test -w' is a superset of POSIX' requirements.
Chris Pressey [Thu, 20 May 2004 21:07:23 +0000 (21:07 +0000)]
Clarify how our `test -w' is a superset of POSIX' requirements.

19 years agoUpdate the mlock(2) manual page:
Hiten Pandya [Thu, 20 May 2004 20:54:50 +0000 (20:54 +0000)]
Update the mlock(2) manual page:

* Remove a long obsolete paragraph from the BUGS section.
* Bump the date.

Obtained-from: Alan Cox <alc at freebsd.org> (FreeBSD Project)

19 years agoStyle(9) cleanup to src/usr.sbin: remove remaining `register' keywords.
Chris Pressey [Thu, 20 May 2004 19:24:43 +0000 (19:24 +0000)]
Style(9) cleanup to src/usr.sbin: remove remaining `register' keywords.

19 years agoCorrect sort order of SUBDIRs.
Chris Pressey [Thu, 20 May 2004 19:09:27 +0000 (19:09 +0000)]
Correct sort order of SUBDIRs.

19 years agoStyle(9) cleanup to src/sys/netinet6:
Chris Pressey [Thu, 20 May 2004 18:30:36 +0000 (18:30 +0000)]
Style(9) cleanup to src/sys/netinet6:

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Double-checked-by: YONETANI Tomokazu <qhwt+dragonfly-submit@les.ath.cx>
19 years agoPoint the remote site to use gobsd.com so the remote option now works.
David Rhodus [Thu, 20 May 2004 15:53:16 +0000 (15:53 +0000)]
Point the remote site to use gobsd.com so the remote option now works.

Ex. cvs# pkg_add -r bash-2.05b.007.tgz

19 years agoStyle(9) cleanup to src/sys/vfs, stage 21/21: unionfs.
Chris Pressey [Thu, 20 May 2004 05:09:18 +0000 (05:09 +0000)]
Style(9) cleanup to src/sys/vfs, stage 21/21: unionfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
19 years agoPut snd_recover in the same cache line as snd_una. Make room in the
Jeffrey Hsu [Thu, 20 May 2004 04:32:59 +0000 (04:32 +0000)]
Put snd_recover in the same cache line as snd_una.  Make room in the
snd_una cache line by coalescing the t_force field into t_flags and moving
snd_up into the old t_force slot.

19 years agoTrade off more writes for a simpler check for when to pull up snd_recover.
Jeffrey Hsu [Thu, 20 May 2004 04:28:52 +0000 (04:28 +0000)]
Trade off more writes for a simpler check for when to pull up snd_recover.

19 years agoUsing the new contrib rev mechanism, bring cvs up to 1.12.8. Add patch files
Matthew Dillon [Thu, 20 May 2004 02:27:57 +0000 (02:27 +0000)]
Using the new contrib rev mechanism, bring cvs up to 1.12.8.  Add patch files
for our few remaining local patches (-j rev:DATE and -g).

19 years agoDevice layer rollup commit.
Matthew Dillon [Wed, 19 May 2004 22:53:06 +0000 (22:53 +0000)]
Device layer rollup commit.

* cdevsw_add() is now required.  cdevsw_add() and cdevsw_remove() may specify
  a mask/match indicating the range of supported minor numbers.  Multiple
  cdevsw_add()'s using the same major number, but distinctly different
  ranges, may be issued.  All devices that failed to call cdevsw_add() before
  now do.

* cdevsw_remove() now automatically marks all devices within its supported
  range as being destroyed.

* vnode->v_rdev is no longer resolved when the vnode is created.  Instead,
  only v_udev (a newly added field) is resolved.  v_rdev is resolved when
  the vnode is opened and cleared on the last close.

* A great deal of code was making rather dubious assumptions with regards
  to the validity of devices associated with vnodes, primarily due to
  the persistence of a device structure due to being indexed by (major, minor)
  instead of by (cdevsw, major, minor).  In particular, if you run a program
  which connects to a USB device and then you pull the USB device and plug
  it back in, the vnode subsystem will continue to believe that the device
  is open when, in fact, it isn't (because it was destroyed and recreated).

  In particular, note that all the VFS mount procedures now check devices
  via v_udev instead of v_rdev prior to calling VOP_OPEN(), since v_rdev
  is NULL prior to the first open.

* The disk layer's device interaction has been rewritten.  The disk layer
  (i.e. the slice and disklabel management layer) no longer overloads
  its data onto the device structure representing the underlying physical
  disk.  Instead, the disk layer uses the new cdevsw_add() functionality
  to register its own cdevsw using the underlying device's major number,
  and simply does NOT register the underlying device's cdevsw.  No
  confusion is created because the device hash is now based on
  (cdevsw,major,minor) rather then (major,minor).

  NOTE: This also means that underlying raw disk devices may use the entire
  device minor number instead of having to reserve the bits used by the disk
  layer, and also means that can we (theoretically) stack a fully
  disklabel-supported 'disk' on top of any block device.

* The new reference counting scheme prevents this by associating a device
  with a cdevsw and disconnecting the device from its cdevsw when the cdevsw
  is removed.  Additionally, all udev2dev() lookups run through the cdevsw
  mask/match and only successfully find devices still associated with an
  active cdevsw.

* Major work on MFS:  MFS no longer shortcuts vnode and device creation.  It
  now creates a real vnode and a real device and implements real open and
  close VOPs.  Additionally, due to the disk layer changes, MFS is no longer
  limited to 255 mounts.  The new limit is 16 million.  Since MFS creates a
  real device node, mount_mfs will now create a real /dev/mfs<PID> device
  that can be read from userland (e.g. so you can dump an MFS filesystem).

* BUF AND DEVICE STRATEGY changes.  The struct buf contains a b_dev field.
  In order to properly handle stacked devices we now require that the b_dev
  field be initialized before the device strategy routine is called.  This
  required some additional work in various VFS implementations.  To enforce
  this requirement, biodone() now sets b_dev to NODEV.  The new disk layer
  will adjust b_dev before forwarding a request to the actual physical
  device.

* A bug in the ISO CD boot sequence which resulted in a panic has been fixed.

Testing by: lots of people, but David Rhodus found the most aggregious bugs.

19 years agoStyle(9) cleanup to src/sys/vfs, stage 20/21: umapfs.
Chris Pressey [Tue, 18 May 2004 16:57:01 +0000 (16:57 +0000)]
Style(9) cleanup to src/sys/vfs, stage 20/21: umapfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
19 years agoStyle(9) cleanup to src/sys/vfs, stage 19/21: ufs.
Chris Pressey [Tue, 18 May 2004 00:16:46 +0000 (00:16 +0000)]
Style(9) cleanup to src/sys/vfs, stage 19/21: ufs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
19 years agoQuickly fix an MLINK while no one is looking...
Hiten Pandya [Mon, 17 May 2004 22:48:09 +0000 (22:48 +0000)]
Quickly fix an MLINK while no one is looking...

19 years agoDocument the ``resource management'' (rman) abstraction in rman(9).
Hiten Pandya [Mon, 17 May 2004 21:46:40 +0000 (21:46 +0000)]
Document the ``resource management'' (rman) abstraction in rman(9).

The rman(9) manual page has sufficient information on the rman_*
functions and some background on the concept of regions and
resources and how rman(9) abstracts them.

Install the necessary MLINKs.

Note:
Some of the functions have been commented out in the mdoc(7) until
I or Joerg get around to updating the DragonFly rman(9) abstraction.
After that is done, other parts of the maual page can be expanded.

Obtained-from:   FreeBSD (HEAD)
Adapted-by: Hiten Pandya <hmp@backplane.com>
19 years agoFix catman(1) so that it recognizes valid manpage names as valid.
Chris Pressey [Mon, 17 May 2004 17:44:26 +0000 (17:44 +0000)]
Fix catman(1) so that it recognizes valid manpage names as valid.
Compare the char at the pointer to '\0', not the pointer itself.

19 years agoBring in a better seeding and random number generation algorithm from
Matthew Dillon [Mon, 17 May 2004 07:35:55 +0000 (07:35 +0000)]
Bring in a better seeding and random number generation algorithm from
FreeBSD for the (old) rand() API.  Add sranddev() to the library and clean
up the manual page.  Note that we are currently using /dev/urandom to
generate the seed to avoid boot-time blocking issues.

Submitted-by: "William M. Grim" <wgrim@siue.edu>
Reviewed by: Joerg Sonnenberger and others

19 years agoFix more ^T panics. calcru() and p_comm also need p_thread checks. Just
Matthew Dillon [Mon, 17 May 2004 07:12:31 +0000 (07:12 +0000)]
Fix more ^T panics.  calcru() and p_comm also need p_thread checks.  Just
move all process data extraction to a critical section and be done with it.

19 years agoFix another race in ^T. ttyprintf() can block, during which time the
Matthew Dillon [Mon, 17 May 2004 02:44:31 +0000 (02:44 +0000)]
Fix another race in ^T.  ttyprintf() can block, during which time the
pointers passed to it may become invalid.  An interrupt can unblock a
process making the p_wmesg (p_thread->td_wmesg) reference either invalid
or cause it to return NULL in between the check and the ttyprintf().

19 years agoINCSLINKS cannot be used to make softlinks within machine/ because
Matthew Dillon [Mon, 17 May 2004 01:03:54 +0000 (01:03 +0000)]
INCSLINKS cannot be used to make softlinks within machine/ because
buildworld's temporary include hierarchy uses a softlink into the source
tree for machine/ (so read only mounts of /usr/src would fail).

Instead, we will require that buildworld properly reference the include
files in their natural locations (e.g. <dev/video/...) and we fix the
softlinks in the make upgrade (upgrade_etc) target.

19 years agoRemove two mis-added .orig files.
Eirik Nygaard [Sun, 16 May 2004 09:22:31 +0000 (09:22 +0000)]
Remove two mis-added .orig files.

Approved-by: Matthew Dillon
19 years agoAdd an MLINK for KKASSERT(9).
Hiten Pandya [Sat, 15 May 2004 19:44:17 +0000 (19:44 +0000)]
Add an MLINK for KKASSERT(9).

19 years agoAdd dev/video/bktr and dev/video/meteor to the header file list.
Joerg Sonnenberger [Sat, 15 May 2004 18:12:01 +0000 (18:12 +0000)]
Add dev/video/bktr and dev/video/meteor to the header file list.
Add symlinks for the old locations of ioctl_meteor.h and ioctl_bt848.h.

19 years agoUpdate bktr(4) to FreeBSD current's version. This most importantly
Joerg Sonnenberger [Sat, 15 May 2004 17:54:13 +0000 (17:54 +0000)]
Update bktr(4) to FreeBSD current's version. This most importantly
includes a new msp driver based on the Linux Brooktree driver.

Add support for Terratec TValue submitted by Patrick Mauritz
<oxygene@studentenbude.ath.cx>.

The ioctl headers are moved into the MI dev/ tree, symlinks for
compatibiliy are added in a separate commit.

19 years agoTemporary switch cc3 to the old stabs debugging format to unbreak gdb5.
Joerg Sonnenberger [Sat, 15 May 2004 16:17:57 +0000 (16:17 +0000)]
Temporary switch cc3 to the old stabs debugging format to unbreak gdb5.
This can be removed once proper DWARF2 support works again in gdb5 or
gdb6 hits the tree.

19 years agoUpdate tcpdump to version 3.8.3
Eirik Nygaard [Sat, 15 May 2004 12:29:42 +0000 (12:29 +0000)]
Update tcpdump to version 3.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoUpdate libpcap to version 0.8.3
Eirik Nygaard [Sat, 15 May 2004 12:28:33 +0000 (12:28 +0000)]
Update libpcap to version 0.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoMerge from vendor branch TCPDUMP:
Eirik Nygaard [Sat, 15 May 2004 12:25:28 +0000 (12:25 +0000)]
Merge from vendor branch TCPDUMP:
Import of tcpdump 3.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoImport of tcpdump 3.8.3
Eirik Nygaard [Sat, 15 May 2004 12:25:28 +0000 (12:25 +0000)]
Import of tcpdump 3.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoMerge from vendor branch LIBPCAP:
Eirik Nygaard [Sat, 15 May 2004 12:19:49 +0000 (12:19 +0000)]
Merge from vendor branch LIBPCAP:
Import of libpcap 0.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoImport of libpcap 0.8.3
Eirik Nygaard [Sat, 15 May 2004 12:19:49 +0000 (12:19 +0000)]
Import of libpcap 0.8.3

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
19 years agoAdd a manual page which documents the generic hash routines, i.e.
Hiten Pandya [Fri, 14 May 2004 18:11:44 +0000 (18:11 +0000)]
Add a manual page which documents the generic hash routines, i.e.
hashinit(9) and phashinit(9).  Code references also provided.

Relevant MLINKs have been added.

19 years agoRemove an extra comma at the end of .Nm list.
Hiten Pandya [Fri, 14 May 2004 16:23:17 +0000 (16:23 +0000)]
Remove an extra comma at the end of .Nm list.

19 years agodevice switch 1/many: Remove d_autoq, add d_clone (where d_autoq was).
Matthew Dillon [Thu, 13 May 2004 23:49:26 +0000 (23:49 +0000)]
device switch 1/many: Remove d_autoq, add d_clone (where d_autoq was).

d_autoq was used to allow the device port dispatch to mix old-style synchronous
calls with new style messaging calls within a particular device.  It was never
used for that purpose.

d_clone will be more fully implemented as work continues.  We are going to
install d_port in the dev_t (struct specinfo) structure itself and d_clone
will be needed to allow devices to 'revector' the port on a minor-number
by minor-number basis, in particular allowing minor numbers to be directly
dispatched to distinct threads.  This is something we will be needing later
on.

19 years agosf_buf_ref() needs a critical section. Note that the function is not
Matthew Dillon [Thu, 13 May 2004 19:46:18 +0000 (19:46 +0000)]
sf_buf_ref() needs a critical section.  Note that the function is not
currently used.

Noticed-by: hmp
19 years agomalloc() flags cleanup and fixes. Get rid of M_NOWAIT in places where the
Matthew Dillon [Thu, 13 May 2004 19:44:33 +0000 (19:44 +0000)]
malloc() flags cleanup and fixes.  Get rid of M_NOWAIT in places where the
malloc must succeed for proper device operation to occur, replacing with
M_WAITOK or M_INTWAIT as appropriate.  Use M_ZERO instead of bzero().

19 years agoClose an interrupt race between vm_page_lookup() and (typically) a
Matthew Dillon [Thu, 13 May 2004 17:40:19 +0000 (17:40 +0000)]
Close an interrupt race between vm_page_lookup() and (typically) a
vm_page_sleep_busy() check by using the correct spl protection.
An interrupt can occur inbetween the two operations and unbusy/free
the page in question, causing the busy check to fail and for the code
to fall through and then operate on a page that may have been freed
and possibly even reused.   Also note that vm_page_grab() had the same
issue between the lookup, busy check, and vm_page_busy() call.

Close an interrupt race when scanning a VM object's memq.  Interrupts
can free pages, removing them from memq, which interferes with memq scans
and can cause a page unassociated with the object to be processed as if it
were associated with the object.

Calls to vm_page_hold() and vm_page_unhold() require spl protection.

Rename the passed socket descriptor argument in sendfile() to make the
code more readable.

Fix several serious bugs in procfs_rwmem().  In particular, force it to
block if a page is busy and then retry.

Get rid of vm_pager_map_pag() and vm_pager_unmap_page(), make the functions
that used to use these routines use SFBUF's instead.

Get rid of the (userland?) 4MB page mapping feature in pmap_object_init_pt()
for now.  The code appears to not track the page directory properly and
could result in a non-zero page being freed as PG_ZERO.

This commit also includes updated code comments and some additional
non-operational code cleanups.

19 years agoRemove DIAGNOSTIC elements that are no longer correct.
Matthew Dillon [Thu, 13 May 2004 17:24:49 +0000 (17:24 +0000)]
Remove DIAGNOSTIC elements that are no longer correct.

19 years agoAdd PCI IDs for i865 agpgart support.
Joerg Sonnenberger [Thu, 13 May 2004 14:33:14 +0000 (14:33 +0000)]
Add PCI IDs for i865 agpgart support.

Submitted-by: Patrick mauritz <oxygene@studentenbude.ath.cx>
19 years agosf_buf_free() requires a critical section to safely manipulate the free
Matthew Dillon [Thu, 13 May 2004 01:34:03 +0000 (01:34 +0000)]
sf_buf_free() requires a critical section to safely manipulate the free
list and possibly even the reference count field.  ( sf_buf_alloc() is
already using a critical section ).

19 years agoAdd a read-only sysctl for observing the maximum number of
Hiten Pandya [Thu, 13 May 2004 00:44:12 +0000 (00:44 +0000)]
Add a read-only sysctl for observing the maximum number of
available sf_bufs.

In the future, we could add another sysctl for observing
the number of sf_bufs in use.

19 years agoAttempting to access a device which has been destroyed, such as a UMASS
Matthew Dillon [Thu, 13 May 2004 00:23:39 +0000 (00:23 +0000)]
Attempting to access a device which has been destroyed, such as a UMASS
device which has been pulled out and detached from its /dev/daX entry,
panics the system.  This occurs because the device might not be immediately
(or ever) removed from the device hash after the device has been destroyed.
It's fields are cleared, leading to a NULL function call.

Fix the panic by installing a dummy cdevsw when the device is destroyed
rather then NULLing it out.

Reported-by: Sascha Wildner <saw@online.de>
19 years agoIn sodealloc(), use do_setopt_accept_filter() to free an accept filter
Hiten Pandya [Wed, 12 May 2004 20:21:21 +0000 (20:21 +0000)]
In sodealloc(), use do_setopt_accept_filter() to free an accept filter
instead of doing it manually.

19 years agoThree minor fixes:
Chris Pressey [Wed, 12 May 2004 01:48:40 +0000 (01:48 +0000)]
Three minor fixes:

- Add viddev definition for serial console support.
- In moused_start, run vidcontrol only once instead of (number of
/dev/ttyv* minus 1) times.  This gets rid of a slew of redundant
boot-time error messages.
- Add moused_stop routine to kill the mouse daemon and turn off the
mouse pointer when the 'stop' argument is specified.

Submitted-by: Sascha Wildner <saw@online.de>
Tested-by: walt <wa1ter@myrealbox.com>,
           YONETANI Tomokazu <qhwt+dragonfly-submit@les.ath.cx>

19 years agoReadd em_read_reg_io and em_write_reg_io for workarounds in various
Joerg Sonnenberger [Tue, 11 May 2004 22:55:15 +0000 (22:55 +0000)]
Readd em_read_reg_io and em_write_reg_io for workarounds in various
chip revision. This is a newbusifyed version of the original code.

19 years agoFix a bug in sys/pipe.c. xio_init_ubuf() might not be able to load up the
Matthew Dillon [Tue, 11 May 2004 22:48:53 +0000 (22:48 +0000)]
Fix a bug in sys/pipe.c.  xio_init_ubuf() might not be able to load up the
requested number of bytes even if the request is limited to XIO_INTERNAL_SIZE
if the user buffer base is not page-aligned.  XIO will set xio_bytes to the
actual size of the buffer.

Note that this bug was never exercised due to the 64KB pipe kmem buffer size
limit, so it could not have been the cause of recent problems.

Use kmem_alloc_nofault() instead of kmem_alloc_pageable() for the kmem
reservation.  This is more correct but should have no actual effect on
the system.