dragonfly.git
16 years agoAdd pselect syscall.
Nicolas Thery [Thu, 10 Jan 2008 22:30:28 +0000 (22:30 +0000)]
Add pselect syscall.

Add pselect man page (obtained from FreeBSD).

Add pselect wrapper in libthread_xu that calls pselect syscall.

Add pselect wrapper in libc_r that calls poll syscall (see XXX in code
and BUGS in pselect man page).

Changed libbind to use pselect syscall instead of locally defined wrapper.

16 years agoWarn the user if he uses -e and procfs(5) is not mounted.
Matthias Schmidt [Thu, 10 Jan 2008 14:18:39 +0000 (14:18 +0000)]
Warn the user if he uses -e and procfs(5) is not mounted.

Obtained-from: FreeBSD

16 years agoDon't enable ATTACH/INIT/TXPOWER debug prints by default.
Sepherosa Ziehau [Thu, 10 Jan 2008 13:01:40 +0000 (13:01 +0000)]
Don't enable ATTACH/INIT/TXPOWER debug prints by default.

Requested-by: hasso@
16 years ago- Add additional parameter to firmware_image_load(), since some devices do
Sepherosa Ziehau [Thu, 10 Jan 2008 12:45:10 +0000 (12:45 +0000)]
- Add additional parameter to firmware_image_load(), since some devices do
  not require firmware image to be in contiguous memory.
- Adjust bwi(4) according to above change.
- In firmware_image_load_file(), fix memory leakage by freeing temporary
  firmware path.

16 years agoAdd support for network devices found on Intel ICH9 hardware. I have one
Matthias Schmidt [Thu, 10 Jan 2008 10:44:28 +0000 (10:44 +0000)]
Add support for network devices found on Intel ICH9 hardware.  I have one
of these devices in a 3GHz Core 2 Duo.  More information can be found
here: http://download.intel.com/design/chipsets/datashts/31697202.pdf

The diff is rather trivial, but let me know if I broke something :)

em0@pci0:25:0:  class=0x020000 card=0x00018086 chip=0x10bd8086 rev=0x02 hdr=0x00
    vendor   = 'Intel Corporation'
    device   = '82566DM-2 Gigabit Network Connection'
    class    = network
    subclass = ethernet

em0: <Intel(R) PRO/1000 Network Connection, Version - 6.2.9> port 0x30e0-0x30ff
mem 0x93224000-0x93224fff,0x93200000-0x9321ffff irq 11 at device 25.0 on pci0

Reviewed-by: sephe@
Taken-in-pieces-from:  FreeBSD

16 years agoReplace home-grown list iteration with methods from sys/queue.h
Matthias Schmidt [Thu, 10 Jan 2008 10:31:48 +0000 (10:31 +0000)]
Replace home-grown list iteration with methods from sys/queue.h

Reviewed-by: corecode@, hasso@
16 years agoHAMMER 17/many: Refactor IO backend, clean up buffer cache deadlocks.
Matthew Dillon [Thu, 10 Jan 2008 07:41:03 +0000 (07:41 +0000)]
HAMMER 17/many: Refactor IO backend, clean up buffer cache deadlocks.

Rewrite HAMMER's IO backend, sans locking which will occur in another patch.
The new backend is far less confusing though I wouldn't exactly call it
simple.

The new backend keeps track of dependancies with a structure->structure
dependancy list, plus implements the special case of opening and closing
a cluster header.  Buffers are synchronized first, then cluster headers,
then volume headers.  The new backend also removes a number of potential
deadlocks.

16 years agoFix buffer cache deadlocks by splitting dirty buffers into two categories:
Matthew Dillon [Thu, 10 Jan 2008 07:34:04 +0000 (07:34 +0000)]
Fix buffer cache deadlocks by splitting dirty buffers into two categories:
Light weight dirty buffers and heavy weight dirty buffers.  Add a second
buffer cache flushing daemon to deal with the heavy weight dirty buffers.

Currently only HAMMER uses the new feature, but it can also easily be used
by UFS in the future.

Buffer cache deadlocks can occur in low memory situations where the buffer
cache tries to flush out dirty buffers and deadlocks when the act of
flushing a dirty buffer requires additional buffers to be acquired.  Because
there was only one buffer flushing daemon, a deadlock on a heavy weight buffer
prevented any further buffer flushes, whether light or heavy weight, and
wound up deadlocking the entire system.

Giving the heavy weight buffers their own daemon solves the problem by
allowing light weight buffers to continue to be flushed even if a stall
occurs on a heavy weight buffer.  The numbers of dirty heavy weight buffers
is limited to ensure that enough light weight buffers are available.

This is primarily implemented by changing getblk()'s mostly unused slpflag
parameter to a new blkflags parameter and adding a new buffer cache queue
called BQUEUE_DIRTY_HW.

16 years ago* Add a missing kernel option and a VGA spec reference.
Sascha Wildner [Wed, 9 Jan 2008 22:08:29 +0000 (22:08 +0000)]
* Add a missing kernel option and a VGA spec reference.

