19 years agoif_xname support Part 2b/2: Convert remaining netif devices and implement full
Matthew Dillon [Tue, 6 Jan 2004 03:21:18 +0000 (03:21 +0000)]
if_xname support Part 2b/2: Convert remaining netif devices and implement full
support for if_xname.  Restructure struct ifnet in net/if_var.h, pulling in
a few minor additional changes from current including making if_dunit an int,
and making if_flags an int.

Submitted-by: Max Laier <max@love2party.net>
19 years agoif_xname support Part 2/2: Convert remaining netif devices and implement full
Matthew Dillon [Tue, 6 Jan 2004 03:17:28 +0000 (03:17 +0000)]
if_xname support Part 2/2: Convert remaining netif devices and implement full
support for if_xname.  Restructure struct ifnet in net/if_var.h, pulling in
a few minor additional changes from current including making if_dunit an int,
and making if_flags an int.

Submitted-by: Max Laier <max@love2party.net>
19 years agoif_xname support Part 1/2: Convert most of the netif devices to use
Matthew Dillon [Tue, 6 Jan 2004 01:40:51 +0000 (01:40 +0000)]
if_xname support Part 1/2: Convert most of the netif devices to use

Submitted-by: Max Laier <max@love2party.net>
19 years agoMaintain the fnmatch() API from FreeBSD-5 using an inline, rename the
Matthew Dillon [Tue, 6 Jan 2004 01:05:52 +0000 (01:05 +0000)]
Maintain the fnmatch() API from FreeBSD-5 using an inline, rename the
core fnmatch procedure to _fnmatch, and add a nesting count to it to avoid
stack overflows.  Also cleanup the syntax (mainly add braces and ansification).

19 years agoImport the libkern/fnmatch code from FreeBSD-5.
Matthew Dillon [Tue, 6 Jan 2004 00:56:49 +0000 (00:56 +0000)]
Import the libkern/fnmatch code from FreeBSD-5.

Submitted-by: Max Laier <max@love2party.net>
19 years agoWhen you attempt to kldload snd_sb16 and then unload it, the system crashes.
Matthew Dillon [Mon, 5 Jan 2004 20:23:53 +0000 (20:23 +0000)]
When you attempt to kldload snd_sb16 and then unload it, the system crashes.

the problem turns out to be in snd_pcm.  snd_sbc needs a dependancy on
snd_pcm.  Without it, if you load a module that depends on both snd_sbc and
snd_pcm (like snd_sb16), then later try to unload it, the system may
unload snd_pcm before snd_sbc causing a panic.

Reported-by: Galen Sampson <galen_sampson@yahoo.com>, esmith <esmith@patmedia.net>
19 years ago* Merge in changes from FreeBSD with some modification
David Rhodus [Mon, 5 Jan 2004 17:40:00 +0000 (17:40 +0000)]
* Merge in changes from FreeBSD with some modification
by drhodus.

date: 2003/12/02 07:57:20;  author: ps;  state: Exp;
After extensive QA cycles at 3ware, bring the driver in-line with all the
issues which they found and asked to be changed so 3ware can offcially
support the driver.

Summary of the most significant changes:

- TWE_OVERRIDE is no longer supported
- If twe_getparam failed, bogus data would be returned to the caller
- Cache the device unit in the twe_drive structure to aid debugging
- Add the 3ware driver version.
- Proper return error codes for many functions.
- Track the minimum queue length statistics
- 4.x compat: use the cached unit number from the twe_drive structure
  instead of the the cached si_drv2.  3ware found that after many loads
   and unloads that si_drv2 became corrupted.  This did not happen in

19 years ago* Add in some basic parameter values that we will use for
David Rhodus [Mon, 5 Jan 2004 17:36:20 +0000 (17:36 +0000)]
* Add in some basic parameter values that we will use for
synchronization of the device drivers.

19 years agoReplace the boring beastie with a dragonfly.
Jeroen Ruigrok/asmodai [Mon, 5 Jan 2004 16:34:52 +0000 (16:34 +0000)]
Replace the boring beastie with a dragonfly.

Submitted by: Aaron Malone <aaron@munge.net>

