17 years agoMerge from vendor branch BINUTILS:
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:58:20 +0000 (05:58 +0000)]
Merge from vendor branch BINUTILS:

Bloody copiers. :P

17 years agoMerge from vendor branch BIND:
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:58:20 +0000 (05:58 +0000)]
Merge from vendor branch BIND:

Bloody copiers. :P

17 years agoFix PROCDURE -> PROCEDURE.
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:58:20 +0000 (05:58 +0000)]

Bloody copiers. :P

17 years agoFix PROCDURE -> PROCEDURE.
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:58:20 +0000 (05:58 +0000)]

Bloody copiers. :P

17 years agoFix PROCDURE -> PROCEDURE.
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:58:20 +0000 (05:58 +0000)]

Bloody copiers. :P

17 years agoAdd DragonFly release numbers.
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:34:49 +0000 (05:34 +0000)]
Add DragonFly release numbers.

17 years agoClean up manual page.
Jeroen Ruigrok/asmodai [Sun, 28 Aug 2005 05:13:53 +0000 (05:13 +0000)]
Clean up manual page.

17 years agoDump and restore need to use a UFS-centric inode representation. Convert
Matthew Dillon [Sun, 28 Aug 2005 04:35:14 +0000 (04:35 +0000)]
Dump and restore need to use a UFS-centric inode representation.  Convert
ino_t into ufs1_ino_t.

17 years agoAdd a typedef ufs1_ino_t to represent inodes for UFS1 filesystems.
Matthew Dillon [Sun, 28 Aug 2005 04:34:44 +0000 (04:34 +0000)]
Add a typedef ufs1_ino_t to represent inodes for UFS1 filesystems.

17 years agotest commit.
Sepherosa Ziehau [Sun, 28 Aug 2005 04:25:23 +0000 (04:25 +0000)]
test commit.

17 years agoAdd real function versions of the _unlocked family. Use putc for putchar
Joerg Sonnenberger [Sat, 27 Aug 2005 21:35:01 +0000 (21:35 +0000)]
Add real function versions of the _unlocked family. Use putc for putchar

17 years agoSmoke something else and revert the use of ssize_t, I've put it there
Joerg Sonnenberger [Sat, 27 Aug 2005 21:32:24 +0000 (21:32 +0000)]
Smoke something else and revert the use of ssize_t, I've put it there
for a reason after all.

17 years agoRemove space before '('. Correctly align some function names. No need to
Joerg Sonnenberger [Sat, 27 Aug 2005 21:13:28 +0000 (21:13 +0000)]
Remove space before '('. Correctly align some function names. No need to
use local versions of ssize_t (size_t is used already) or const.

17 years agoSync GCC 3.4's propolice with Etoh's official version. This fixes the
Joerg Sonnenberger [Sat, 27 Aug 2005 21:03:52 +0000 (21:03 +0000)]
Sync GCC 3.4's propolice with Etoh's official version. This fixes the
reorder bug in -O2+, which killed Samba from pkgsrc and mutt.

17 years agoMake struct dirent contain a full 64bit inode. Allow more than 255 byte
Joerg Sonnenberger [Sat, 27 Aug 2005 20:23:06 +0000 (20:23 +0000)]
Make struct dirent contain a full 64bit inode. Allow more than 255 byte
filenames by increasing d_namlen to 16bit. Remove UFS specific macros
from sys/dirent.h, programs which really need them should include
vfs/ufs/dir.h. MAXNAMLEN should not be used, but replaced by NAME_MAX.

To keep the impact for older BSD code small, d_ino and d_fileno are kept
in the old meaning when __BSD_VISIBLE is defined, otherwise the POSIX
version d_ino is used. This will be changed later to always define only
d_ino and make d_fileno a compatiblity macro for __BSD_VISIBLE.

d_name is left with hard-coded 256 byte space, this will be changed at
some point in the future and doesn't affect the ABI. Programs should
correctly allocate space themselve, since the maximum directory entry
length can be > 256 byte.

For allocating dirents (e.g. for readdir_r), _DIRENT_RECLEN and
_DIRENT_DIRSIZ should be used. NetBSD has choosen the same names.
Revamp the compatibility code to always use a local kernel buffer and
write out the entries. This will be changed later by passing down the
output function to vop_readdir, elimininating the redundant copy.

Change NFS and CD9660 to use to use vop_write_dirent, for CD9660 ensure
that the buffers are big enough by prepending char arrays of the right