* Fix some mdoc issues & typos.

16 years agoRemove a lot of old, mummified code whose sole purpose was probing and
Sascha Wildner [Wed, 9 Jan 2008 21:29:11 +0000 (21:29 +0000)]
Remove a lot of old, mummified code whose sole purpose was probing and
initialization of ye olde mono adapter/color adapter combination.

Instead of this, generally assume that we are dealing with one VGA
card.

After this commit, the VGA code is still a mess, but a slightly
smaller one. :)

16 years agoFix conditional so that the linux module is loaded.
Joe Talbott [Wed, 9 Jan 2008 18:51:08 +0000 (18:51 +0000)]
Fix conditional so that the linux module is loaded.

16 years agoRemove references to kldxref(8) which we don't have.
Sascha Wildner [Wed, 9 Jan 2008 11:30:09 +0000 (11:30 +0000)]
Remove references to kldxref(8) which we don't have.

16 years agoFix lockuninit.
Simon Schubert [Wed, 9 Jan 2008 10:59:12 +0000 (10:59 +0000)]
Fix lockuninit.

lockuninit was acquiring the spinlock embedded in struct lock, thus
incrementing the per-thread spinlock count. However, spin_uninit does
not decrement the count, resulting in a panic when trying to sleep
("lwkt_switch: still holding %d exclusive spinlocks!"). From now on,
require that the caller already holds the struct lock in question so
that lockuninit can rely on it being the sole owner of the lock.

Lots of help from: corecode@, aggelos

Comment from Aggelos: "That's what you get when commiting code without
any in-tree users."

Submitted-by: nant@
16 years agoUse .Pa for URLs.
Sascha Wildner [Wed, 9 Jan 2008 09:03:34 +0000 (09:03 +0000)]
Use .Pa for URLs.

16 years agoHAMMER 16B/many: Fix data overwrite case.
Matthew Dillon [Wed, 9 Jan 2008 04:05:37 +0000 (04:05 +0000)]
HAMMER 16B/many: Fix data overwrite case.

HAMMER will often write out data records for an inode before writing out
the newly created inode itself.  This is desireable because it allows
HAMMER to avoid replacing the on-disk inode record every time the file
size changes.

Fix a bug related to this issue where HAMMER was not checking for on-disk
data records in the data overwrite case prior to the inode being written
out.

16 years agoHAMMER 16/many - Recovery infrastructure, misc bug fixes
Matthew Dillon [Wed, 9 Jan 2008 00:46:22 +0000 (00:46 +0000)]
HAMMER 16/many - Recovery infrastructure, misc bug fixes

* Add A-list recovery and iteration support.  This code fixes up an A-list
  which might have been partially modified or gotten out of sync.

* Add substantial cluster recovery infrastructure (not yet enabled).  The
  code still needs to go through a few test/debug cycles and does not
  yet handle cluster pushes.

* Fix a critical section and a bug in the A-list empty-check code (the
  latter not yet used by HAMMER but will be soon).  The wrong base free
  block count was being supplied.

* Add a synchronizing transaction id field to the cluster header.  This
  field will be used by the recovery code.

* For the moment add a bitmap of buffers allocated to record arrays.  The
  bitmap is in the cluster header.  This may or may not be temporary.  For
  now it will allow the recovery code to wipe the cluster's A-list's and
  then iterate records to regenerate them.

16 years agoRemove old file.
Simon Schubert [Wed, 9 Jan 2008 00:09:10 +0000 (00:09 +0000)]
Remove old file.

16 years agoCompile the kernel and modules with C99 warnings, not C90 (-ansi).
Simon Schubert [Wed, 9 Jan 2008 00:07:57 +0000 (00:07 +0000)]
Compile the kernel and modules with C99 warnings, not C90 (-ansi).

This does not remove or add warnings, but will allow for new features,
especially // C++ commends, which are used by some 3rd party sources.

16 years agoRemove trailing whitespace.
Sascha Wildner [Tue, 8 Jan 2008 20:30:57 +0000 (20:30 +0000)]
Remove trailing whitespace.

16 years agoBrush up the example a bit.
Sascha Wildner [Tue, 8 Jan 2008 17:45:43 +0000 (17:45 +0000)]
Brush up the example a bit.

16 years agoUse the new kldstat -q/-m options instead of "| grep"
Matthias Schmidt [Tue, 8 Jan 2008 15:30:34 +0000 (15:30 +0000)]
Use the new kldstat -q/-m options instead of "| grep"

16 years agoSync with FreeBSD. This bings us the -m option to look for a specific
Matthias Schmidt [Tue, 8 Jan 2008 15:27:57 +0000 (15:27 +0000)]
Sync with FreeBSD.  This bings us the -m option to look for a specific
module and -q which checks if a module is loaded and set the return
value accordingly.

16 years agoRemove reference to the FreeBSD developers handbook. We have a chapter
Matthias Schmidt [Tue, 8 Jan 2008 14:20:46 +0000 (14:20 +0000)]
Remove reference to the FreeBSD developers handbook.  We have a chapter
about kernel debugging in our own handbook now.  The reference to the FreeBSD
chapter is kept as link in the mentioned chapter.

