dragonfly.git
18 years agoUse TARGET_LIBDIR variables instead of overriding LIBDIR.
Joerg Sonnenberger [Thu, 28 Jul 2005 19:43:55 +0000 (19:43 +0000)]
Use TARGET_LIBDIR variables instead of overriding LIBDIR.

18 years agoInstead of overriding LIBDIR, override the new TARGET_LIBDIR variables.
Joerg Sonnenberger [Thu, 28 Jul 2005 19:25:41 +0000 (19:25 +0000)]
Instead of overriding LIBDIR, override the new TARGET_LIBDIR variables.
This allows the normal dependency handling to be readded.

18 years agoEliminate USEGNUDIR and instead allow the target directory to be
Joerg Sonnenberger [Thu, 28 Jul 2005 19:19:47 +0000 (19:19 +0000)]
Eliminate USEGNUDIR and instead allow the target directory to be
specified directly.

18 years agoThere is a case when B_VMIO is clear where a buffer can be placed on the
Matthew Dillon [Thu, 28 Jul 2005 18:15:09 +0000 (18:15 +0000)]
There is a case when B_VMIO is clear where a buffer can be placed on the
EMPTY or EMPTYKVA queues without being disassociated from its vnode.
This can lead to a duplicate logical block panic in the red-black tree code.
Rework brelse() to ensure that buffers are properly cleaned up before being
placed on said queues, and add assertions to validate other cases.

Reported-by: Tomaz Borstnar
18 years agoIf multiple processes are being traced and some other process has a write
Matthew Dillon [Thu, 28 Jul 2005 18:10:23 +0000 (18:10 +0000)]
If multiple processes are being traced and some other process has a write
error, the vnode ref that we rely on from p_tracep can get ripped out from
under us, causing a panic.  vref() a the ktrace vnode for the duration of
the write rather then relying on the ref from p_tracep.

18 years agoRemove break after return.
Joerg Sonnenberger [Thu, 28 Jul 2005 16:57:09 +0000 (16:57 +0000)]
Remove break after return.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoWhile setting up a transmit packet disable interupts on the card then
Joerg Sonnenberger [Thu, 28 Jul 2005 16:56:37 +0000 (16:56 +0000)]
While setting up a transmit packet disable interupts on the card then
re-enable them after we are done setting up the packet.  This seems to
fix the MPI350 newer firmware hangs.

Obtained-from: FreeBSD (if_an.c, 1.2.2.16)
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoSync with FreeBSD(if_an.c 1.2.2.15, if_aironet_ieee.h 1.1.2.9)
Joerg Sonnenberger [Thu, 28 Jul 2005 16:55:17 +0000 (16:55 +0000)]
Sync with FreeBSD(if_an.c 1.2.2.15, if_aironet_ieee.h 1.1.2.9)

- Bump up the general and status RID sizes
- Clear out an_dma_vaddr on free so we can test to see if dma is
  setup when the card is kldunloaded/kldloaded etc. only for MPI350