Tested-by & discussed-with: dillon

17 years agoSynchronise with NetBSD:
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 19:00:49 +0000 (19:00 +0000)]
Synchronise with NetBSD:


v1.74: Add suspend/resume support.
v1.75: Fix typo: compolicated.
v1.76: A little portability stuff (lockmgr -> usb_lockmgr)
v1.78: add interrupt transfers
v1.79: use DPRINTF instead of a printf




NetBSD/OpenBSD specific things, lockmgr->usb_lockmgr..

17 years agoSynchronise with NetBSD (some come from OpenBSD):
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 15:34:17 +0000 (15:34 +0000)]
Synchronise with NetBSD (some come from OpenBSD):

v1.68: Adjust some silliness that was causing us to do extra work for "frame
       list rollover" interrupts, which we pretty much ignore.
v1.69: hcpriv is not actually used here.  Remove references to it.
v1.71: ANSIfy.
v1.72: Update printfs with accurate function names.
       Convert EHCI_LINK_TERMINATE using htole32().
v1.73: Fix spelling of intterupt.
       Use do .. while wrappers for debug print.

17 years agoPlace && at the right place.
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 15:09:38 +0000 (15:09 +0000)]
Place && at the right place.

17 years agoSync with NetBSD:
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 14:56:52 +0000 (14:56 +0000)]
Sync with NetBSD:


Although the dma descriptors are limited to any 4G address range,
the data is not, using extra area in the dma descriptors to
define a 64 bit address. This is described in appendix B
of the EHCI 1.0 spec from the URL in the file dev/usb/ehci.c.
With a 64 bit address capable controller these upper address
values must be set, the current driver does not do this.

17 years agoUpdate FreeBSD tag to what the source code has.
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 14:03:23 +0000 (14:03 +0000)]
Update FreeBSD tag to what the source code has.

17 years agoUpdate with the NetBSD code (which can include FreeBSD/OpenBSD changes):
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 13:59:55 +0000 (13:59 +0000)]
Update with the NetBSD code (which can include FreeBSD/OpenBSD changes):

v1.13: suspend/resume support
v1.14: was already applied by Matt, ifdefs for soft interrupt related stuff
v1.15: interrupt transfers, done originally by iedowse of FreeBSD, some minor
       changes by David Gwyne.  Note that NetBSD misattributed and OpenBSD did
       not attribute at all.
v1.16: implement a DMA memory reserve, ifdef'd for NetBSD.
v1.17: ifdefs for sc_child for NetBSD/OpenBSD.

17 years agoAdd vendor ids for ATi and Philips.
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 13:16:56 +0000 (13:16 +0000)]
Add vendor ids for ATi and Philips.

Add identificatio strings for the following:
  o ALi's M5239
  o AMD 8111
  o ATI SB200, SB400
  o Intel 6300ESB, ICH4, ICH5, ICH7
  o NVIDIA nForce 2, nForce 3, nForce 4
  o Philips ISP156x

17 years agoSynchronise with NetBSD v1.18:
Jeroen Ruigrok/asmodai [Sat, 27 Aug 2005 12:59:13 +0000 (12:59 +0000)]
Synchronise with NetBSD v1.18:

Allow 32 chars in the saved vendor string.  Fixes kern/29760.

17 years agoDereference pointer like we should.
Simon Schubert [Sat, 27 Aug 2005 10:20:27 +0000 (10:20 +0000)]
Dereference pointer like we should.

Found-by: sephe
17 years agoThe proper way to check for a normal mbuf cluster is with the
Jeffrey Hsu [Sat, 27 Aug 2005 03:05:24 +0000 (03:05 +0000)]
The proper way to check for a normal mbuf cluster is with the