16 years agoFix id of the 945GME chip.
Hasso Tepper [Tue, 8 Jan 2008 04:25:07 +0000 (04:25 +0000)]
Fix id of the 945GME chip.

16 years agoThis one is a very accessible intro to err.. nearly everything. And I had some
Nuno Antunes [Tue, 8 Jan 2008 00:43:23 +0000 (00:43 +0000)]
This one is a very accessible intro to err.. nearly everything. And I had some
loud laughs while reading it too.

16 years agoAdd _rtld_functrace support.
Simon Schubert [Tue, 8 Jan 2008 00:02:04 +0000 (00:02 +0000)]
Add _rtld_functrace support.

Joint-work-with:  aggelos@

16 years agofill_kinfo_proc() may be asked to load information on a zombied process,
Matthew Dillon [Mon, 7 Jan 2008 23:41:55 +0000 (23:41 +0000)]
fill_kinfo_proc() may be asked to load information on a zombied process,
deal with NULL pointers in the proc structure.

Reported-by: Peter Avalos <pavalos@theshell.com>
16 years agoSync the passive fingerprinting database with OpenBSD to get support for
Matthias Schmidt [Mon, 7 Jan 2008 14:46:46 +0000 (14:46 +0000)]
Sync the passive fingerprinting database with OpenBSD to get support for
the latest OS.

16 years agoAdd pam(3) support for cron(8). cron uses pam to check if the user's account
Matthias Schmidt [Mon, 7 Jan 2008 14:11:23 +0000 (14:11 +0000)]
Add pam(3) support for cron(8).  cron uses pam to check if the user's account
is expired, locked or whatever.  If this is true cron skips the entries of
the users crontab.  Skip this for system tasks.

Obtained-from:  FreeBSD

16 years agoIf -m is specified, a newfs(8) command is printed that can be used to
Matthias Schmidt [Mon, 7 Jan 2008 12:07:06 +0000 (12:07 +0000)]
If -m is specified, a newfs(8) command is printed that can be used to
generate a new file system with equivalent settings.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue868
Submitted-by: Eric <ejc@thousandplaces.org>
Obtained-from: FreeBSD

16 years agoFix brain-o introduced in my previous commit.
Sascha Wildner [Mon, 7 Jan 2008 09:42:07 +0000 (09:42 +0000)]
Fix brain-o introduced in my previous commit.

Reported-by: Jason Smethers <jason@smethers.net>
16 years agoDon't segfault when printing unknown signals.
Simon Schubert [Mon, 7 Jan 2008 01:35:43 +0000 (01:35 +0000)]
Don't segfault when printing unknown signals.

16 years agoPull up CVS idents from FreeBSD to match our current version.
Simon Schubert [Mon, 7 Jan 2008 01:34:58 +0000 (01:34 +0000)]
Pull up CVS idents from FreeBSD to match our current version.

16 years agoAdd small hack to allow both agp and drm to attach to i810+ devices.
Simon Schubert [Mon, 7 Jan 2008 01:27:17 +0000 (01:27 +0000)]
Add small hack to allow both agp and drm to attach to i810+ devices.

Obtained-from:  FreeBSD (6.x)

16 years agoUpdate from FreeBSD:
Simon Schubert [Mon, 7 Jan 2008 01:25:29 +0000 (01:25 +0000)]
Update from FreeBSD:

Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture.  Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.

Obtained-from:  FreeBSD

16 years agoRename RB_STATIC_* to RB_*_STATIC to match up with FreeBSD.
Simon Schubert [Mon, 7 Jan 2008 01:22:30 +0000 (01:22 +0000)]
Rename RB_STATIC_* to RB_*_STATIC to match up with FreeBSD.

16 years agoLet's try and start a tradition here. This is book is now a classic.
Aggelos Economopoulos [Mon, 7 Jan 2008 01:01:29 +0000 (01:01 +0000)]
Let's try and start a tradition here. This is book is now a classic.
Hopefully some future committer will tease us with an excerpt from
an unknown book we'll all want to read. Yeah, right.

16 years agoAdd sdpd(8) (Bluetooth Service Discovery Protocol daemon) and sdpquery(1)
Hasso Tepper [Sun, 6 Jan 2008 21:51:30 +0000 (21:51 +0000)]
Add sdpd(8) (Bluetooth Service Discovery Protocol daemon) and sdpquery(1)
(SDP query utility). Also add btconfig rc script in progress.

Obtained-from: NetBSD

16 years agoRemove bogus checks after kmalloc(M_WAITOK) which never returns NULL.
Sascha Wildner [Sun, 6 Jan 2008 16:55:53 +0000 (16:55 +0000)]
Remove bogus checks after kmalloc(M_WAITOK) which never returns NULL.

Reviewed-by: hasso
16 years agoRemoved non-existent entry in .PATH:.
Nicolas Thery [Sun, 6 Jan 2008 16:15:29 +0000 (16:15 +0000)]
Removed non-existent entry in .PATH:.