- Notify on RID read overflow and truncate this currently causes
  a panic in -stable when the stack during an ifconfig an0 is done
  with newer firmware

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoSync with FreeBSD(if_anreg.h 1.1.2.9, if_an.c 1.2.2.14 and
Joerg Sonnenberger [Thu, 28 Jul 2005 16:52:44 +0000 (16:52 +0000)]
Sync with FreeBSD(if_anreg.h 1.1.2.9, if_an.c 1.2.2.14 and
if_aironet_ieee.h 1.1.2.8)

- Add support for Cisco latest firmware RID sizes that supports 25
SSIDs!
- Fix up TX speed changes.
- Make mpi-350 cards sort-of work with new firmware.  It RXs okay but
TXs only work for about 14 packets then fails to get an interrupt.
The TX watchdog fires.  It has been reported that my hack for now
doesn't break cards with the older firmware.  It appears my card has
lost the ability to RX or TX at all but other peoples cards work.  I
assume it got damaged in tansport.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoRemove unnecessary initialisations. Return ENXIO instead of 1 in
Joerg Sonnenberger [Thu, 28 Jul 2005 16:33:25 +0000 (16:33 +0000)]
Remove unnecessary initialisations. Return ENXIO instead of 1 in
an_pccard_probe. Separate error path and normal normal return in
ac_pccard_attach. GC AN_PCI_PLX_LOIO. Don't mess with PCI controll
register, it's already down by the PCI layer.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
In addition, reverse the return value of an_probe. It doesn't make sense
to return 0 on failure, if the callee are interested only in the error,
not the success code.

18 years agoUse pcidevs and common PCI probe style.
Joerg Sonnenberger [Thu, 28 Jul 2005 16:22:59 +0000 (16:22 +0000)]
Use pcidevs and common PCI probe style.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoAdd some useful GDB macros that have been sitting in my local tree,
Hiten Pandya [Thu, 28 Jul 2005 15:48:56 +0000 (15:48 +0000)]
Add some useful GDB macros that have been sitting in my local tree,
used for displaying mount structures, lsvfs, and vfsops iteration.

18 years agoRemove useless .PATH entries inherited from FreeBSD.
Joerg Sonnenberger [Thu, 28 Jul 2005 00:06:10 +0000 (00:06 +0000)]
Remove useless .PATH entries inherited from FreeBSD.

18 years agoFactor out an_detach, since the implementation for all busses is
Joerg Sonnenberger [Wed, 27 Jul 2005 21:56:32 +0000 (21:56 +0000)]
Factor out an_detach, since the implementation for all busses is
(almost) identical. Remove useless .PATH.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
18 years agoFix typo.
David Rhodus [Wed, 27 Jul 2005 18:26:28 +0000 (18:26 +0000)]
Fix typo.

18 years agocvtstat doesn't exist.
Joerg Sonnenberger [Wed, 27 Jul 2005 15:56:18 +0000 (15:56 +0000)]
cvtstat doesn't exist.

18 years agoMerge revision 1.38 from FreeBSD:
Joerg Sonnenberger [Wed, 27 Jul 2005 14:35:55 +0000 (14:35 +0000)]
Merge revision 1.38 from FreeBSD:
Remove advertising clause from University of California Regent's
license,
per letter dated July 22, 1999.

Approved by: core

18 years agoFix typo.
Joerg Sonnenberger [Wed, 27 Jul 2005 14:31:11 +0000 (14:31 +0000)]
Fix typo.

Found-by: corecode
18 years agoAdd a missing crit_exit().
Matthew Dillon [Wed, 27 Jul 2005 07:55:15 +0000 (07:55 +0000)]
Add a missing crit_exit().

Found-by: Tomaz Borstnar using DEBUG_CRIT_SECTIONS
18 years agoFreeBSD and NetBSD both use derivates of Sun's math library. On FreeBSD,
Joerg Sonnenberger [Tue, 26 Jul 2005 21:15:20 +0000 (21:15 +0000)]
FreeBSD and NetBSD both use derivates of Sun's math library. On FreeBSD,
it's been put into lib/msun, on NetBSD it is under lib/libm. Since
DragonFly misses a lot of the changes which went into both and I
consider the NetBSD version cleaner, switch to that.

Biggest difference to NetBSD is the omission of wrappers for non-IEEE757
floating point support. There's no point in supporting anything but IEEE
757 and that saves at least a function call per math entry point.

Addtionally, important the fpclassify, isinf, isnan and signbit
functions into libc as required for C99.

Remove the support for non-POSIX operation. matherr is pointless and
wasn't really supported anyway.

18 years agoAdd a new kernel compile debugging option, DEBUG_CRIT_SECTIONS. This fairly
Matthew Dillon [Tue, 26 Jul 2005 20:53:58 +0000 (20:53 +0000)]
Add a new kernel compile debugging option, DEBUG_CRIT_SECTIONS.  This fairly
invasive debugging option compiles matching code into the critical section
inlines and reports mismatches at run-time.   It is used to detect
missing/forgotten crit_exit() calls.

Note that because there are a number of places where critical sections are
manipulated outside the procedures that entered them, this code will
generate a number of false hits and should only be used under the direction
of experienced developers.

Note that the thread structure will be extended by this option.

18 years agoAdd missing crit_exit().
Matthew Dillon [Tue, 26 Jul 2005 20:48:41 +0000 (20:48 +0000)]
Add missing crit_exit().

18 years ago- Don't role our own - use err(3)
Liam J. Foy [Tue, 26 Jul 2005 20:17:31 +0000 (20:17 +0000)]
- Don't role our own - use err(3)

18 years agoAdd a missing FREE_LOCK() call.
Matthew Dillon [Tue, 26 Jul 2005 18:02:49 +0000 (18:02 +0000)]
Add a missing FREE_LOCK() call.

18 years agoSimplify conditional by making use of __DF_VISIBLE and __ISO_C_VISIBLE.
Joerg Sonnenberger [Tue, 26 Jul 2005 16:45:58 +0000 (16:45 +0000)]
Simplify conditional by making use of __DF_VISIBLE and __ISO_C_VISIBLE.

18 years agoAdd a new feature-test macro __DF_VISIBLE for those functions we want to
Joerg Sonnenberger [Tue, 26 Jul 2005 16:45:04 +0000 (16:45 +0000)]
Add a new feature-test macro __DF_VISIBLE for those functions we want to
explicitly enable independent of standards being choosen. This is the
default either when no other macro was provided or when _DRAGONFLY_SOURCE
or _NETBSD_SOURCE were specified.

18 years agoClean the VFS operations vector and related code:
Hiten Pandya [Tue, 26 Jul 2005 15:43:36 +0000 (15:43 +0000)]
Clean the VFS operations vector and related code:

* take advantage of C99 sparse structure initialisation, this allows
  us to initialise left out vfsops entries cleanly when vfs_register()
  is called; any vfsop entries that are not specified will be assigned
  vfs_std* functions.  the only exception to this rule is VFS_SYNC
  which is assigned vfs_stdnosync() since a file system may not have
  support for it.  file systems can simply assign vfs_stdsync if they
  do not have their own sync operation.

* add KKASSERTS to make sure that the VFS_ROOT, VFS_MOUNT and VFS_UNMOUNT
  vfs operations are provided by a file system being registered.  all of
  the above are necessary to ensure a minimally working file system.

* remove scattered no-op definitions of VFS_START() vfsop vector entry
  and take advantage of sparse vfsop initialisation.  VFS_START is only
  used by MFS to make ensure calling process is not swapped out when
  I/O is initialised.  The entry point is called from the mount path,
  before the file system is marked ready.

* remove scattered no-op definitions of VFS_QUOTACTL() vfsop vector entry
  and take advantage of sparse vfsop initialisation.

* give UFS a VFS_UNINIT vfsop entry and make use of it in ext2fs when
  ripping down the hash tables.

* many file systems in the kernel seem to not implement the complementing
  VFS_UNINIT() vfsop entry, this is not so much of a problem when the
  file system is compiled into the kernel, but it can leave leakage when
  compiled as KLD modules.  add uninitialisation code and entry points
  for ext2fs, ufs, fdescfs.  grab the ufs_ihash_token when free'ing the
  inode hash table at ripping time.

* add typedefs for all the vfsop entry points, make use of it in definition
  of struct vfsops; this results in clean and consolidate code.  use the
  typedefs for vfs_std* function prototypes.

18 years agoDrop GCC < 1 support, simplify inline assembly and use proper #error for
Joerg Sonnenberger [Tue, 26 Jul 2005 14:56:04 +0000 (14:56 +0000)]
Drop GCC < 1 support, simplify inline assembly and use proper #error for
!GCC case.

18 years agoDon't panic. Also races in the attach path.
Joerg Sonnenberger [Tue, 26 Jul 2005 12:40:38 +0000 (12:40 +0000)]
Don't panic. Also races in the attach path.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Paniced-for: eirikn

18 years agoRemove installation of the dragonfly{,.submit}.cf files since users may
Gregory Neil Shapiro [Tue, 26 Jul 2005 02:40:25 +0000 (02:40 +0000)]
Remove installation of the dragonfly{,.submit}.cf files since users may
do a 'make upgrade' before a 'make buildworld' and the .cf files won't
exist.  Strictly speaking, we don't need them in /etc/mail/ for
/etc/mail/Makefile to work properly anyway so this is a safe change.

I prefer this to adding the .cf files as dependencies to the upgrade
target since that target shouldn't do any building (i.e., 'make upgrade'
doesn't do things like 'make obj' first).

18 years agoRemove outdated information with regard to old tinderbox.
Hiten Pandya [Tue, 26 Jul 2005 00:29:38 +0000 (00:29 +0000)]
Remove outdated information with regard to old tinderbox.

18 years agoRemove reference to devd.
David Rhodus [Mon, 25 Jul 2005 18:57:36 +0000 (18:57 +0000)]
Remove reference to devd.

18 years agoUpdate the unifdef(1) utility to the latest code from FreeBSD, and the
Hiten Pandya [Mon, 25 Jul 2005 17:51:36 +0000 (17:51 +0000)]
Update the unifdef(1) utility to the latest code from FreeBSD, and the
manual page as well.

Obtained-from: FreeBSD

18 years agoRemove conditional bits about other operating systems, they are not
Hiten Pandya [Mon, 25 Jul 2005 17:25:51 +0000 (17:25 +0000)]
Remove conditional bits about other operating systems, they are not
required and just get in the way.

18 years agoInstall pam.d's README and convert.sh as part of upgrade_etc.
Joerg Sonnenberger [Mon, 25 Jul 2005 16:04:36 +0000 (16:04 +0000)]
Install pam.d's README and convert.sh as part of upgrade_etc.
Don't install or convert the configuration automatically, it might
surprise the administrator.

18 years agoAdd support for HP hn210e usb ethernet.
Joerg Sonnenberger [Mon, 25 Jul 2005 12:46:59 +0000 (12:46 +0000)]
Add support for HP hn210e usb ethernet.

Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Obtained-from: FreeBSD

18 years agoUnhook rc.d/network, it should be unused.
Joerg Sonnenberger [Mon, 25 Jul 2005 01:29:03 +0000 (01:29 +0000)]
Unhook rc.d/network, it should be unused.

18 years agoGC unused header from BSD libm.
Joerg Sonnenberger [Mon, 25 Jul 2005 00:46:16 +0000 (00:46 +0000)]
GC unused header from BSD libm.

18 years agoAdd most parts of the wide char stdio support. This is not hooked up
Joerg Sonnenberger [Mon, 25 Jul 2005 00:37:41 +0000 (00:37 +0000)]
Add most parts of the wide char stdio support. This is not hooked up
yet.

Obtained-from: NetBSD, mostly derived from FreeBSD

18 years agoBring DragonFly's sendmail infrastructure up to date. This commit includes:
Gregory Neil Shapiro [Mon, 25 Jul 2005 00:24:32 +0000 (00:24 +0000)]
Bring DragonFly's sendmail infrastructure up to date.  This commit includes:

- Upgrading base system from sendmail 8.12.10 to 8.13.4 (which includes
  native DragonFly support so DragonFly no longer needs to pretend to be
  FreeBSD).
- Drop the FreeBSD-only add-ons of nobiff and nofsync for mail.local
  and the FreeBSD-customized Received: header format and instead use the
  distribution as released by sendmail.org.
- Default to /etc/mail/dragonfly.mc and /etc/mail/dragonfly.submit.mc
  instead of /etc/mail/freebsd{,.submit}.mc.
  - Users should be sure to 'cd /usr/src; make upgrade' to get the
    new dragonfly{,.submit}.mc files installed into /etc/mail/.
    (Or you can just do the sendmail portion with 'cd /usr/src/etc/sendmail;
    make upgrade'.)
- Support for per-host submit.mc files (i.e., /etc/mail/`hostname`.submit.mc).
- New SENDMAIL_CF_DIR make.conf variable for overriding location of the
  sendmail/cf directory (default is still /usr/share/sendmail/cf/).
- Better sendmail_enable checking in /etc/rc.sendmail.
- /etc/periodic/daily/150.clean-hoststat now does the right thing and only
  cleans expired host status entries using the purgestat command.

18 years agoAdd description of FPU for floating point conversion functions.
Joerg Sonnenberger [Sun, 24 Jul 2005 20:23:00 +0000 (20:23 +0000)]
Add description of FPU for floating point conversion functions.

18 years agoJust threat all ELF dynamic objects as shared libraries, don't verify
Joerg Sonnenberger [Sun, 24 Jul 2005 15:04:56 +0000 (15:04 +0000)]
Just threat all ELF dynamic objects as shared libraries, don't verify
the ELF OS ABI. This unbreaks ldd on shared libraries and works e.g. for
Linux libs too.

Remainder-from: corecode, buggs

18 years agoFix C++.
Joerg Sonnenberger [Sun, 24 Jul 2005 12:40:36 +0000 (12:40 +0000)]
Fix C++.

18 years agoregen.
Joerg Sonnenberger [Sat, 23 Jul 2005 23:27:28 +0000 (23:27 +0000)]
regen.

18 years agoRemove partial NetBSD support. It's pointless to have an emulation of
Joerg Sonnenberger [Sat, 23 Jul 2005 23:26:50 +0000 (23:26 +0000)]
Remove partial NetBSD support. It's pointless to have an emulation of
three syscalls (stat, lstat and fstat), the rest was never finished.

Discussed-with: dillon

18 years agoMerge __sFILEX into __FILE. Let __fpending handle the ungetc buffer
Joerg Sonnenberger [Sat, 23 Jul 2005 23:14:44 +0000 (23:14 +0000)]
Merge __sFILEX into __FILE. Let __fpending handle the ungetc buffer
correctly.

18 years agoFirst step to cleaning up stdio. This breaks the libc ABI, all programs
Joerg Sonnenberger [Sat, 23 Jul 2005 20:23:06 +0000 (20:23 +0000)]
First step to cleaning up stdio. This breaks the libc ABI, all programs
have to be recompiled.

Make FILE an opaque type for normal operation (anything outside libc).
This means programs have to use the exported interface, they can neither
make static instances on the heap or access fields of their own.

Introduce a new type __FILE_public, which contains the fields accessed
by the various macros. It is placed first in the real FILE and the
macros cast the given FILE * to __FILE_public for access. To allow
better argument checks, all macros have been converted to inline
functions instead.

Merge the various stdio helper headers into a single priv_stdio.h. The
license from the original files has been kept, the third clause is gone
as part of the UCB copyright addendum. They haven't been changed in
FreeBSD at all.

Add two new helper functions, fcookie and __fpending to read parts of
the hidden state. The former is handy for funopen users, the latter
exists on other systems as well.

Cleanup some minor warnings on the way and hide some local functions
with static.

Adept libftpio and CVS to the chanced API.

18 years agoAdd shlock(1), a program for the safe creation of lock files from shell
Joerg Sonnenberger [Sat, 23 Jul 2005 19:47:15 +0000 (19:47 +0000)]
Add shlock(1), a program for the safe creation of lock files from shell
scripts. It's uses the same algorithm as implemented by Erik Fair, but
is easier to read and more stricter in checking for error conditions.

18 years agoSupport disablement of chflags in a jail, part 2/2. This actually isn't
Matthew Dillon [Sat, 23 Jul 2005 18:08:50 +0000 (18:08 +0000)]
Support disablement of chflags in a jail, part 2/2.  This actually isn't
a complete disablement.  Like FreeBSD user-level chflags always work.  This
syctl just controls whether root-level chflags should operate as a root
chflags or a user chflags inside a jail.

Submitted-by: Deyan Dyankov <deyan.dyankov@gmail.com>
Taken-from: FreeBSD

18 years agopthread_self is used by stdio.
Joerg Sonnenberger [Sat, 23 Jul 2005 14:16:13 +0000 (14:16 +0000)]
pthread_self is used by stdio.

18 years agoDo not compile the kernel with the stack protector. I've decided to tolerate
Matthew Dillon [Sat, 23 Jul 2005 07:33:43 +0000 (07:33 +0000)]
Do not compile the kernel with the stack protector.  I've decided to tolerate
the stack protector as a default for user programs, but not for the kernel.
The stack protector has known bugs and I frankly believe that it is far more
likely that we would hit one of its bugs verses it actually finding a
stack overflow in the kernel.

18 years agoFix a sockbuf race. Currently the m_free*() path can block, due to
Matthew Dillon [Sat, 23 Jul 2005 07:28:36 +0000 (07:28 +0000)]
Fix a sockbuf race.  Currently the m_free*() path can block, due to
objcache_put() blocking when it must access the global depot.  This breaks
the critical section *AND the BGL during a time when the sockbuf state is
inconsistent.  Another process accessing the same sockbuf would then
corrupt it.  Since depot access is fairly rare, this bug typically required
a number of hours to reproduce.

Delay the actual freeing of mbufs until after the sockbuf state has been
updated.  Encapsulate common operations in a procedure, and add additional
assertions.  NULL out sb_lastrecord when it becomes invalid, and add a
considerable amount of debugging code.

SOCKBUF_DEBUG has been added.  Note that this is a VERY EXPENSIVE
kernel compile option which should only be used when specifically debugging
the networking subsystem.

This is a stabilization patch is rather hackish.  A better cleanup will
occur once we are sure we've fixed all the bugs.

sbcheck provided by: Jeffrey Hsu
Reported-by: David Rhodus, Peter Avalos, YONETANI Tomokazu,
     Tomaz Borstnar, and numerous other people.

18 years agoFix a critical bug in the IPI messaging code, effecting SMP systems. In
Matthew Dillon [Sat, 23 Jul 2005 07:17:42 +0000 (07:17 +0000)]
Fix a critical bug in the IPI messaging code, effecting SMP systems.  In
order to avoid placing a load fence in the FIFO scanning loop the FIFO write
index is cached and the code then loops the read index until it reaches
the cached write index, rather then real-time write index.  However, if a
FIFO full condition occurs during the callback AND additional IPIQ messages
are queued to the current cpu by a remote cpu at the same time, a recursive
call to lwkt_process_ipiq*() can occur and advance the read index past
the cached write index of the parent processing loop.

An exact comparison against the cached write index was being used which
resulted in the parent processing loop blowing past the actual write
index and re-executing stale IPI messages.  Fix the comparison.

The nature of this bug combined with other bugs in the token code and the
sockbuf code (which were causing crashes far more often) made this a
particularly nasty problem to find, with it taking upwards of a week to
generate a crash and the crash occuring at the worst place imagineable
(a hard IPI interrupt) and doing terrible things (re-executing a stale
IPI message).  It took KTR logging on both the sending and receiving
side of the IPI code to nail the problem.

Very special thanks to Peter Avalos and David rhodus for their debugging
help.  And, most especially, David Rhodus for helping track this down over
the last *THREE* months.

Reported-by: David Rhodus, Peter Avalos, YONETANI Tomokazu, Tomaz Borstnar
Special-thanks-to: David Rhodus and Peter Avalos

18 years agoSplit monolithic /etc/pam.conf into separate files for each service
Joerg Sonnenberger [Fri, 22 Jul 2005 18:20:43 +0000 (18:20 +0000)]
Split monolithic /etc/pam.conf into separate files for each service
under /etc/pam.d. The README was obtained from FreeBSD, the convert.sh
script is inspired by convert.pl, but works with sh and awk only.

If you just want to convert your existing configuration to the new
format, run "sh /etc/pam.d/convert.sh". You can remove /etc/pam.conf
afterwards.

18 years agoGet rid off extraneous spaces in function prototypes.
Jeroen Ruigrok/asmodai [Fri, 22 Jul 2005 18:11:05 +0000 (18:11 +0000)]
Get rid off extraneous spaces in function prototypes.

18 years agoAdd information about console fonts.
Sascha Wildner [Fri, 22 Jul 2005 15:55:56 +0000 (15:55 +0000)]
Add information about console fonts.

18 years agoAdd emulation of statvfs and fstatvfs based on statfs / fstatfs.
Joerg Sonnenberger [Thu, 21 Jul 2005 21:33:26 +0000 (21:33 +0000)]
Add emulation of statvfs and fstatvfs based on statfs / fstatfs.

18 years agoSome more junk to remove after manual installation.
Joerg Sonnenberger [Thu, 21 Jul 2005 20:31:19 +0000 (20:31 +0000)]
Some more junk to remove after manual installation.

18 years agoRemove part about wscons. This will need information about our console
Jeroen Ruigrok/asmodai [Thu, 21 Jul 2005 20:08:53 +0000 (20:08 +0000)]
Remove part about wscons.  This will need information about our console
system.

18 years agoReorder alphabetically.
Jeroen Ruigrok/asmodai [Thu, 21 Jul 2005 20:06:07 +0000 (20:06 +0000)]
Reorder alphabetically.

18 years agoAdd NetBSD's nls(7).
Jeroen Ruigrok/asmodai [Thu, 21 Jul 2005 20:04:53 +0000 (20:04 +0000)]
Add NetBSD's nls(7).

18 years agoMark zlib 1.2.2 as dead.
Joerg Sonnenberger [Thu, 21 Jul 2005 16:09:41 +0000 (16:09 +0000)]
Mark zlib 1.2.2 as dead.

18 years agoMerge from vendor branch ZLIB:
Joerg Sonnenberger [Thu, 21 Jul 2005 16:07:41 +0000 (16:07 +0000)]
Merge from vendor branch ZLIB:
Switch to zlib 1.2.3, imported under contrib/zlib-1.2 to reduce impact
of latter updates. Remove fix the inflate bug, it is included already.

18 years agoSwitch to zlib 1.2.3, imported under contrib/zlib-1.2 to reduce impact
Joerg Sonnenberger [Thu, 21 Jul 2005 16:07:41 +0000 (16:07 +0000)]
Switch to zlib 1.2.3, imported under contrib/zlib-1.2 to reduce impact
of latter updates. Remove fix the inflate bug, it is included already.

18 years agoSwitch to zlib 1.2.3, imported under contrib/zlib-1.2 to reduce impact
Joerg Sonnenberger [Thu, 21 Jul 2005 16:07:41 +0000 (16:07 +0000)]
Switch to zlib 1.2.3, imported under contrib/zlib-1.2 to reduce impact
of latter updates. Remove fix the inflate bug, it is included already.

18 years agoRemove the minigzip example from libz. Since the real gzip is based on
Joerg Sonnenberger [Thu, 21 Jul 2005 15:56:44 +0000 (15:56 +0000)]
Remove the minigzip example from libz. Since the real gzip is based on
libz too and is only slightly bigger (7 KB for static linkage), there's
no point in having it.

18 years agoAdditional work to try to make panics operate better on SMP systems.
Matthew Dillon [Thu, 21 Jul 2005 06:28:50 +0000 (06:28 +0000)]
Additional work to try to make panics operate better on SMP systems.

* Fix a bug in a kernel printf() (that occurs in a panic situation) so
  the printf() itself doesn't fault out.

* The idle thread normally must never hold the BGL across a switch, since the
  switch code must switch to the idle thread if no other threads are available.
  However, since the machine can take a fatal kernel trap or panic in the
  context of the idle thread it is possible for the idle thread to hold the
  BGL during these particular situations.  Additionally, the locking code
  assumes that it can just set the thread's mpcount, call lwkt_switch(), and
  not get the cpu back until the scheduler is able to obtain the BGL on
  behalf of the thread.  So have the scheduler deal with this situation.

  This makes the scheduler look a bit messier then it really is but the code
  paths in question only run during a panic or fatal kernel trap, so
  performance should not be impaired.

From-dumps-provided-by: Peter Avalos <pavalos@theshell.com>
18 years agoOnly compile in lwkt_smp_stopped() on SMP builds.
Matthew Dillon [Thu, 21 Jul 2005 01:16:30 +0000 (01:16 +0000)]
Only compile in lwkt_smp_stopped() on SMP builds.

Reported-by: Noritoshi Demizu <demizu@dd.iij4u.or.jp>
18 years agoSupport disablement of chflags in a jail, part 1/2.
Matthew Dillon [Wed, 20 Jul 2005 20:31:19 +0000 (20:31 +0000)]
Support disablement of chflags in a jail, part 1/2.

Submitted-by: Deyan Dyankov <deyan.dyankov@gmail.com>
Taken-from: FreeBSD-5

18 years agoWhen a cpu is stopped due to a panic or the debugger, it can be in virtually
Matthew Dillon [Wed, 20 Jul 2005 20:21:31 +0000 (20:21 +0000)]
When a cpu is stopped due to a panic or the debugger, it can be in virtually
any state, including possibly holding a critical section.   IPIQ interrupts
must still be processed while we are in this state (even though we could be
racing IPIQ processing if we were interrupted at just the wrong time).  In
particular, dumping is not likely to work if a panic occurs on a cpu != 0
unless we process the IPIQ on the stopped cpus.  There are simply too many
interactions between cpus.

Interrupt threads are LWKT scheduled entities and will generally still not
work during a panic while dumping.  The dumping code expects this.  However,
call splz() anyway.

We may in the future have to allow certain threads to run while dumping.
For example, to allow dumping over the network.  There are various ways this
can be done, such as by masking gd_runqmask or flagging special threads to
be runnable while in a paniced or dumping state.

18 years agoAdd some conditionalized debugging 'PANIC_DEBUG', to allow us to panic a
Matthew Dillon [Wed, 20 Jul 2005 20:14:33 +0000 (20:14 +0000)]
Add some conditionalized debugging 'PANIC_DEBUG', to allow us to panic a
busy system from the worst place imagineable, the IPIQ loop.

18 years agoSync with all revisions up to FreeBSD date.1:1.72 (ru), notably:
Chris Pressey [Wed, 20 Jul 2005 20:05:46 +0000 (20:05 +0000)]
Sync with all revisions up to FreeBSD date.1:1.72 (ru), notably:
- Add the new standard EXIT STATUS section where appropriate.
  Sort standard sections in the (documented) preferred order.
  Author: ru, date.1:1.71
- Give the most awesome example of how to parse the output of date
  back into Epoch time. Author: alfred, date.1:1.67
- Better SYSNOPIS. Author: green, date.1:1.63
- Lots of minor man page cleanups by ru.
- Bump man page date.

Submitted-by: Sarunas Vancevicius <svan_at_redbrick_dot_dcu_dot_ie>
18 years agoRaise WARNS to 6:
Chris Pressey [Wed, 20 Jul 2005 19:51:56 +0000 (19:51 +0000)]
Raise WARNS to 6:
- Declare variables and parameters 'static' and 'const' as needed.

Also:
- Bump FreeBSD CVS id's (date.c:1.47 (imp); extern.h 1.XX (markm))
  to indicate that these files are functionally identical;
- Remove unnecessary casts;
- Apply some style(9).

Submitted-by: Sarunas Vancevicius <svan_at_redbrick_dot_dcu_dot_ie>
18 years agoMerge with FreeBSD 1.44 (dds): report and exit on write error.
Chris Pressey [Wed, 20 Jul 2005 19:35:50 +0000 (19:35 +0000)]
Merge ... FreeBSD 1.44 (dds): report and exit on write error.

Submitted-by: Sarunas Vancevicius <svan_at_redbrick_dot_dcu_dot_ie>
              (w/tiny style(9) change by me)

18 years agoAdd some debugging code to catch any dirty inodes which are destroyed
Matthew Dillon [Wed, 20 Jul 2005 17:59:45 +0000 (17:59 +0000)]
Add some debugging code to catch any dirty inodes which are destroyed
without being synced to the disk.

18 years agoAdd some additinal targets to allow elements of a buildworld to be
Matthew Dillon [Wed, 20 Jul 2005 17:55:13 +0000 (17:55 +0000)]
Add some additinal targets to allow elements of a buildworld to be
independantly built.  This is for debugging only.

18 years agoMerge with FreeBSD netdate.c:1.17 (charnier): udp/timed -> timed/udp
Chris Pressey [Wed, 20 Jul 2005 06:25:20 +0000 (06:25 +0000)]
Merge ... FreeBSD netdate.c:1.17 (charnier): udp/timed -> timed/udp
(Sync to FreeBSD netdate.c:1.18 (markm) modulo FreeBSD formatting.)

Submitted-by: Sarunas Vancevicius <svan_at_redbrick_dot_dcu_dot_ie>
18 years agoMerge with FreeBSD vary.c:1.16 and date.1:1.68 (yar):
Chris Pressey [Wed, 20 Jul 2005 06:10:51 +0000 (06:10 +0000)]
Merge ... FreeBSD vary.c:1.16 and date.1:1.68 (yar):
Change behaviour of -v to be more intuitive, by accounting for the
fact that not all months have the same number of days.

(Note that, because this commit is the first of a series, the FreeBSD
revision number and date of the man page have not been bumped yet.)

Submitted-by: Sarunas Vancevicius <svan_at_redbrick_dot_dcu_dot_ie>
18 years agoLimit switch-from-interrupt warnings to once per thread to avoid an endless
Matthew Dillon [Wed, 20 Jul 2005 04:33:44 +0000 (04:33 +0000)]
Limit switch-from-interrupt warnings to once per thread to avoid an endless
loop.  Generate a DDB backtrace when it occurs.

Note from Peter's report that it is possible for the idle thread to panic
if e.g. an IPI or FAST interrupt running in the idle thread's context panics.
This can result in highly unexpected operation and needs to be addressed.

Reported-by: Peter Avalos <pavalos@theshell.com>
18 years agoInterlock panics that occur on multiple cpus before the first cpu is able to
Matthew Dillon [Tue, 19 Jul 2005 19:53:53 +0000 (19:53 +0000)]
Interlock panics that occur on multiple cpus before the first cpu is able to
halt the other cpus.  Print out a nice verbose message describing the
situation, then permanently deschedule the threads that lose the race.

18 years agoIf a fatal kernel trap occurs from an IPI or FAST interrupt on a cpu not
Matthew Dillon [Tue, 19 Jul 2005 19:25:45 +0000 (19:25 +0000)]
If a fatal kernel trap occurs from an IPI or FAST interrupt on a cpu not
holding the MP lock, the trap code will panic a second time when get_mplock()
attempts to block due to an assertion in lwkt_switch().  Add a new globaldata
field, gd_trap_nesting_level, that allows us to bypass this panic.

If lwkt_switch() is called with a non-zero gd_intr_nesting_level or non-zero
gd_trap_nesting_level, the two variables must be saved and then zero'd
across the switch, and restored on resume.  Otherwise a normal switch in
another thread will result in another panic.  This case only occurs during
fatal traps, panics, or when operating from DDB.

From-kernel-dumps-provided-by: David Rhodus <sdrhodus@gmail.com>
18 years agoFix a MP lock race. The MP locking state can change when lwkt_chktokens()
Matthew Dillon [Tue, 19 Jul 2005 19:08:05 +0000 (19:08 +0000)]
Fix a MP lock race.  The MP locking state can change when lwkt_chktokens()
returns a failure.  The state is not retained by an interrupt because we
are trying to set it for the new thread rather then the current thread, and
the current thread's mpcount could be 0.

Change ASSERT_MP_LOCK_HELD() to supply a thread for reporting purposes in
the KASSERT.

Reported-by: David Rhodus <sdrhodus@gmail.com>
18 years agoFix Saved commands bug. The following Makefile would cause make to core.
Max Okumoto [Tue, 19 Jul 2005 18:19:15 +0000 (18:19 +0000)]
Fix Saved commands bug.  The following Makefile would cause make to core.
This bug has been in make since 4.X

all:    first next
@echo Run now.
...
@echo Run after me

first:
@echo Apppp
...
@echo Run after all 1

next:
@echo Bpppp
...
@echo Run after all 2

18 years agoReorder paramters to Compat_RunCommand().
Max Okumoto [Tue, 19 Jul 2005 18:16:02 +0000 (18:16 +0000)]
Reorder paramters to Compat_RunCommand().

18 years agoMove handling of the following signals {SIGTSTP, SIGTTOU,
Max Okumoto [Tue, 19 Jul 2005 18:15:29 +0000 (18:15 +0000)]
Move handling of the following signals {SIGTSTP, SIGTTOU,
SIGTTIN, and SIGWINCH} closer to the top of the function.

18 years agoConstify cmd paramter to Compat_RunCommand()
Max Okumoto [Tue, 19 Jul 2005 18:14:33 +0000 (18:14 +0000)]
Constify cmd paramter to Compat_RunCommand()

18 years agoCleanup the signal handling. A lot of unnecessary code was
Max Okumoto [Tue, 19 Jul 2005 18:14:15 +0000 (18:14 +0000)]
Cleanup the signal handling.  A lot of unnecessary code was
added in the past due to miss-understanding of the signal code.

Now when a signal is delivered, a per signal variable is incremented.
[idea from OpenBSD]  Since the signal handler just set variables
the rest of the code does not need to block signals.  This makes
the mainline code much cleaner.

18 years agoConstify Lst_Member()
Max Okumoto [Tue, 19 Jul 2005 18:12:46 +0000 (18:12 +0000)]
Constify Lst_Member()

18 years agoFix numerous extremely serious bugs in OHCI's iso-synchronous code. I'm
Matthew Dillon [Mon, 18 Jul 2005 19:20:46 +0000 (19:20 +0000)]
Fix numerous extremely serious bugs in OHCI's iso-synchronous code.  I'm
not even sure if the fixes are entirely correct because the code is badly
written and totally undocumented.  But they seem to help.

* Fix up list linkages prior to calling ohci_free_sitd(), since
  ohci_free_sitd() destroys the nextitd field.  This was causing a huge
  amount of corruption of the SITD free list *AND* the xfer SITD list,
  particularly prevaliant when multi-record transfers are executed
  (e.g. uaudio).

* Properly (I hope) adjust the pipe tail pointer in numerous situations.
  There are a number of unconditional references and assumptions as to the
  validity of pipe->tail.itd and it must be maintained at all times.
  In particular, an aborted or timed-out transfer would corrupt it.

Reported-by: Michal Belczyk <belczyk@bsd.krakow.pl>
18 years agode-nop part introduced in the last commit.
Joerg Sonnenberger [Mon, 18 Jul 2005 16:43:26 +0000 (16:43 +0000)]
de-nop part introduced in the last commit.

Noticed-by: Michal Belczyk <belczyk@bsd.krakow.pl>
18 years agoAdd KTR support for usb_mem to trace usb-related allocations.
Matthew Dillon [Mon, 18 Jul 2005 14:52:57 +0000 (14:52 +0000)]
Add KTR support for usb_mem to trace usb-related allocations.

18 years agoDELAY() is a spin loop, we can't use it any more because shutdown
Matthew Dillon [Mon, 18 Jul 2005 02:47:36 +0000 (02:47 +0000)]
DELAY() is a spin loop, we can't use it any more because shutdown
depends on other threads working.  Not only does the syncer and buffer
flusher need to work (else they might get stuck holding a lock on a buffer),
but the scheduler helper threads and device helper threads must also continue
to operate to be able to successfully flush the buffer cache.   In addition,
busy looping while holding the BGL can seriously deadlock SMP machines, so
even if it was (sometimes) possible to get away with using DELAY on UP boxes,
it's simply impossible on an SMP box.

So change the DELAY's to tsleep's in the shutdown code.  The current thread
is also given a very high priority (higher then an interrupt thread,
in fact), to try to ensure it gets through the shutdown procedure even if
the system is fried.  For the moment we do not move the thread to cpu #0.

This puts us in a somewhat awkwar situation when handling panics, but I don't
see that we have much of a choice.

Reported-by: Peter Avalos, David Rhodus, and numerous other people over time.
18 years agoFix missing initialisation of big numbers. BN_hex2bn behaves
Joerg Sonnenberger [Sun, 17 Jul 2005 19:16:35 +0000 (19:16 +0000)]
Fix missing initialisation of big numbers. BN_hex2bn behaves
differently if the passed pointer points to NULL or not.

Noticed-by: Michal Belczyk <belczyk@bsd.krakow.pl>
(slightly different patch commited)

18 years agoAllow only non-banked direct modes.
Sascha Wildner [Sun, 17 Jul 2005 16:50:40 +0000 (16:50 +0000)]
Allow only non-banked direct modes.

Obtained from: FreeBSD

18 years agoWhen a usb mass storage device is removed the related CAM SIM structure is
Matthew Dillon [Sun, 17 Jul 2005 03:49:50 +0000 (03:49 +0000)]
When a usb mass storage device is removed the related CAM SIM structure is
terminated.  A ref count prevents the actual sim structure from being
destroyed if the device still has refs, but the sim->devq structure is not so
protected and will be NULLed out.  An unmount attempt after device removal
will then result in a panic.

Fix this by testing for a NULL sim->devq.

Reported-by: Eduardo Tongson <propolice@gmail.com>
18 years agoRemove DEC Alpha support.
Sascha Wildner [Sun, 17 Jul 2005 02:41:10 +0000 (02:41 +0000)]
Remove DEC Alpha support.

18 years agoKTR_MALLOC should be KTR_MEMORY
Matthew Dillon [Sat, 16 Jul 2005 18:27:01 +0000 (18:27 +0000)]
KTR_MALLOC should be KTR_MEMORY

18 years ago* Fix a bug that could cause dc_stop() to try to m_freem() something that's
Matthew Dillon [Sat, 16 Jul 2005 17:11:39 +0000 (17:11 +0000)]
* Fix a bug that could cause dc_stop() to try to m_freem() something that's
  not a valid mbuf pointer.
* Avoid an unnecessary copy of a packet if it is already in a single mbuf.
* Introduce an additional device flag (DC_TX_ALIGN) for those NICs which
  require the transmit buffers to be aligned to 32-bit boundaries.
* Ignore CSR13, CSR14, CSR15 'Media Specific Data' registers for 21143
  based cards which use SIA mode.
* Don't read the MAC address from a copy of the EEPROM in the softc
  that has been recorded earlier and overwrite it again later by
  reading it directly from the EEPROM again.
* Read the MAC address from the PAR0/PAR1 registers instead, which
  are autoloaded on reboot.
* Added ADMtek ADM9511 and ADM9513 device ID's

Submitted-by: Eduardo Tongson
Taken-from: FreeBSD
    if_dc.c       1.9.46,48,49,50,51,52,53,55
    if_dcreg.h   1.4.2.23,24,25

18 years agoReorder the INVARIANTS test in crit_enter() to occur prior to modifying
Matthew Dillon [Sat, 16 Jul 2005 17:09:15 +0000 (17:09 +0000)]
Reorder the INVARIANTS test in crit_enter() to occur prior to modifying
the critical section count rather then after, to try to catch critical
section mismatches earlier.

18 years agoMove a mistaken crit_exit() into a crit_enter(), which was panicing the
Matthew Dillon [Sat, 16 Jul 2005 17:08:13 +0000 (17:08 +0000)]
Move a mistaken crit_exit() into a crit_enter(), which was panicing the
system when switching out of the SLIP line discpline.