17 years agoOnly include thread2.h for kernel builds (its macros are used by vm_page.h's
Matthew Dillon [Sat, 27 Aug 2005 00:56:57 +0000 (00:56 +0000)]
Only include thread2.h for kernel builds (its macros are used by vm_page.h's
inlines, which are also kernel-only).

17 years agoFix a serious bug in cache_inefficient_scan() related to its use of
Matthew Dillon [Sat, 27 Aug 2005 00:36:43 +0000 (00:36 +0000)]
Fix a serious bug in cache_inefficient_scan() related to its use of
VOP_READDIR().  VOP_READDIR() does very weird things when given both a
uio and cookies pointer.  Just give it a uio, instead.

This should fix a bug with the NFS server returning I/O errors to a
NFS client which is manipulating large directories.  The bug was preventing
the server from being able to resolve the namecache topology for a
disconnected directory vnode.

MFC in: 1 week.

17 years agoNo need to forget wcswidth.
Joerg Sonnenberger [Fri, 26 Aug 2005 22:03:26 +0000 (22:03 +0000)]
No need to forget wcswidth.

Found-by: Andreas Hauser
17 years agoDon't define infinite macros when we want to define infinity.
Joerg Sonnenberger [Fri, 26 Aug 2005 20:44:25 +0000 (20:44 +0000)]
Don't define infinite macros when we want to define infinity.

17 years agoWe have to copy the pam.d entries after running mtree, otherwise
Joerg Sonnenberger [Fri, 26 Aug 2005 15:25:59 +0000 (15:25 +0000)]
We have to copy the pam.d entries after running mtree, otherwise
/etc/pam.d will be created as normal file on old system.

Hasn't-updated-for-too-long: asmodai

17 years agoAdd a comment on top of ad_start, mentioning that it is called with
Hiten Pandya [Fri, 26 Aug 2005 14:26:45 +0000 (14:26 +0000)]
Add a comment on top of ad_start, mentioning that it is called with
a critical section held.

17 years agoStyle: break line into two, so it fits nicely in 80-column mode.
Hiten Pandya [Fri, 26 Aug 2005 13:02:07 +0000 (13:02 +0000)]
Style: break line into two, so it fits nicely in 80-column mode.

17 years agoAdd more documentation comments to disk_create() and dscheck().
Hiten Pandya [Fri, 26 Aug 2005 12:45:53 +0000 (12:45 +0000)]
Add more documentation comments to disk_create() and dscheck().

17 years agoReduce critical section warnings for AHC when critical section debugging
Matthew Dillon [Thu, 25 Aug 2005 23:37:35 +0000 (23:37 +0000)]
Reduce critical section warnings for AHC when critical section debugging
is turned on.  The warnings are due to the crit_enter() and crit_exit()
occuring in different procedures.

17 years agoRemove NO_B_MALLOC preprocessor macro, it was never turned on, and
Hiten Pandya [Thu, 25 Aug 2005 20:11:18 +0000 (20:11 +0000)]
Remove NO_B_MALLOC preprocessor macro, it was never turned on, and
just a hindrence.

Reviewed-by: Matthew Dillon

17 years agoChange the MAX_BUTTONS count to 31. This allows us to recognize more than
David Rhodus [Thu, 25 Aug 2005 18:48:19 +0000 (18:48 +0000)]
Change the MAX_BUTTONS count to 31.  This allows us to recognize more than
7 buttons on a mouse.

The same change was made in the NetBSD source.

17 years agoImplement FSMID. Use one of the spare 64 bit fields in the stat structure
Matthew Dillon [Thu, 25 Aug 2005 18:34:17 +0000 (18:34 +0000)]
Implement FSMID.  Use one of the spare 64 bit fields in the stat structure
for the FSMID.   The FSMID is a recursively updated field which allows one
to determine whether a subdirectory hierarchy has changed simply by checking
the base directory of the desired hierarchy.  The new field is st_fsmid.

The initial implementation stores the FSMID in the namecache, which means that
the FSMID will indicate a false change if a namecache entry is destroyed and
recreated.  A more deterministic test can be made by holding a file or
directory descriptor open.  However, it should be noted that DragonFly
implements a coherent and hierarchically consistent namecache so simply having
a subdirectory or file open will prevent the namecache records from that point
through to the root from being destroyed.

The FSMID can be used to greatly reduce the directories that must be searched
when synchronizing a filesystem.  The immediate intention is to use it to
provide a more efficient way to resynchronize a mirror (to generate journal
records 'diff'ing the current filesystem against a mirror), to improve
filesystem mirroring utilities, and to provide for an alternative backup
strategy that involves generating a diff set between two filesystems.
Normally such schemes would require the entire filesystem to be scanned, but
with FSMID the number of directories that must be searched can be greatly

TODO: It is desireable for the FSMID information to be stored more permanently
in the inode to survive reboots and to not return false hits due to namecache

Note that the FSMID facility does not work on an NFS client if the NFS server
or some other client modifies the filesystem.

17 years agoFix a bug introduced which causes chkgrp to coredump on certain group file
Liam J. Foy [Thu, 25 Aug 2005 17:09:32 +0000 (17:09 +0000)]
Fix a bug introduced which causes chkgrp to coredump on certain group file

Reported by: Nikolay Kalev, on freebsd-current

17 years agoConvert to use vop_write_direntry,
Simon Schubert [Thu, 25 Aug 2005 01:14:55 +0000 (01:14 +0000)]
Convert to use vop_write_direntry,
uio->uio_offset now is the directory entry number.

17 years agoA break was still hanging around from the conversion of
Simon Schubert [Thu, 25 Aug 2005 00:55:22 +0000 (00:55 +0000)]
A break was still hanging around from the conversion of
case to if, resulting in a directory listing which only
contained "." and nothing else and therefore confusing VFS.
Fix msdosfs by removing this break statement.

17 years agoWhen writing UNDO records, only try to output the file contents for VREG
Matthew Dillon [Wed, 24 Aug 2005 21:14:21 +0000 (21:14 +0000)]
When writing UNDO records, only try to output the file contents for VREG
vnodes (fixes a panic).  When writing the UNDO record for a symlink,
write out the contents of the symlink.

17 years agoFilesystem journaling. Reorganize the journal scan for the mountpoint to
Matthew Dillon [Wed, 24 Aug 2005 20:28:33 +0000 (20:28 +0000)]
Filesystem journaling.  Reorganize the journal scan for the mountpoint to
allow portions of the journal transaction to be written prior to the VOP
operation being executed, and accomodate transactional aborts if the VOP
fails.   Previously the journal records had to be written only after the VOP

Implement UNDO records, including writing out file data that is about to
be overwritten and the mtime prior to a write, rename, or remove.  UNDO
records allow us to create a reversable journal, where we can wind a mirror
forwards or backwards simply by scanning the journal forwards or backwards.

17 years agoAdd AbortProc typedef to simplify code.
Max Okumoto [Wed, 24 Aug 2005 00:09:29 +0000 (00:09 +0000)]
Add AbortProc typedef to simplify code.

17 years agoRemove #ifdef SYSVVARSUB since the code is required by posix
Max Okumoto [Wed, 24 Aug 2005 00:09:02 +0000 (00:09 +0000)]
Remove #ifdef SYSVVARSUB since the code is required by posix

17 years agoRemove some unnecessary white space.
Max Okumoto [Wed, 24 Aug 2005 00:08:05 +0000 (00:08 +0000)]
Remove some unnecessary white space.

17 years agoMake 'make upgrade' work from the LiveCD, stage 5/5:
Chris Pressey [Tue, 23 Aug 2005 21:33:29 +0000 (21:33 +0000)]
Make 'make upgrade' work from the LiveCD, stage 5/5:

- Have the 'make customizeiso' target in the nrelease Makefile
  populate the ISO's /etc directory with some files required by the
  'make upgrade' process, namely the Makefiles of several important
  subdirectories of /etc, and the entire architecture-specific

  Note that these extra files are not installed on the user's hard
  drive, as /etc on the ISO is only used to boot the LiveCD.

17 years agoMake 'make upgrade' work from the LiveCD, stage 4/5 or so:
Chris Pressey [Tue, 23 Aug 2005 21:25:26 +0000 (21:25 +0000)]
Make 'make upgrade' work from the LiveCD, stage 4/5 or so:

- Allow the behaviour of 'make upgrade' itself to depend on what
  manner of upgrade is requested.  Introduce a new variable,
  BINARY_UPGRADE, which, when set, indicates that a binary upgrade -
  that is, an upgrade of the configuration files in the absence of
  the system sources (generally, done from the LiveCD) - is desired.

17 years ago- Do not allocate memory to entries in /var/rwho which have been down for
Liam J. Foy [Tue, 23 Aug 2005 21:22:11 +0000 (21:22 +0000)]
- Do not allocate memory to entries in /var/rwho which have been down for
  more than 4 days - waste of memory.

17 years agoMake 'make upgrade' work from the LiveCD, stage 3/6 or so:
Chris Pressey [Tue, 23 Aug 2005 21:13:35 +0000 (21:13 +0000)]
Make 'make upgrade' work from the LiveCD, stage 3/6 or so:

- Expand inline the contents of simple external Makefile targets
  (namely those for "make etc-termcap" and "make etc-rmt") which will
  not be available in the absence of a full source tree.

17 years agosort forward declarations in header file
Max Okumoto [Tue, 23 Aug 2005 21:03:02 +0000 (21:03 +0000)]
sort forward declarations in header file

17 years agoMake 'make upgrade' work from the LiveCD, stage 2/5 or so:
Chris Pressey [Tue, 23 Aug 2005 21:00:39 +0000 (21:00 +0000)]
Make 'make upgrade' work from the LiveCD, stage 2/5 or so:

- Allow the location from which 'make upgrade' obtains its new
  configuration files to be specified.  Introduce a new variable,
  UPGRADE_SRCDIR, and obtain all new configuration files from
  this location, instead of from .CURDIR.  Have UPGRADE_SRCDIR
  default to .CURDIR so that there is no functional change in the
  typical use case.

17 years agoMake 'make upgrade' work from the LiveCD, stage 1/5 or so:
Chris Pressey [Tue, 23 Aug 2005 20:42:44 +0000 (20:42 +0000)]
Make 'make upgrade' work from the LiveCD, stage 1/5 or so:

- Make 'make preupgrade' honour the DESTDIR variable.

17 years agoReduce the buffer size for the threaded version of ttyname() to TTY_PATH_MAX.
Matthew Dillon [Tue, 23 Aug 2005 17:46:28 +0000 (17:46 +0000)]
Reduce the buffer size for the threaded version of ttyname() to TTY_PATH_MAX.

17 years agoAdd a TTY_PATH_MAX limit, set to 256, and reduce the size of the ttyname
Matthew Dillon [Tue, 23 Aug 2005 17:44:24 +0000 (17:44 +0000)]
Add a TTY_PATH_MAX limit, set to 256, and reduce the size of the ttyname
static buffer from 1024 to a more reasonable TTY_PATH_MAX.

17 years agoAdd missing parenthesis.
Sascha Wildner [Tue, 23 Aug 2005 17:14:15 +0000 (17:14 +0000)]
Add missing parenthesis.

17 years agoBack out accidental commit.
Joerg Sonnenberger [Tue, 23 Aug 2005 16:37:06 +0000 (16:37 +0000)]
Back out accidental commit.

17 years agosendmail tried to limit directory names to MAXPATHLEN - MAXNAMLEN in an
Joerg Sonnenberger [Tue, 23 Aug 2005 15:28:06 +0000 (15:28 +0000)]
sendmail tried to limit directory names to MAXPATHLEN - MAXNAMLEN in an
attempt to bound the size of full path names. This is bogus, because
most directory entries are much shorter than MAXNAMLEN and some
filesystems might allow longer path names than MAXNAMLEN. Change the
logic to bound all path names to PATH_MAX by checking the return values
of sm_strlcpy.

17 years agoAlso allocate PATH_MAX for the threaded case.
Joerg Sonnenberger [Tue, 23 Aug 2005 12:09:24 +0000 (12:09 +0000)]
Also allocate PATH_MAX for the threaded case.

17 years agoDon't assume that ttys are always located directly in /dev. This
Joerg Sonnenberger [Tue, 23 Aug 2005 12:06:48 +0000 (12:06 +0000)]
Don't assume that ttys are always located directly in /dev. This
assumptions breaks as soon as a proper pts filesystem comes into place.
Also ensure the static buffer is not overflown when reading from the

17 years agoRetire old, FreeBSD 4.x -derived ACPI code.
YONETANI Tomokazu [Tue, 23 Aug 2005 09:38:47 +0000 (09:38 +0000)]
Retire old, FreeBSD 4.x -derived ACPI code.

17 years agoAlso document BGE_FAKE_AUTONEG in LINT.
Joerg Sonnenberger [Mon, 22 Aug 2005 22:05:48 +0000 (22:05 +0000)]
Also document BGE_FAKE_AUTONEG in LINT.

17 years agoUpdate the TWE 3ware/AMCC driver code, bringing in all the fixes made
Hiten Pandya [Mon, 22 Aug 2005 21:16:20 +0000 (21:16 +0000)]
Update the TWE 3ware/AMCC driver code, bringing in all the fixes made
by Vinod Kashyap and Paul Saab in FreeBSD-5/STABLE, and retaining
those by David Rhodus and Matthew Dillon.

Remove some compatibility preprocessor BUF/BIO compatibility macros.

Changeset thoroughly tested by Tomaz Borstnar, Matthew Dillon and
David Rhodus.  Inspired by a heads-up from YONETANI Tomokazu.

17 years agoGC unused macro.
Joerg Sonnenberger [Mon, 22 Aug 2005 20:21:21 +0000 (20:21 +0000)]
GC unused macro.

noticed-by: dillon

17 years agoCreate a kernel option BGE_FAKE_AUTONEG for IBM/Intel blade servers,
Joerg Sonnenberger [Mon, 22 Aug 2005 18:29:52 +0000 (18:29 +0000)]
Create a kernel option BGE_FAKE_AUTONEG for IBM/Intel blade servers,
which should make the DNLK switch module work.  IBM/Intel blade server
with Intel or AD switch modules should work without the kernel options

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years agoAdd descriptive comment back in
Simon Schubert [Mon, 22 Aug 2005 16:53:26 +0000 (16:53 +0000)]
Add descriptive comment back in

17 years agoInstead of resetting the video buffer's history size to the system
Matthew Dillon [Sun, 21 Aug 2005 19:11:28 +0000 (19:11 +0000)]
Instead of resetting the video buffer's history size to the system
default, reset it to the last vidcontrol-specified size.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
17 years agoHave vidcontrol set the video history size based on a new rc.conf variable,
Matthew Dillon [Sun, 21 Aug 2005 19:08:12 +0000 (19:08 +0000)]
Have vidcontrol set the video history size based on a new rc.conf variable,

Submitted-by: Alexey Slynko <slynko@tronet.ru>
17 years agoRemove the hack that varied the first character of the output file name
Liam J. Foy [Sun, 21 Aug 2005 18:58:34 +0000 (18:58 +0000)]
Remove the hack that varied the first character of the output file name
if none was specified on the command line. This is not permitted by
POSIX, and no longer needed now that we have the -a option.

Taken from: FreeBSD
Requested by: hmp@

17 years ago* Add a definition for a panic key (CNTL-ALT-SHIFT-ESC) to every keymap
Sascha Wildner [Sat, 20 Aug 2005 19:22:37 +0000 (19:22 +0000)]
* Add a definition for a panic key (CNTL-ALT-SHIFT-ESC) to every keymap
  file that didn't already have one. This can be useful for producing a
  dump when DDB is not compiled in or otherwise unavailable. In order to
  use the panic key set the sysctl machdep.enable_panic_key to 1.

* Regenerate the kernel default keymap.

17 years agoRemove PC98 support.
Sascha Wildner [Sat, 20 Aug 2005 18:51:28 +0000 (18:51 +0000)]
Remove PC98 support.

17 years agoHPFS != UFS, so use the right constant for directory entries. Check
Joerg Sonnenberger [Sat, 20 Aug 2005 18:37:21 +0000 (18:37 +0000)]
HPFS != UFS, so use the right constant for directory entries. Check
explicitly for wraparound or negative offsets, don't depend on type
limits to do that.

17 years agoConvert to use vop_write_dirent.
Simon Schubert [Sat, 20 Aug 2005 13:26:58 +0000 (13:26 +0000)]
Convert to use vop_write_dirent.

17 years agoscm test.
David Rhodus [Fri, 19 Aug 2005 19:22:38 +0000 (19:22 +0000)]
scm test.

17 years agoPrevent spurious link state changes.
Joerg Sonnenberger [Fri, 19 Aug 2005 14:43:30 +0000 (14:43 +0000)]
Prevent spurious link state changes.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years agoEnable the memory arbiter before turning off the PXE restart. This
Joerg Sonnenberger [Fri, 19 Aug 2005 14:42:19 +0000 (14:42 +0000)]
Enable the memory arbiter before turning off the PXE restart.  This
prevents NMI's from happening when resetting the chip on some hardware
I have seen.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years agoAtomically load and clear the status block. This makes the bge
Joerg Sonnenberger [Fri, 19 Aug 2005 14:41:07 +0000 (14:41 +0000)]
Atomically load and clear the status block.  This makes the bge
devices work much better when interrupts are shared.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years ago5705K, 5714C, 5721, 5750, 5750M, 5751M, 5789 support.
Joerg Sonnenberger [Fri, 19 Aug 2005 14:40:03 +0000 (14:40 +0000)]
5705K, 5714C, 5721, 5750, 5750M, 5751M, 5789 support.
Add some hacks from the Broadcom Linux driver. Reorder initialisation to
give bge_reset / bge_chipinit what it needs.

Obtained-from: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years agoRegen.
Joerg Sonnenberger [Fri, 19 Aug 2005 14:36:21 +0000 (14:36 +0000)]

17 years agoAdd some new Broadcom IDs.
Joerg Sonnenberger [Fri, 19 Aug 2005 14:35:53 +0000 (14:35 +0000)]
Add some new Broadcom IDs.

Based-on: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
17 years agoConvert to vop_write_dirent.
Joerg Sonnenberger [Fri, 19 Aug 2005 14:02:39 +0000 (14:02 +0000)]
Convert to vop_write_dirent.

17 years agoImprove C++ support.
Joerg Sonnenberger [Thu, 18 Aug 2005 17:11:09 +0000 (17:11 +0000)]
Improve C++ support.

Obtained-from: FreeBSD
Submitted-by: Andreas Hauser
17 years agoCheck result of setenv(putenv) function.
Max Okumoto [Thu, 18 Aug 2005 07:58:30 +0000 (07:58 +0000)]
Check result of setenv(putenv) function.

Submitted by: Alexey Slynko

17 years agoThe bix bug was introduced on commit 2005/05/20 04:48:55
Max Okumoto [Wed, 17 Aug 2005 09:04:40 +0000 (09:04 +0000)]
The bix bug was introduced on commit 2005/05/20 04:48:55
When I changed the API for str_concat().  Instead
of passing a space character I passed a '/'

Bug found by Jonathon McKitrick.

17 years agoExplicitly specify `all' as the default target(as it used to be), so as
YONETANI Tomokazu [Wed, 17 Aug 2005 02:51:45 +0000 (02:51 +0000)]
Explicitly specify `all' as the default target(as it used to be), so as
issuing make command without target name in the kernel build directory
won't end up building the first target.

Reported-by: Noritoshi Demizu
17 years agoMake links for hoststat(8) and purgestat(8) man pages.
Gregory Neil Shapiro [Wed, 17 Aug 2005 02:47:06 +0000 (02:47 +0000)]
Make links for hoststat(8) and purgestat(8) man pages.

17 years agoUse vop_write_dirent. Correctly handle the case of spare fd tables, e.g.
Joerg Sonnenberger [Tue, 16 Aug 2005 22:40:03 +0000 (22:40 +0000)]
Use vop_write_dirent. Correctly handle the case of spare fd tables, e.g.
0, 1, 2 and 8 are open and 3 to 7 are closed.

17 years agoUtilize vop_write_dirent. Slightly change the order by writing to
Joerg Sonnenberger [Tue, 16 Aug 2005 21:37:54 +0000 (21:37 +0000)]
Utilize vop_write_dirent. Slightly change the order by writing to
userland first and fetching the inode information afterwards. This
should be save and removes the need for copying the name first.

Basic testing by: Sergey Gluschenko

17 years agoConvert to vop_write_dirent.
Joerg Sonnenberger [Tue, 16 Aug 2005 19:16:39 +0000 (19:16 +0000)]
Convert to vop_write_dirent.

XXX The loop is now left on the first error, which makes a lot more
sense, but can also slightly change the behaviour. The old behaviour was
clearly wrong.

17 years agoSprinkle some const.
Joerg Sonnenberger [Tue, 16 Aug 2005 16:27:41 +0000 (16:27 +0000)]
Sprinkle some const.

17 years agoHonor process visibility for jailed processes and ps_showallprocs for
Joerg Sonnenberger [Tue, 16 Aug 2005 16:10:34 +0000 (16:10 +0000)]
Honor process visibility for jailed processes and ps_showallprocs for
non-root users. Move the check for invalid offsets into

17 years agoSplit the two parts of procfs_readdir into subroutines.
Joerg Sonnenberger [Tue, 16 Aug 2005 16:09:05 +0000 (16:09 +0000)]
Split the two parts of procfs_readdir into subroutines.
Don't scale offsets by the maximum directory entry size.
Honor visibility of processes for jailed processes.
Prefer LIST_* macros over direct access.

17 years agoGet rid of 4.x-derived acpi code:
YONETANI Tomokazu [Tue, 16 Aug 2005 10:31:35 +0000 (10:31 +0000)]
Get rid of 4.x-derived acpi code:
- move most part of /sys/dev/acpica5/Makefile.inc into /sys/conf/acpi.mk
  make them relative to $S (or $SYSDIR) so as they can be shared between
  kernel and modules builds
- remove 4.x ACPI lines from, and add acpica5 lines to, /sys/conf/files*
- make LINT to use `device acpi' instead of older `device acpica'
- adjust ACPI driver build wrapper and ACPI tools to use /sys/conf/acpi.mk

17 years agoSplit the two parts of linprocfs_readdir into subroutines.
Joerg Sonnenberger [Mon, 15 Aug 2005 16:50:51 +0000 (16:50 +0000)]
Split the two parts of linprocfs_readdir into subroutines.
We can generate arbitrary offsets, so factor out the directory entry
length and use the index directly. Use vop_write_dirent.

17 years agoConvert RANDOM_IP_ID into a sysctl.
Matthew Dillon [Mon, 15 Aug 2005 16:46:22 +0000 (16:46 +0000)]
Convert RANDOM_IP_ID into a sysctl.

Submitted-by: Gordon Bergling <gbergling@0xfce3.net>
17 years agoRip off PROCFS_ZOMBIE, it wasn't even a knob to play with.
Joerg Sonnenberger [Mon, 15 Aug 2005 13:49:55 +0000 (13:49 +0000)]
Rip off PROCFS_ZOMBIE, it wasn't even a knob to play with.

17 years agoUFS sometimes reports: 'ufs_rename: fvp == tvp (can't happen)'. The case
Matthew Dillon [Mon, 15 Aug 2005 07:26:47 +0000 (07:26 +0000)]
UFS sometimes reports: 'ufs_rename: fvp == tvp (can't happen)'.  The case
is not supposed to be able to happen, and UFS ignores the rename operation
when it sees it.   This is true in both FreeBSD and DragonFly.