16 years agoAccording to Ralink Linux driver, tx/encryption intr processing should be
Sepherosa Ziehau [Sun, 6 Jan 2008 03:03:17 +0000 (03:03 +0000)]
According to Ralink Linux driver, tx/encryption intr processing should be
called when rx intr comes.

16 years agoReplace MALLOC()/bzero() with MALLOC(M_ZERO).
Sascha Wildner [Sun, 6 Jan 2008 01:51:55 +0000 (01:51 +0000)]
Replace MALLOC()/bzero() with MALLOC(M_ZERO).

16 years agoRemove some dead code.
Sascha Wildner [Sun, 6 Jan 2008 01:29:00 +0000 (01:29 +0000)]
Remove some dead code.

16 years agoSync trm manual with FreeBSD.
Peter Avalos [Sat, 5 Jan 2008 22:46:35 +0000 (22:46 +0000)]
Sync trm manual with FreeBSD.

16 years agoSync with FreeBSD.
Peter Avalos [Sat, 5 Jan 2008 22:44:08 +0000 (22:44 +0000)]
Sync with FreeBSD.

16 years agoSync with FreeBSD:
Peter Avalos [Sat, 5 Jan 2008 22:24:08 +0000 (22:24 +0000)]
Sync with FreeBSD:

CAM_NEW_TRAN_CODE fixes.

Remove unneeded includes and add missing ones.

Use BUS_PROBE_DEFAULT in preference to 0.

Call trm_Interrupt() in trm_poll(). This fixes the lock at reboot time some
people reported in FreeBSD.

Use bus_alloc_resource_any(9).

Use one bus_dma_tag_t for all pSRB instead of creating one for each.
Free what is allocated for pSRBs at unload time or if something bad happens.

Do not test if pDCB is not NULL, we dereference it before anyway, and it
should not happen. Add a KASSERT instead.

Mark trm as depending on cam.

Use PCIR_BAR(x) instead of PCIR_MAPS.

Remove two useless bzero() calls.

Use cam_calc_geometry.

Indentation/style fixes.

Add support for Tekram DC395U2W cards.

Obtained-from: FreeBSD

16 years agokmalloc(M_WAITOK) never returns NULL.
Nicolas Thery [Sat, 5 Jan 2008 16:56:17 +0000 (16:56 +0000)]
kmalloc(M_WAITOK) never returns NULL.

16 years agoFor kmalloc(), MALLOC() and contigmalloc(), use M_ZERO instead of
Sascha Wildner [Sat, 5 Jan 2008 14:02:41 +0000 (14:02 +0000)]
For kmalloc(), MALLOC() and contigmalloc(), use M_ZERO instead of
explicitly bzero()ing.

Reviewed-by: sephe
16 years agoCorrect errno value to comply with SUSv3.
Simon Schubert [Sat, 5 Jan 2008 13:38:08 +0000 (13:38 +0000)]
Correct errno value to comply with SUSv3.

16 years agoAdd support for newer CPU models.
Simon Schubert [Sat, 5 Jan 2008 13:37:15 +0000 (13:37 +0000)]
Add support for newer CPU models.

Obtained-from:  FreeBSD

16 years agoDefine _KERNEL_STRUCTURES when obtaining the list of include files.
Simon Schubert [Sat, 5 Jan 2008 13:36:37 +0000 (13:36 +0000)]
Define _KERNEL_STRUCTURES when obtaining the list of include files.

16 years agoCall selwakeup() from an MP-protected taskqueue.
Simon Schubert [Sat, 5 Jan 2008 13:34:22 +0000 (13:34 +0000)]
Call selwakeup() from an MP-protected taskqueue.

Before, we would call selwakeup() from interrupt context.  This
was working as long kern.intr_mpsafe == 0.  selwakeup() however needs
the MP lock held, so we can't call it directly from the interrupt
when running with kern.intr_mpsafe=1.

Instead, perform the wakeup from a "bottom half" taskqueue SWI to make the
sound devices intr_mpsafe, as they claim to be.

16 years agoDon't let DS_BUSY buses block attachment of other devices.
Simon Schubert [Sat, 5 Jan 2008 13:30:33 +0000 (13:30 +0000)]
Don't let DS_BUSY buses block attachment of other devices.

DS_BUSY implies that the device has been in state DS_ATTACHED
before, so we need include DS_BUSY buses in the search as well.

Joint-work-with:  matthias@

16 years agoExport bootverbose as sysctl debug.bootverbose.
Simon Schubert [Sat, 5 Jan 2008 13:23:48 +0000 (13:23 +0000)]
Export bootverbose as sysctl debug.bootverbose.