19 years agoAdd entry for the EHCI controller, pretty common these days (especially
Jeroen Ruigrok/asmodai [Mon, 5 Jan 2004 14:07:31 +0000 (14:07 +0000)]
Add entry for the EHCI controller, pretty common these days (especially
if you care about USB 2.0).

19 years agoRemove proc related extern's from sys/proc.h that are now static's inside
Matthew Dillon [Sun, 4 Jan 2004 22:14:39 +0000 (22:14 +0000)]
Remove proc related extern's from sys/proc.h that are now static's inside

Submitted-by: Peter Kadau <peter.kadau@tuebingen.mpg.de>
19 years ago * Remove the historical r in front of the old raw character devices in /dev
Eirik Nygaard [Sun, 4 Jan 2004 20:33:44 +0000 (20:33 +0000)]
 * Remove the historical r in front of the old raw character devices in /dev

Rerun `MAKEDEV all` in /dev after you have installed the new MAEKDEV script
to remove the old r* devices.

19 years ago * Remove the use of the kern.devname sysctl since it does not exist.
Eirik Nygaard [Sun, 4 Jan 2004 20:20:16 +0000 (20:20 +0000)]
 * Remove the use of the kern.devname sysctl since it does not exist.
 * K&R function removal

19 years ago * K&R function removal
Eirik Nygaard [Fri, 2 Jan 2004 18:19:49 +0000 (18:19 +0000)]
 * K&R function removal

19 years ago* Welcome the DragonFly project into to new year by bumping
David Rhodus [Thu, 1 Jan 2004 18:31:09 +0000 (18:31 +0000)]
* Welcome the DragonFly project into to new year by bumping
up the copyright year.

19 years agoFix a bug: remove an extra crit_enter() in the default waitport/waitmsg
Matthew Dillon [Thu, 1 Jan 2004 00:32:34 +0000 (00:32 +0000)]
Fix a bug: remove an extra crit_enter() in the default waitport/waitmsg

19 years agoRearrange an INVARIANTS overflow test so it works with more immediacy.
Matthew Dillon [Thu, 1 Jan 2004 00:31:46 +0000 (00:31 +0000)]
Rearrange an INVARIANTS overflow test so it works with more immediacy.

19 years agoGet EHCI to compile. This will make USB2.0 work when 'device ehci' is
Matthew Dillon [Thu, 1 Jan 2004 00:29:25 +0000 (00:29 +0000)]
Get EHCI to compile.  This will make USB2.0 work when 'device ehci' is
specified.  Note that USB2.0 support is not as good as USB1.x support,
but it does appear to work with my USB2.0 external hard drive.

19 years ago* Remove references to deprecated options.
David Rhodus [Wed, 31 Dec 2003 03:22:57 +0000 (03:22 +0000)]
* Remove references to deprecated options.

Sent in from: Kent Ibbetson <bsd@kibbet.com>

19 years agoBump the network interface cloning API to what is in 5.x with the following
Matthew Dillon [Tue, 30 Dec 2003 03:56:04 +0000 (03:56 +0000)]
Bump the network interface cloning API to what is in 5.x with the following
nice additions:

1) All if_unit allocations are handled in the cloner common case
removing a lot of (repetitive) code from callers as well as the rman.h

2) Initial device instances are created when the cloner is attached.

Submitted-by: Max Laier <max@love2party.net>
Testing-by: David Rhodus <drhodus@machdep.com>
19 years agoCleanup a DIAGNOSTIC test so LINT compiles.
Matthew Dillon [Tue, 30 Dec 2003 03:33:28 +0000 (03:33 +0000)]
Cleanup a DIAGNOSTIC test so LINT compiles.

Report-by: David Rhodus <drhodus@catpa.com>
19 years agoAdd idle entry halt vs spin statistics counters machdep.cpu_idle_*,
Matthew Dillon [Tue, 30 Dec 2003 03:19:04 +0000 (03:19 +0000)]
Add idle entry halt vs spin statistics counters machdep.cpu_idle_*,
Clear the reschedule flag in chooseproc() to prevent stale reschedule
requests from causing double-reschedules, and only disable HLT when a
system interrupt is pending (verses non critical process requests which
do not apply to the idle thread).

Problem focused in by: YONETANI Tomokazu <qhwt+dragonfly-kernel@les.ath.cx>

19 years agoThese files have been moved to bus/usb.
Matthew Dillon [Tue, 30 Dec 2003 01:04:04 +0000 (01:04 +0000)]
These files have been moved to bus/usb.

19 years agoBring in the entire FreeBSD-5 USB infrastructure. As of this commit my
Matthew Dillon [Tue, 30 Dec 2003 01:01:48 +0000 (01:01 +0000)]
Bring in the entire FreeBSD-5 USB infrastructure.  As of this commit my
USB camera, Hard Drive, Mouse, and Sony memory key all work and I can even
unplug and replug them in without crashing the port.

Not all drivers and subsystems compile as of this commit, but the ones that
do not are very close.

19 years agoAdd support for cam_calc_geometry(), from FreeBSD-5.
Matthew Dillon [Mon, 29 Dec 2003 23:31:00 +0000 (23:31 +0000)]
Add support for cam_calc_geometry(), from FreeBSD-5.

19 years agoAdd missing prototypes in last commit, other minor adjustments.
Matthew Dillon [Mon, 29 Dec 2003 23:09:30 +0000 (23:09 +0000)]
Add missing prototypes in last commit, other minor adjustments.