But, in fact, the case CAN happen if you rename a file to another that
happens to be a hardlink to the first.  The rename operations appears to
succeed but winds up being a NOP because UFS incorrectly believes that the
case represents renaming a file to itself when it doesn't.  Both files
remain in existance when the source file should have been removed.

Detect the condition and issue VOP_NREMOVE instead of VOP_NRENAME when
the source and target represent different namespaces but wind up pointing
to the same physical vnode.

Reported-by: =?ISO-8859-2?Q?Toma=BE_Bor=B9tnar?= <tomaz.borstnar@amis.net>
17 years agoFix an inode bitmap scanning bug. Due to an error in the length adjustment
Matthew Dillon [Sun, 14 Aug 2005 18:53:42 +0000 (18:53 +0000)]
Fix an inode bitmap scanning bug.  Due to an error in the length adjustment
the first scanned byte of the inode bitmap could be checked twice under a
specific and rare but intentionally reproducable set of conditions.  This
resulted in a sanity check failing and a panic.  The required conditions are:

* Very few available inodes in the cylinder group.

* All available inodes are still in the inode hashmap (related vnodes have
  not been completely destroyed yet) and thus skipped.

* The first scanned byte (indexed by the rotor) contains one of these
  not-quite-free inodes.

It should be noted that even though this error exists in FreeBSD-4, the
conditions never occur to trigger it becaues FreeBSD-4 will reuse a vnode
that is still not completely destroyed.  DragonFly does not reuse such vnodes
because they represent a weird and fairly rare code situation that could
lead to bugs, and because attempting to reuse such vnodes/inodes represent
potential stall points.