16 years agoCommit pkg_radd(1) on behalf of corecode@. pkg_radd is a wrapper for
Matthias Schmidt [Sat, 5 Jan 2008 10:14:26 +0000 (10:14 +0000)]
Commit pkg_radd(1) on behalf of corecode@.  pkg_radd is a wrapper for
pkg_add(1) to install binary packages.  This allows users to install binary
packages out-of-the-box without fetching the pkgsrc(7) tree or without
looking at any site hosting binary packages.

  # pkg_radd -v host
  [...]
  extract: Package name is host-20040812
  extract: CWD to /usr/pkg
  [...]
  Attempting to record package into /var/db/pkg/host-20040812.
  Package host-20040812 registered in /var/db/pkg/host-20040812

The mentioned /etc/settings.conf will follow in a later commit.  pkg_radd
will work fine without that file.

Submitted-by: corecode@
mdoc-ok-by: swildner@

16 years agoBuild aic(4) as a kernel module.
Peter Avalos [Sat, 5 Jan 2008 08:16:04 +0000 (08:16 +0000)]
Build aic(4) as a kernel module.

16 years agoSync with FreeBSD:
Peter Avalos [Sat, 5 Jan 2008 07:27:09 +0000 (07:27 +0000)]
Sync with FreeBSD:

Eliminate support for oldcard by removing the compat shims.

Convert callers to the new bus_alloc_resource_any(9) API.

Initialize variable to fix possible warning.

Use cam_calc_geometry().

Be consistent about "static" functions.

Support for LG GM82C700, an AIC6360 clone.

Add PnP IDs for AHA-1530 and AHA-1520 cards.

Enable 10MHz (fast SCSI) operation on boards that support it.

Bounds check sync periods and offsets passed in from the transport layer.

Tell the user which resource allocation failed (for the ISA probe) if we
weren't able to allocate an IRQ, DRQ or I/O port.

Remove unneeded includes.

Obtained-from: FreeBSD

16 years ago.Pp before .Sh is not needed.
Sascha Wildner [Fri, 4 Jan 2008 18:17:49 +0000 (18:17 +0000)]
.Pp before .Sh is not needed.

16 years agoRenamed kern.ps_showallprocs to security.ps_showallprocs
Matthias Schmidt [Fri, 4 Jan 2008 12:31:45 +0000 (12:31 +0000)]
Renamed kern.ps_showallprocs to security.ps_showallprocs

16 years agoMove the following entries from kern to security
Matthias Schmidt [Fri, 4 Jan 2008 12:16:19 +0000 (12:16 +0000)]
Move the following entries from kern to security

- kern.ps_showallprocs
- kern.ps_showallthreads
- kern.unprivileged_read_msgbuf
- kern.hardlink_check_uid
- kern.hardlink_check_gid

This is only a cosmetic change helping users to find the right sysctls
more easily.  And it could help if we want to add more security related
function (eg MAC framework etc).

While here add missing description for three of them.

16 years agoAdd btconfig(8) - the utility used to configure Bluetooth devices.
Hasso Tepper [Fri, 4 Jan 2008 09:54:22 +0000 (09:54 +0000)]
Add btconfig(8) - the utility used to configure Bluetooth devices.

Obtained-from: NetBSD

16 years agoRemove trailing space.
Sascha Wildner [Thu, 3 Jan 2008 18:18:37 +0000 (18:18 +0000)]
Remove trailing space.

16 years agoSort entries in /etc and bump .Dd for today's change.
Sascha Wildner [Thu, 3 Jan 2008 18:17:08 +0000 (18:17 +0000)]
Sort entries in /etc and bump .Dd for today's change.

16 years agoDon't use leading 0 in .Dd and begin sentence on a new line.
Sascha Wildner [Thu, 3 Jan 2008 18:16:17 +0000 (18:16 +0000)]
Don't use leading 0 in .Dd and begin sentence on a new line.

16 years agoMajor update to pkg_search(1)
Matthias Schmidt [Thu, 3 Jan 2008 16:42:43 +0000 (16:42 +0000)]
Major update to pkg_search(1)

- Print verbose information about packages when operating with the
  pkg_summary(5) file
- pkg_search displayed an incorrect field instead of the URL field.
- Don't download a pkg_summary(5) file if an INDEX file is available
- Honor -k when searching with -v (index file only)
- style(9) changes
- Enhanced the man page, add some comments and change my email address.
- We're on DragonFly so remove the check for DragonFly.

16 years agoAdd bluetooth(3) and sdp(3) libraries. Adjust indenting in progress.
Hasso Tepper [Thu, 3 Jan 2008 13:59:03 +0000 (13:59 +0000)]
Add bluetooth(3) and sdp(3) libraries. Adjust indenting in progress.

Reminded-by: swildner@
16 years agoAdd /etc/bluetooth/ with common files.
Hasso Tepper [Thu, 3 Jan 2008 13:35:21 +0000 (13:35 +0000)]
Add /etc/bluetooth/ with common files.

16 years agoo Mention pam_nologin(8) in nologin(5). Only adapt the changes from FreeBSD
Matthias Schmidt [Thu, 3 Jan 2008 12:47:56 +0000 (12:47 +0000)]
o Mention pam_nologin(8) in nologin(5).  Only adapt the changes from FreeBSD
  related to us.