19 years agoGet rid of individual /* $xxx$ */ comments entirely (which was an artifact
Matthew Dillon [Mon, 29 Dec 2003 18:07:38 +0000 (18:07 +0000)]
Get rid of individual /* $xxx$ */ comments entirely (which was an artifact
of the original programmatic adding of the $DragonFly id), and just put all
the id's in one big comment.

19 years agominor syntax cleanup
Matthew Dillon [Mon, 29 Dec 2003 18:04:59 +0000 (18:04 +0000)]
minor syntax cleanup

19 years agoPrimarily add a missing lwkt_reltoken() in ntfs_ntput(), plus a little
Matthew Dillon [Mon, 29 Dec 2003 18:04:50 +0000 (18:04 +0000)]
Primarily add a missing lwkt_reltoken() in ntfs_ntput(), plus a little
cleanup.  Remove a few gettoken/reltoken pairs (depend on the MP lock more).
NTFS, as a non-critical filesystem, will eventually be serialized anyway.

From-panics-reported-by: Adam K Kirchhoff <adamk@voicenet.com>
19 years ago* Merge From FreeBSD
David Rhodus [Mon, 29 Dec 2003 16:00:01 +0000 (16:00 +0000)]
* Merge From FreeBSD

deischen    2003/12/29 07:18:01 PST

  FreeBSD src repository

  Modified files:        (Branch: RELENG_4)
    lib/libc_r/uthread   uthread_write.c
  MFC: In the wrapped write(), return if the syscall write() returns 0.

  PR:     59291

19 years ago* Merge From FreeBSD
David Rhodus [Mon, 29 Dec 2003 15:04:13 +0000 (15:04 +0000)]
* Merge From FreeBSD

yar         2003/12/29 06:24:58 PST

  FreeBSD src repository

  Modified files:        (Branch: RELENG_4)
    sys/netgraph         ng_pppoe.c
  MFC: Fix the DoS condition triggered by a non-standard PPPoE frame.

19 years ago* Add ending comment to line as to avoid warning messages.
David Rhodus [Mon, 29 Dec 2003 14:45:36 +0000 (14:45 +0000)]
* Add ending comment to line as to avoid warning messages.

19 years agoFix the peripheral list scan code, which was broken when the new linker set
Matthew Dillon [Mon, 29 Dec 2003 08:37:38 +0000 (08:37 +0000)]
Fix the peripheral list scan code, which was broken when the new linker set
code was brought in.  This caused camcontrol, cdrecord, and other cam-using
entities to be unable to lookup SCSI devices by bus:target:lun.

19 years agoSynchronize the USB, CAM, and TASKQUEUE subsystems with FreeBSD RELENG_4.
Matthew Dillon [Mon, 29 Dec 2003 06:42:22 +0000 (06:42 +0000)]
Synchronize the USB, CAM, and TASKQUEUE subsystems with FreeBSD RELENG_4.
Also update the $FreeBSD$ ids in the files to the synchronized rev numbers.

This has the side effect of bringing in some additional SCSI robustness
checks, bug fixes, quirk inheritance between subsystems (e.g. USB now sets
PIM_NO_6_BYTE by default and CAM now understands it).

This also brings in a huge amount of SCSI CD code that had been MFCd to
FreeBSD-4 from FreeBSD-5.

19 years agoMost motherboards these days have at least two USB controllers. Adjust
Matthew Dillon [Mon, 29 Dec 2003 04:02:43 +0000 (04:02 +0000)]
Most motherboards these days have at least two USB controllers.  Adjust
MAKEDEV all to create devices for two controllers instead of one.

19 years agoFreeBSD-5.x removed the 'read interrupt arrived early' check code, for
Matthew Dillon [Mon, 29 Dec 2003 03:42:43 +0000 (03:42 +0000)]
FreeBSD-5.x removed the 'read interrupt arrived early' check code, for
undocumented reasons.  As far as I can tell, only the ATA_S_READY bit needs
to be set when a read interrupt arrives for a PIO read operation so reduce
the test from ATA_S_READY|ATA_S_DSC|ATA_S_DRQ to just ATA_S_READY.

Change the ATA RESET timing.  Instead of polling up to 310000 times in 100uS
intervals poll 3100 times in 10000uS intervals.  Note that 5.x polls 310
times in 100ms intervals, which is silly (an unnecessarily long polling

Add a mandatory 50ms delay after all BUSY bits have been released.  Some
ATA devices release BUSY before they are ready to accept commands.  Note
that the ATA code waits 100ms after releasing RESET, before checking BUSY,
which is probably overkill, but this does not cover the mandatory delay
that must occur after BUSY is observed to have been released.

(This patch primarily removes bogus 'read interrupt arrived early' warnings
on the console for things like CF card IDE adapters and other badly designed
IDE devices).

19 years agoBackgroundable NFS mounts can still cause a boot sequence to stall for
Matthew Dillon [Mon, 29 Dec 2003 00:07:44 +0000 (00:07 +0000)]
Backgroundable NFS mounts can still cause a boot sequence to stall for
several minutes or longer if DNS services are not available during boot.
The stall time depends on the state of the network, DNS, ethernet and arp
timeouts, and the number of backgroundable NFS mounts.

Furthermore, temporary DNS failures caused NFS mounts (foreground or
background) to permanently fail and exit, which will likely result in
inconsistent system state after booting completes if DNS services or the
network is down during boot.  This case is most likely to occur when
multiple machines boot simultaniously after recovering from a power outage.

Adjust foreground timeouts for 'bg' optioned NFS mounts to 1 second and reduce
the retry sleep() from 60 seconds to 20 seconds.  60 seconds is ridiculously
long even if you had a hundred machines with dozens of backgrounded nfs mounts
all trying to mount at the same time.  Do not exit on temporary DNS
failures, and if a warning is generated for an earlier failure generate
another warning if the mount later succeeds rather then silence (which might
be misinterpreted in the logs as the mount having failed).

19 years agoTry to catch mbuf cluster mclfree list corruption a little earlier with
Matthew Dillon [Sun, 28 Dec 2003 06:11:33 +0000 (06:11 +0000)]
Try to catch mbuf cluster mclfree list corruption a little earlier with

19 years ago* Change __guard back into a multi-character int
David Rhodus [Sun, 28 Dec 2003 05:05:59 +0000 (05:05 +0000)]
*       Change __guard back into a multi-character int

Pointed out by Matt Dillon <dillon@backplane.com>

19 years agoThe attribution for the last commit was incorrect, it should have been:
Matthew Dillon [Sat, 27 Dec 2003 23:58:40 +0000 (23:58 +0000)]
The attribution for the last commit was incorrect, it should have been:

Requested-by: Peter Kadau <peter.kadau@tuebingen.mpg.de>
19 years ago* Implement POSIX (XSI)'s header file re_comp.h
David Rhodus [Sat, 27 Dec 2003 19:29:32 +0000 (19:29 +0000)]
* Implement POSIX (XSI)'s header file re_comp.h

19 years ago* Merge From FreeBSD
David Rhodus [Sat, 27 Dec 2003 19:23:02 +0000 (19:23 +0000)]
* Merge From FreeBSD

Revision 1.116 by truckman

Tweak the calculation of minbfree in ffs_dirpref() so that only
those cylinder groups that have at least 75% of the average free
space per cylinder group for that file system are considered as
candidates for the creation of a new directory.  The previous formula
for minbfree would set it to zero if the file system was more than
75% full, which allowed cylinder groups with no free space at all
to be chosen as candidates for directory creation, which resulted
in an expensive search for free blocks for each file that was
subsequently created in that directory.

Modify the calculation of minifree in the same way.

Decrease maxcontigdirs as the file system fills to decrease the
likelyhood that a cluster of directories will overflow the available
space in a cylinder group

19 years agoAdd a p_sched field to accomodate Adam K Kirchhoff's scheduler work. This
Matthew Dillon [Sat, 27 Dec 2003 19:21:05 +0000 (19:21 +0000)]
Add a p_sched field to accomodate Adam K Kirchhoff's scheduler work.  This
will eventually turn into a loadable scheduler module API.

Requested-by: Adam K Kirchhoff <adamk@voicenet.com>
19 years ago* Merge From FreeBSD
David Rhodus [Sat, 27 Dec 2003 17:49:38 +0000 (17:49 +0000)]
* Merge From FreeBSD

ceri        2003/12/27 09:32:13 PST

  FreeBSD src repository (doc committer)

Modified files:        (Branch: RELENG_4)
bin/ls               util.c
MFC revision 1.32:

Add the -m, -w and -x options to ls's usage message.

PR:             51493
Submitted by:   Walter Belgers
MFC after:      1 month

19 years agoMerge from FreeBSD:
Jeffrey Hsu [Sat, 27 Dec 2003 05:13:32 +0000 (05:13 +0000)]
Merge from FreeBSD:

alc         2003/12/26 13:54:45 PST

  FreeBSD src repository

  Modified files:
    sys/vm               vm_map.c
  Minor correction to revision 1.258: Use the proc pointer that is passed to
  vm_map_growstack() in the RLIMIT_VMEM check rather than curthread.

  Revision  Changes    Path
  1.324     +1 -2      src/sys/vm/vm_map.c

19 years ago* Add the pst(4) driver to the GENERIC kernel build.
David Rhodus [Sat, 27 Dec 2003 03:17:21 +0000 (03:17 +0000)]
* Add the pst(4) driver to the GENERIC kernel build.
Should be helpful if someone is trying to install
DragonFly on a Promise controller card.

19 years ago* Cleanup compiler warnings and other style cleaning while here.
David Rhodus [Sat, 27 Dec 2003 03:12:56 +0000 (03:12 +0000)]
* Cleanup compiler warnings and other style cleaning while here.

19 years ago* Add the POSIX.1-2001 header file <cpio.h>
David Rhodus [Sat, 27 Dec 2003 02:17:01 +0000 (02:17 +0000)]
* Add the POSIX.1-2001 header file <cpio.h>
The cpio archive values.

19 years agoPatch to make the P4S8X run in ATA100 mode. This is a compromise, since
Matthew Dillon [Thu, 25 Dec 2003 07:16:35 +0000 (07:16 +0000)]
Patch to make the P4S8X run in ATA100 mode.  This is a compromise, since
both the mainboard and the hard drive support ATA133 mode, but there doesn't
seem to be much difference between ATA100 and ATA133 even on FreeBSD-current.

Submitted-by: YONETANI Tomokazu <qhwt@les.ath.cx>
19 years ago* Sync Changes over from FreeBSD
David Rhodus [Tue, 23 Dec 2003 20:07:43 +0000 (20:07 +0000)]
* Sync Changes over from FreeBSD

19 years agoMerge from FreeBSD rev 1.43 (original commit made by tjr@FreeBSD.org).
Jeffrey Hsu [Mon, 22 Dec 2003 17:41:08 +0000 (17:41 +0000)]
Merge from FreeBSD rev 1.43 (original commit made by tjr@FreeBSD.org).
Widen local variable "oldsize" to 64 bits to match the 64-bit "n_size"
field in struct smbnode.

19 years ago* Update Sendmail to version 8.12.10
David Rhodus [Mon, 22 Dec 2003 04:04:24 +0000 (04:04 +0000)]
* Update Sendmail to version 8.12.10

19 years ago * Fix typo: becuase -> because
Eirik Nygaard [Sun, 21 Dec 2003 12:34:08 +0000 (12:34 +0000)]
 * Fix typo: becuase -> because

19 years agoMerge from FreeBSD:
Jeffrey Hsu [Sun, 21 Dec 2003 06:31:59 +0000 (06:31 +0000)]
Merge from FreeBSD:

revision 1.177
date: 2003/12/21 06:03:40;  author: alc;  state: Exp;  lines: +1 -1
 - Correct an error in mincore(2) that has existed since its introduction:
   mincore(2) should check that the page is valid, not just allocated.
   Otherwise, it can return a false positive for a page that is not yet
   resident because it is being read from disk.

19 years agoMinor syntax cleanup.
Matthew Dillon [Sat, 20 Dec 2003 05:58:30 +0000 (05:58 +0000)]
Minor syntax cleanup.

19 years agoFix a syscall separation bug in recvfrom() which sometimes dereferenced
Matthew Dillon [Sat, 20 Dec 2003 05:53:59 +0000 (05:53 +0000)]
Fix a syscall separation bug in recvfrom() which sometimes dereferenced
a NULL pointer.

19 years agoUSER_LDT is now required by a number of packages as well as our upcoming
Matthew Dillon [Sat, 20 Dec 2003 05:52:27 +0000 (05:52 +0000)]
USER_LDT is now required by a number of packages as well as our upcoming
user threads support.  Make it non-optional.

USER_LDT breaks SysV emulated sysarch(... SVR4_SYSARCH_DSCR) support.
For now just #if 0 out the support (which is what FreeBSD-5.x does).

Submitted-by: Craig Dooley <craig@xlnx-x.net>
19 years agoFix a memory leak that occurs when an attempt is made to checkpoint
Matthew Dillon [Sat, 20 Dec 2003 04:07:03 +0000 (04:07 +0000)]
Fix a memory leak that occurs when an attempt is made to checkpoint
an suid/sgid program.

Reported-by: Ted Unangst <tedu@zeitbombe.org>
19 years ago* Try and match README guideline better.
David Rhodus [Thu, 18 Dec 2003 19:46:09 +0000 (19:46 +0000)]
* Try and match README guideline better.

19 years ago* GBK locale directories
David Rhodus [Thu, 18 Dec 2003 19:27:05 +0000 (19:27 +0000)]
* GBK locale directories

Obtained from: FreeBSD

19 years ago* Add GB18030 directories.
David Rhodus [Thu, 18 Dec 2003 19:25:14 +0000 (19:25 +0000)]
* Add GB18030 directories.

19 years ago* Print out a warning if /dev/null doesn't exist.
David Rhodus [Thu, 18 Dec 2003 04:12:38 +0000 (04:12 +0000)]
* Print out a warning if /dev/null doesn't exist.

Commented on by: Matt Dillon

19 years agoSupport multicast on the Marvell Yukon Chipset. The GMAC on the Yukon
Matthew Dillon [Wed, 17 Dec 2003 22:18:24 +0000 (22:18 +0000)]
Support multicast on the Marvell Yukon Chipset.  The GMAC on the Yukon
uses a different hash algorithm then the XMAC on the Genesis.  GMAC
algorithm snarfed from Linux.

Submitted-by: Jung-uk Kim <jkim@niksun.com>
Patch-Written-by: Keith Mitchell <kmitch@guru.org>
19 years agoImprove device identification strings.
Hiten Pandya [Tue, 16 Dec 2003 18:32:58 +0000 (18:32 +0000)]
Improve device identification strings.

Obtained from: FreeBSD

19 years ago * Let mergemaster look for make.conf in the correct path.
Eirik Nygaard [Tue, 16 Dec 2003 15:03:51 +0000 (15:03 +0000)]
 * Let mergemaster look for make.conf in the correct path.

Submitted-by: Erik Paulsen Skaalerud <erik@pentadon.com>
19 years agoMake savecore return RC_CONFIGURED unconditionally.
Matthew Dillon [Sun, 14 Dec 2003 19:13:15 +0000 (19:13 +0000)]
Make savecore return RC_CONFIGURED unconditionally.

Make the swap code return RC_CONFIGURED and also add a sysctl check
to determine if the kernel supports swapping.

Submitted-by: Peter Kadau <peter.kadau@tuebingen.mpg.de>
19 years agouse the proper $RC_ variable when returning irrelevancy.
Matthew Dillon [Sat, 13 Dec 2003 03:02:20 +0000 (03:02 +0000)]
use the proper $RC_ variable when returning irrelevancy.

19 years agoAdd an 'enable' and 'disable' target to rcrun, and add softlink shortcuts
Matthew Dillon [Sat, 13 Dec 2003 02:49:09 +0000 (02:49 +0000)]
Add an 'enable' and 'disable' target to rcrun, and add softlink shortcuts
for 'rcenable' and 'rcdisable'.  These functions will modify rcrun-generated
entries in /etc/rc.conf.  They will not delete any manual entries in rc.conf
even if the manual entry is being overriden.

Add additional states to the varsym vars and make rc.subr and rcrun aware
of them.  The states are now:

    running failed disabled irrelevant configured stopped

19 years agoMinor grammatical fix.
Matthew Dillon [Fri, 12 Dec 2003 19:50:07 +0000 (19:50 +0000)]
Minor grammatical fix.

Submitted-by: Dave Leimbach <leimySPAM2k@mac.com>
19 years agoAdd another special return code, 3, which means 'subsystem is not
Matthew Dillon [Fri, 12 Dec 2003 19:49:04 +0000 (19:49 +0000)]
Add another special return code, 3, which means 'subsystem is not
relevant' and make dhclient use it when no dhcp interfaces are specified.
At the moment the varsym is set to 'running' until the rcrun script can
be cleaned up to support another state.

19 years ago * Indentation cleanup
Eirik Nygaard [Fri, 12 Dec 2003 16:03:48 +0000 (16:03 +0000)]
 * Indentation cleanup

19 years agoBe smarter about services which are in a disabled state. If the
Matthew Dillon [Fri, 12 Dec 2003 00:14:28 +0000 (00:14 +0000)]
Be smarter about services which are in a disabled state.  If the
service is disabled, first try to run the RCNG script.  If it is still
disabled report the fact (the user needs to use rcforce to run a disabled

19 years agoMake a distinction between disabled entries and running entries. Do not
Matthew Dillon [Fri, 12 Dec 2003 00:00:10 +0000 (00:00 +0000)]
Make a distinction between disabled entries and running entries.  Do not
start disabled services.  Still TODO: add 'enable' and 'disable' commands
which modify /etc/rc.conf!

19 years agoOops, forgot the rc.subr update
Matthew Dillon [Thu, 11 Dec 2003 23:56:42 +0000 (23:56 +0000)]
Oops, forgot the rc.subr update

19 years agoAdd /sbin/rcrun and symlinks rcstart, rcstop, rcrestart, rcvar, rclist,
Matthew Dillon [Thu, 11 Dec 2003 23:56:05 +0000 (23:56 +0000)]
Add /sbin/rcrun and symlinks rcstart, rcstop, rcrestart, rcvar, rclist,
rcforce, and rcfast.

19 years agoAdjust rc.subr to generate system-wide varsyms tracking RCNG operations.
Matthew Dillon [Thu, 11 Dec 2003 23:28:41 +0000 (23:28 +0000)]
Adjust rc.subr to generate system-wide varsyms tracking RCNG operations.
This will allow us to support run-time dependancy management.

Have dummy rc files (that exist just to specify dependancies) call a dummy
command routine which will set the appropriate varsym variables representing
the keywords they provide.

19 years agoAdd a -p option to rcorder which generates the PROVIDE keywords for the
Matthew Dillon [Thu, 11 Dec 2003 22:08:31 +0000 (22:08 +0000)]
Add a -p option to rcorder which generates the PROVIDE keywords for the
specified files.

Change the -o option to rcorder to take a keyword rather then a filename.
It then generates an ordered set of RC files to run to achieve activation
of the keyword.

19 years agoAdd the -o file option to rcorder. This will cause rcorder to generate
Matthew Dillon [Thu, 11 Dec 2003 20:50:21 +0000 (20:50 +0000)]
Add the -o file option to rcorder.  This will cause rcorder to generate
the dependancy list required to execute a particular file.

19 years agoDo not print out error messages in quiet mode to make shell scriptiong
Matthew Dillon [Thu, 11 Dec 2003 20:33:49 +0000 (20:33 +0000)]
Do not print out error messages in quiet mode to make shell scriptiong
with varsym easier.

19 years agoPull the sf_buf routines and structures out into its own files in
Jeffrey Hsu [Wed, 10 Dec 2003 23:48:07 +0000 (23:48 +0000)]
Pull the sf_buf routines and structures out into its own files in
anticipation of wider future use.

Requested and reviewed by: dillon

19 years agoMore cleanups to make ports work better.
Matthew Dillon [Wed, 10 Dec 2003 22:41:20 +0000 (22:41 +0000)]
More cleanups to make ports work better.

19 years agoAdd -fstack-protector support for the kernel.
Matthew Dillon [Wed, 10 Dec 2003 22:27:27 +0000 (22:27 +0000)]
Add -fstack-protector support for the kernel.


Submitted-by: Ryan Dooley <dooleyr@missouri.edu>
19 years agoThis patch improves the performance of sendfile(2). It adds a hash
Jeffrey Hsu [Wed, 10 Dec 2003 22:26:19 +0000 (22:26 +0000)]
This patch improves the performance of sendfile(2).  It adds a hash
table of active sf_buf mappings to ensure there is exactly one
(ref-counted) sf_buf for each vm_page.  This saves on the number
of sf_bufs used when sendfile(2) sends the same file over and over
again to multiple connections simultaneously.  It also does lazy
updates on the hw page table when a sf_buf ref count goes to zero,
placing them on a freelist instead, in effect, making sf_bufs a
cache of virtual-to-physical translations with LRU replacement on
the inactive sf_bufs.  Finally, it does a wakeup_one() instead of
a broadcast wakeup() when a free sf_buf becomes available.

This patch roughly corresponds to FreeBSD revs 1.219 and 1.220 of

  revision 1.219
  date: 2003/11/17 18:22:24;  author: alc;  state: Exp;  lines: +48 -26
  Change the i386's sf_buf implementation so that it never allocates
  more than one sf_buf for one vm_page.  To accomplish this, we add
  a global hash table mapping vm_pages to sf_bufs and a reference
  count to each sf_buf.  (This is similar to the patches for RELENG_4
  at http://www.cs.princeton.edu/~yruan/debox/.)

  For the uninitiated, an sf_buf is nothing more than a kernel virtual
  address that is used for temporary virtual-to-physical mappings by
  sendfile(2) and zero-copy sockets.  As such, there is no reason for
  one vm_page to have several sf_bufs mapping it.  In fact, using more
  than one sf_buf for a single vm_page increases the likelihood that
  sendfile(2) blocks, hurting throughput.
  (See http://www.cs.princeton.edu/~yruan/debox/.)

  revision 1.220
  date: 2003/12/07 22:49:25;  author: alc;  state: Exp;  lines: +10 -9
  Don't remove the virtual-to-physical mapping when an sf_buf is freed.
  Instead, allow the mapping to persist, but add the sf_buf to a free list.
  If a later sendfile(2) or zero-copy send resends the same physical page,
  perhaps with the same or different contents, then the mapping overhead is
  avoided and the sf_buf is simply removed from the free list.

  In other words, the i386 sf_buf implementation now behaves as a cache of
  virtual-to-physical translations using an LRU replacement policy on
  inactive sf_bufs.  This is similar in concept to a part of
  http://www.cs.princeton.edu/~yruan/debox/ patch, but much simpler in
  implementation.  Note: none of this is required on alpha, amd64, or ia64.
  They now use their direct virtual-to-physical mapping to avoid any
  emphemeral mapping overheads in their sf_buf implementations.

Reviewed by: dillon

19 years agoAdd -fstack-protector and -fno-stack-protector support to GCC. Note
Matthew Dillon [Wed, 10 Dec 2003 22:25:08 +0000 (22:25 +0000)]
Add -fstack-protector and -fno-stack-protector support to GCC.  Note
that the default is set to no protection (what it was before).  See:


Submitted-by: Ryan Dooley <dooleyr@missouri.edu>
19 years agoAdd libc support for propolice. See:
Matthew Dillon [Wed, 10 Dec 2003 22:15:36 +0000 (22:15 +0000)]
Add libc support for propolice.  See:


Submitted-by: Ryan Dooley <dooleyr@missouri.edu>
19 years agoAdd strlcpy and strlcat to libkern
Matthew Dillon [Wed, 10 Dec 2003 00:29:26 +0000 (00:29 +0000)]
Add strlcpy and strlcat to libkern

19 years ago* Add a part of the AGP update that was missed.
David Rhodus [Tue, 9 Dec 2003 23:43:36 +0000 (23:43 +0000)]
* Add a part of the AGP update that was missed.
This also fixes the kernel compile.

19 years agoThis patch adds a bunch of stuff from FreeBSD5. It consistantly makes
Matthew Dillon [Tue, 9 Dec 2003 19:40:56 +0000 (19:40 +0000)]
This patch adds a bunch of stuff from FreeBSD5.  It consistantly makes
vendor specific drivers depend on agp, consistantly checks the gart size
!= 0, changes agp_generic_enable to the FreeBSD5 function, initializing
the device as v2 or v3 accordingly, syncs up agpio.h, and adds a couple
PCI Ids from FreeBSD5.

Submitted-by: Craig Dooley <cd5697@albany.edu>
19 years ago * Merge fixes from libc to libcr.
Eirik Nygaard [Mon, 8 Dec 2003 13:56:36 +0000 (13:56 +0000)]
 * Merge fixes from libc to libcr.

19 years agoPCI compat cleanup, part 1. This brings in the LNC and VX drivers
Matthew Dillon [Sun, 7 Dec 2003 19:23:40 +0000 (19:23 +0000)]
PCI compat cleanup, part 1.  This brings in the LNC and VX drivers
from FreeBSD-5.  They are not the newest versions, just new enough to
use newbus, not the PCI compat code.

Submitted-by: Joerg Sonnenberger <joerg@britannica.bec.de>
19 years agoConvert alpm to use the devmethod code.
Matthew Dillon [Sun, 7 Dec 2003 18:22:09 +0000 (18:22 +0000)]
Convert alpm to use the devmethod code.

Submitted-by: Joerg Sonnenberger <joerg@britannica.bec.de>
19 years agoThread testing code for libcaps.
Matthew Dillon [Sun, 7 Dec 2003 04:26:41 +0000 (04:26 +0000)]
Thread testing code for libcaps.

19 years agoMajor update to libcaps. Implement support for virtual cpus using
Matthew Dillon [Sun, 7 Dec 2003 04:21:54 +0000 (04:21 +0000)]
Major update to libcaps.  Implement support for virtual cpus using
rfork_thread() and implement IPIs, per-virtual-cpu globaldata areas,
and per-virtual-cpu LWKT scheduling.

19 years agoAdd additional functionality to the upcall support to allow us to wait for
Matthew Dillon [Sun, 7 Dec 2003 04:20:40 +0000 (04:20 +0000)]
Add additional functionality to the upcall support to allow us to wait for
an upcall instead of spin.

Also fix a bug in the trap code.  %gs faults have to be handled in nested
interrupts because %gs is not saved and restored.  It is also possible that
%fs may have to be handled the same way, but I am not sure yet.

19 years agoAdjust a comment.
Matthew Dillon [Sun, 7 Dec 2003 02:14:20 +0000 (02:14 +0000)]
Adjust a comment.

19 years agoModify the upcall code to access the critical count via the current thread
Matthew Dillon [Sun, 7 Dec 2003 01:17:53 +0000 (01:17 +0000)]
Modify the upcall code to access the critical count via the current thread
rather then embedding the critical count in the upcall structure.

19 years agoMinor cleanups to sysport. Use ms_msgsize in the sendsys() call.
Matthew Dillon [Sat, 6 Dec 2003 20:11:44 +0000 (20:11 +0000)]
Minor cleanups to sysport.  Use ms_msgsize in the sendsys() call.

Submitted-by: Galen Sampson <galen_sampson@yahoo.com>
19 years ago* Remove a few extra $FreeBSD$ tags
David Rhodus [Sat, 6 Dec 2003 03:11:36 +0000 (03:11 +0000)]
* Remove a few extra $FreeBSD$ tags
* Fix a few mis-spellings

19 years agoMajor libcaps work to support userland threading. Stage 1/2.
Matthew Dillon [Thu, 4 Dec 2003 22:06:22 +0000 (22:06 +0000)]
Major libcaps work to support userland threading.  Stage 1/2.
Hook the system's upcall mechanism into the globaldata structure
and hook up the LWKT thread switching primitives.  Integrate the
mp_lock code from DragonFly into libcaps to serve as a master lock
for userland threading as well (it turns out that the BGL support in
DragonFly could be trivially ported to the userland threading code).

Still todo: hook up critical section handling, deal with FP regs,
hook up rfork support for multiple virtual cpu's via the upcall mechanism,
and testing of same.

Work by: Galen Sampson <galen_sampson@yahoo.com> and
 Matthew Dillon <dillon@backplane.com>

19 years agoAugment the upcall system calls to support a priority mechanism rather then
Matthew Dillon [Thu, 4 Dec 2003 20:35:09 +0000 (20:35 +0000)]
Augment the upcall system calls to support a priority mechanism rather then
just a pending mechanism.  When dispatching or polling for an upcall the
data field is used to supply a priority which will be compared against
the userland crit_count.