Found-with: blogbench script provided by Tomaz Borstnar.

17 years agoFix a race in rename when relocking the source namecache entry. Since we
Matthew Dillon [Sun, 14 Aug 2005 18:41:13 +0000 (18:41 +0000)]
Fix a race in rename when relocking the source namecache entry.  Since we
may have blocked previously it is possible for the namecache entry to become
invalid (not destroyed since we hold a ref, but invalid).  For example, if
the source was removed.  This case only occurs when rename() is racing
against a remove() or another rename that is overwriting the target that
represents our 'from' name.

The race resulted in a NULL pointer dereference.

Reported-by: =?ISO-8859-2?Q?Toma=BE_Bor=B9tnar?= <tomaz.borstnar@amis.net>
17 years agoAdd a sanity check for the length of the file name to vop_write_dirent().
Matthew Dillon [Sun, 14 Aug 2005 18:38:27 +0000 (18:38 +0000)]
Add a sanity check for the length of the file name to vop_write_dirent().

17 years agoAllow the VESA code to handle devices that don't claim to be VGA devices.
Sascha Wildner [Sat, 13 Aug 2005 16:43:34 +0000 (16:43 +0000)]
Allow the VESA code to handle devices that don't claim to be VGA devices.
This fixes VESA support when running under vmware.

Taken from: FreeBSD (rev. 1.51)