o Remove the 3rd clause of Berkeley license.

Reminded-by: swildner@
Obtained-From: FreeBSD

16 years agoAdd bluetooth userspace libraries - bluetooth(3) and sdp(3).
Hasso Tepper [Thu, 3 Jan 2008 11:47:53 +0000 (11:47 +0000)]
Add bluetooth userspace libraries - bluetooth(3) and sdp(3).

Obtained-from: NetBSD

16 years agoUse NULL for pointers
Sepherosa Ziehau [Thu, 3 Jan 2008 11:41:05 +0000 (11:41 +0000)]
Use NULL for pointers

16 years agoHAMMER 15/many - user utility infrastructure, refactor alists, misc
Matthew Dillon [Thu, 3 Jan 2008 06:48:49 +0000 (06:48 +0000)]
HAMMER 15/many - user utility infrastructure, refactor alists, misc

* Abstract out userland access to HAMMER's on-disk structures in
  preparation for more userland work.

* Clean up compiler warnings.

* Refactor the A-list recursion API.  Use another bit code (10) to indicate
  the all-allocated & initialized state, verses an all-allocated &
  uninitialized state.

  This allows an all-empty flag to propogate up the chain properly which
  in turn allows us to avoid flushing out dirty backing store for freed
  disk blocks and will eventually lead to freeing typed buffers back to
  the cluster's master a-list.

* Fix an edge case in the B-Tree code related to running out of space
  during an insertion search.  If the insertion search ran out of space
  at a cluster boundary the spike code asserted because the parent B-Tree
  node wasn't in the same cluster as the node it thought it had to spike.
  (The root B-Tree node of a cluster cannot be spiked).

* Use a second cache pointer in the in-memory structure for directory
  inodes.  The second cache will be used for inode lookups relative to
  the directory and will (eventually) greatly reduce the B-Tree search
  overhead required to stat directory elements.

16 years agoAdd definitions for LONG_BIT and WORD_BIT.
Sascha Wildner [Wed, 2 Jan 2008 23:06:44 +0000 (23:06 +0000)]
Add definitions for LONG_BIT and WORD_BIT.

16 years agoBack out the last commit, it asserts in the getblk code due to the vnode
Matthew Dillon [Wed, 2 Jan 2008 22:42:37 +0000 (22:42 +0000)]
Back out the last commit, it asserts in the getblk code due to the vnode
having zero references.  I'll have to find another solution.

16 years agoUFS vnodes must have VM objects before they can be truncated. This is
Matthew Dillon [Wed, 2 Jan 2008 20:15:48 +0000 (20:15 +0000)]
UFS vnodes must have VM objects before they can be truncated.  This is
normally guarenteed when the vnode is instantiated but there is a degenerate
case in ufs_inactive() that wasn't handled.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
16 years agoPay attention to the timeout value passed down by the upper layer. This
Hasso Tepper [Wed, 2 Jan 2008 19:29:59 +0000 (19:29 +0000)]
Pay attention to the timeout value passed down by the upper layer. This
fix makes USB CD/DVD writers work.

Obtained-from: NetBSD via FreeBSD

16 years agoAdd pam_nologin(8) to the tree. pam_nologin verifies
Matthias Schmidt [Wed, 2 Jan 2008 17:41:30 +0000 (17:41 +0000)]
Add pam_nologin(8) to the tree.  pam_nologin verifies
whether logins are administratively disabled via nologin(5).  It returns
success if the user's login class has an "ignorenologin" capability spec-
ified in login.conf(5) or the nologin(5) file does not exist.

Obtained-From: FreeBSD

16 years agoAdd more sanity checks in bpf_validate():
Sepherosa Ziehau [Wed, 2 Jan 2008 12:30:34 +0000 (12:30 +0000)]
Add more sanity checks in bpf_validate():
- BPF programs with no instructions or with more than BPF_MAXINSNS
  instructions.
- BPF_STX and BPF_LDX|BPF_MEM instructions that have out-of-range offsets
  (which could be made to fetch or store into arbitrary memory locations).
- BPF_DIV instructions with a constant 0 divisor (that's a check also done
  at run time).

Submitted-by: Guy Harris <guy@alum.mit.edu>
Obtained-from:
    OpenBSD (with additional comments and modification from the submitter)

16 years agoAdd missing ';'.
Hasso Tepper [Wed, 2 Jan 2008 11:41:52 +0000 (11:41 +0000)]
Add missing ';'.

16 years agoMake the cast (zero extension) consistent between non-indexed loads
Sepherosa Ziehau [Wed, 2 Jan 2008 11:22:03 +0000 (11:22 +0000)]
Make the cast (zero extension) consistent between non-indexed loads
and indexed loads.

Submitted-by: Guy Harris <guy@alum.mit.edu>
16 years agoMake NO_GETMAXLUN quirk really do something useful.
Hasso Tepper [Wed, 2 Jan 2008 10:45:31 +0000 (10:45 +0000)]
Make NO_GETMAXLUN quirk really do something useful.

Obtained-from: FreeBSD

16 years agoWhen attached to a high-speed device, report a more appropriate
Hasso Tepper [Wed, 2 Jan 2008 10:43:28 +0000 (10:43 +0000)]
When attached to a high-speed device, report a more appropriate
base transfer speed to CAM. The actual value used (40MB/s) is fairly
arbitrary, but assumes the same 33% overhead as was implied by the
1MB/s figure we used for USB1 devices.

Obtained-from: FreeBSD

16 years agoPass all ATAPI commands through. Fixes detecting capabilities of DVD
Hasso Tepper [Wed, 2 Jan 2008 10:31:53 +0000 (10:31 +0000)]
Pass all ATAPI commands through. Fixes detecting capabilities of DVD
writers.

Obtained-from: FreeBSD with modifications.

16 years agoUse .Bx 386 for 386BSD.
Sascha Wildner [Tue, 1 Jan 2008 23:19:46 +0000 (23:19 +0000)]
Use .Bx 386 for 386BSD.

16 years agoMention /etc/firmware for firmware(9) image files.
Matthias Schmidt [Tue, 1 Jan 2008 18:02:51 +0000 (18:02 +0000)]
Mention /etc/firmware for firmware(9) image files.

16 years agoUpdate to get entries for the Sun Grid Engine and iSCSI.
Matthias Schmidt [Tue, 1 Jan 2008 17:28:20 +0000 (17:28 +0000)]
Update to get entries for the Sun Grid Engine and iSCSI.

Obtained-From: FreeBSD

16 years agoo Add missing dot (.)
Matthias Schmidt [Tue, 1 Jan 2008 17:22:02 +0000 (17:22 +0000)]
o Add missing dot (.)
o Add /usr/pkg/etc to the list of important directories

16 years agoUpdate kdump(1) to print more human readable information.
Matthias Schmidt [Tue, 1 Jan 2008 14:09:02 +0000 (14:09 +0000)]
Update kdump(1) to print more human readable information.

This shows the difference between the old output and the new one:

-73540 telnet   CALL  mmap(0,0xb80,0x3,0x1000,0xffffffff,0,0,0)
+73540 telnet   CALL  mmap(0,0xb80,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0,0)
-73540 telnet   CALL  sigprocmask(0x1,0x2806f97c,0xbfbff2c8)
+73540 telnet   CALL  sigprocmask(SIG_BLOCK,0x2806f97c,0xbfbff2c8)
-73540 telnet   CALL  socket(0x1c,0x1,0x6)
+73540 telnet   CALL  socket(PF_INET6,SOCK_STREAM,0x6)

Obtained-from: FreeBSD

16 years agoEnclose O_ROOTCRED in _KERNEL_STRUCTURES. This is needed for the upcoming
Matthias Schmidt [Tue, 1 Jan 2008 14:01:36 +0000 (14:01 +0000)]
Enclose O_ROOTCRED in _KERNEL_STRUCTURES.  This is needed for the upcoming
kdump(1) work.

16 years agoAdd PCI IDs for ICH9.
Sascha Wildner [Tue, 1 Jan 2008 12:16:40 +0000 (12:16 +0000)]
Add PCI IDs for ICH9.

Taken-from: FreeBSD

16 years agoHAMMER 14/many - historical access cleanup, itimes, bug fixes.
Matthew Dillon [Tue, 1 Jan 2008 01:00:03 +0000 (01:00 +0000)]
HAMMER 14/many - historical access cleanup, itimes, bug fixes.

With this commit most historical accesses work and I can go through at least
two cycles of cpdup / rm -rf without crashing.

* Fix a bug in the B-Tree code related to searches on historical records.
  These records are differentiated by key.create_tid but unlike the rest
  of the key the matching algorithm has to be somewhat more sophisticated.
  e.g. A search as of time 10 needs to find a record with a create_tid of 5.

  To make this work properly we use a trick when we generate the separator
  when splitting a leaf. see hammer_btree.c / hammer_make_separator().

* Recycle inodes a link count of 0 immediately.

* Optimization: Do not flush backing store to disk on reclaim.

* Add a per-inode read-only flag.  Mark all historical inodes as read-only

* Implement read-only semantics in the vnops and assert attempts to modify
  inodes marked read-only.

* Properly record the last transaction id for use when synchronizing
  inodes to the platter.  There were a few cases when late synchronizations
  were using the wrong transaction id, breaking user expectations when
  accessing historical data after a sync.

* Update the itimes (atime and mtime). These are non-historical updates by
  default (meaning we just overwrite the latest inode record instead of
  deleting it and inserting a new one).  A future mount option will allow
  these updates to operate historically (the coding is trivial)... didn't
  you always want to know the last time a file was accessed prior to a
  particular date?  Think about it...

* Fix an inode memory leak.  The inode in-memory structure must be freed
  on last reference.  There were cases where it was being left in the
  HAMMER cache.

* Optimization: Reduce vnode scan overhead during 'sync' by improving
  on the inode flags which indicate that some sort of sync is required.

* Optimization: Don't flush inodes when their link count drops by 1, try
  to only flush them when their link drops to 0.

* Fix a couple of potential deadlocks.

* Fix a case in the vnops code where an inode was not being properly flagged
  as being dirty.

16 years agoAdd the 'hammer' utility. This is going to be a catch-all for various
Matthew Dillon [Tue, 1 Jan 2008 00:57:57 +0000 (00:57 +0000)]
Add the 'hammer' utility.  This is going to be a catch-all for various
hammer functions.  At the moment it is just a skeleton.

hammer now - return timestamp suitable for historical access via
  [path]@@<timestamp>

16 years agoAdd 2008 to our copyrights. Happy new year!
Sascha Wildner [Mon, 31 Dec 2007 23:53:32 +0000 (23:53 +0000)]
Add 2008 to our copyrights. Happy new year!

16 years agoSync zoneinfo database with tzdata2007k from elsie.
Sascha Wildner [Mon, 31 Dec 2007 17:26:20 +0000 (17:26 +0000)]
Sync zoneinfo database with tzdata2007k from elsie.

backward:       8.3  -> 8.4
europe:         8.11 -> 8.12
southamerica:   8.13 -> 8.15
zone.tab:       8.12 -> 8.13

From Paul Eggert's comments:

* Changes to the "southamerica" file (combinining material from
  Jesper Norgaard Welen and Paul Eggert) to reflect Argentina's
  readoption of daylight saving time

* Move Atlantic/Jan_Mayen to the 'backward' file
  (thanks to Jonas Melian for this).

16 years agoHAMMER 13B/many - addendum to 13.
Matthew Dillon [Mon, 31 Dec 2007 05:44:33 +0000 (05:44 +0000)]
HAMMER 13B/many - addendum to 13.

* Fix ref count bug w/ hammer_volume.

16 years agoHAMMER 13/many - Stabilization commit
Matthew Dillon [Mon, 31 Dec 2007 05:33:12 +0000 (05:33 +0000)]
HAMMER 13/many - Stabilization commit

* Clean up the in-memory record API.

* Add B-Tree boundary assertions and B-Tree debugging code.

* Delay freeing bits in the allocation bitmaps for B-Tree nodes and
  clusters until the last reference to the in-memory structure goes away.
  This avoids premature reallocation.

* Fix a bug in btree_split_leaf() - the cursor was not being properly
  adjusted in a particular boundary case.

* Fix a recursive lock bug on a buffer cache buffer in hammer_io.c

* Do not allow a non-empty directory to be removed.

* Synthesize directory entries for "." and "..".  Adjust the
  hammer_directory_namekey() procedure to reserve key-space for the
  synthesized entries.

* Fix memory leaks related to the hammer_node and hammer_record structures.

* Finish writing the rename code.

16 years ago- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
Sepherosa Ziehau [Mon, 31 Dec 2007 04:58:54 +0000 (04:58 +0000)]
- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
  ifnet.if_addrhead
- Use above function in if_detach() and free link ifaddr manually, add some
  assertion there to make sure ifnet.if_addrhead is in sane state

Submitted-by: pavalos@
Obtained-from: FreeBSD (w/ modification)

For tap(4)
- Use if_purgeaddrs_nolink() to clean up tap's if_addrhead
- Cleaning up ifaddrs has nothing to do with current tap's mode (vmnet/tap)
- In non-vmnet mode, clear IFF_RUNNING if_flags when a tap is brought down

For tun(4)
- Use if_purgeaddrs_nolink() to clean up tun's if_addrhead
- Cleaning up ifaddrs has nothing to do with IFF_RUNNING
- in_control() is clever enough to set the RTF_HOST flags for tun, so tun
  does not need to record that dst addr has been set.  Since net/tun/if_tunvar.h
  was exposed to /usr/include "accidentally", instead of nuking TUN_DSTADDR,
  I just mark it as "unused" in comment.

16 years agoKernel part of bluetooth stack ported by Dmitry Komissaroff. Very much work
Hasso Tepper [Sun, 30 Dec 2007 20:02:57 +0000 (20:02 +0000)]
Kernel part of bluetooth stack ported by Dmitry Komissaroff. Very much work
in progress.

Obtained-from: NetBSD via OpenBSD

16 years agoMake DDB optional in vkernels.
Sascha Wildner [Sun, 30 Dec 2007 16:15:05 +0000 (16:15 +0000)]
Make DDB optional in vkernels.

Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
16 years agoRemove 3rd clause of Berkely copyright, per letter. Don't rename 4. to 3.
Matthias Schmidt [Sun, 30 Dec 2007 13:44:33 +0000 (13:44 +0000)]
Remove 3rd clause of Berkely copyright, per letter.  Don't rename 4. to 3.
to avoid diff mismatch against FreeBSD.

16 years agoBring in some fixes from FreeBSD.
Sascha Wildner [Sun, 30 Dec 2007 11:56:54 +0000 (11:56 +0000)]
Bring in some fixes from FreeBSD.