openbsd
16 years agoUse and report errors that inflate(3) can return, instead of
mpf [Wed, 20 Aug 2008 09:22:02 +0000 (09:22 +0000)]
Use and report errors that inflate(3) can return, instead of
aborting silently, and pretending everything went alright.
This lets gzip(1) (especially gzip -t) detect truncated archives
and curruptions that violate the structure of the zlib format.
Unquiet compress(1) in zless/zmore, so the user has a chance
to see errors on corrupted archives.
OK millert@, markus@

16 years agoAllow devices attaching at root (such as softraid) to be disabled in UKC.
miod [Wed, 20 Aug 2008 04:37:15 +0000 (04:37 +0000)]
Allow devices attaching at root (such as softraid) to be disabled in UKC.
ok marco@ deraadt@

16 years agosync
deraadt [Tue, 19 Aug 2008 11:52:15 +0000 (11:52 +0000)]
sync

16 years agouse the actual keysize from the SA to figure out which AES variant
markus [Tue, 19 Aug 2008 10:37:12 +0000 (10:37 +0000)]
use the actual keysize from the SA to figure out which AES variant
(aes-192, aes-256) is used; ok hshoexer@

16 years agoWhen failing to acquire the vnode lock in readdir_with_callback(), don't
pedro [Tue, 19 Aug 2008 09:49:50 +0000 (09:49 +0000)]
When failing to acquire the vnode lock in readdir_with_callback(), don't
try to release it before returning, okay fgsch@ and tedu@.

16 years agoLook at 'fs_flags' when dumping FFS2 file systems, okay beck@, millert@
pedro [Tue, 19 Aug 2008 09:41:12 +0000 (09:41 +0000)]
Look at 'fs_flags' when dumping FFS2 file systems, okay beck@, millert@
and otto@.

16 years agoMake it possible to enter ddb from the serial console.
kettenis [Tue, 19 Aug 2008 08:26:20 +0000 (08:26 +0000)]
Make it possible to enter ddb from the serial console.

ok miod@, deraadt@

16 years agoMake it possible to enter ddb from the serial console.
kettenis [Tue, 19 Aug 2008 07:59:19 +0000 (07:59 +0000)]
Make it possible to enter ddb from the serial console.

ok miod@, deraadt@

16 years ago+D-Link DWA-110 to the rum(4) list;
jmc [Tue, 19 Aug 2008 06:42:25 +0000 (06:42 +0000)]
+D-Link DWA-110 to the rum(4) list;

16 years agosync
deraadt [Tue, 19 Aug 2008 04:30:20 +0000 (04:30 +0000)]
sync

16 years agomore
deraadt [Tue, 19 Aug 2008 02:37:26 +0000 (02:37 +0000)]
more

16 years agosync
deraadt [Tue, 19 Aug 2008 02:34:08 +0000 (02:34 +0000)]
sync

16 years agoanother rum; Jonathan Lee
deraadt [Tue, 19 Aug 2008 02:34:04 +0000 (02:34 +0000)]
another rum; Jonathan Lee

16 years agoadd missing devices to nam2blk[]
deraadt [Tue, 19 Aug 2008 02:02:02 +0000 (02:02 +0000)]
add missing devices to nam2blk[]

16 years agoForgot to add this file, needing for KA60 support.
miod [Mon, 18 Aug 2008 23:25:53 +0000 (23:25 +0000)]
Forgot to add this file, needing for KA60 support.

16 years agoNow that KA60 support is in, include the proper header files instead of
miod [Mon, 18 Aug 2008 23:20:43 +0000 (23:20 +0000)]
Now that KA60 support is in, include the proper header files instead of
harcoding defines, and add rpb device type #39 (sii) boot information.

16 years agoAdd support for the ``Firefox'' VAXstation 3520/3540/3820/3840 workstations,
miod [Mon, 18 Aug 2008 23:19:15 +0000 (23:19 +0000)]
Add support for the ``Firefox'' VAXstation 3520/3540/3820/3840 workstations,
currently limited to serial console and a single processor working.

All ``on-board'' devices, including the Q-bus adapter, but except for
the frame buffer, are supported. The machine will boot over the network
or from SCSI devices.

Lots of thanks to Al Kossow for www.bitsavers.org, on which I found the
technical documentation allowing me to complete this port (which was
lacking at the time I got that machine...).

16 years agoSome uglyness to allow both uba_common.h and ubareg.h to be included;
miod [Mon, 18 Aug 2008 23:10:39 +0000 (23:10 +0000)]
Some uglyness to allow both uba_common.h and ubareg.h to be included;
temporary until they get merged for good (or split differently).

16 years agoIncrement device interrupt event counter when redispatching an interrupt.
miod [Mon, 18 Aug 2008 23:09:42 +0000 (23:09 +0000)]
Increment device interrupt event counter when redispatching an interrupt.

16 years agoPreparing for KA60 support, crank IPL_TTY to level 0x16 (since it is
miod [Mon, 18 Aug 2008 23:08:55 +0000 (23:08 +0000)]
Preparing for KA60 support, crank IPL_TTY to level 0x16 (since it is
hardwired this way on KA60...), and compensate in splassert_check() when
serial device interrupts will remain at 0x14 or 0x15.

16 years agoMove common CVAX defines and code (internal cache IPR, SSC layout, machine
miod [Mon, 18 Aug 2008 23:07:22 +0000 (23:07 +0000)]
Move common CVAX defines and code (internal cache IPR, SSC layout, machine
check frame format...) to a single place. Get rid of duplicated KAxx_FOO
constants.

16 years agoMake hardclock() a cpu_dep member. Most machines will use the generic
miod [Mon, 18 Aug 2008 23:05:37 +0000 (23:05 +0000)]
Make hardclock() a cpu_dep member. Most machines will use the generic
hardclock() here, except for KA46 which needs to reset the diagnostic
timer.

This gives us working clock interrupt counters for vmstat -i in the process.

16 years agoShuffle the dz console code (both serial and keyboard) to be more independent
miod [Mon, 18 Aug 2008 23:04:26 +0000 (23:04 +0000)]
Shuffle the dz console code (both serial and keyboard) to be more independent
of the console device attachment, and to be able to work on system where there
are more than one dz device of the same type, one of it being the console one.

This also allows a different register layout than the dz@ibus one to be used
for the dz console device.

16 years agoregen
brad [Mon, 18 Aug 2008 22:28:58 +0000 (22:28 +0000)]
regen

16 years agoAdd the PCI id for the Broadcom BCM5716 Ethernet controller.
brad [Mon, 18 Aug 2008 22:28:36 +0000 (22:28 +0000)]
Add the PCI id for the Broadcom BCM5716 Ethernet controller.

16 years agoAdd stge(4) and gentbi(4).
kettenis [Mon, 18 Aug 2008 21:55:01 +0000 (21:55 +0000)]
Add stge(4) and gentbi(4).

16 years agoUpdates from master repo: Fix two bugs reported by Art Grabowski.
ragge [Mon, 18 Aug 2008 20:54:10 +0000 (20:54 +0000)]
Updates from master repo: Fix two bugs reported by Art Grabowski.

16 years agoAdd sparc_bus_addr function for schizo to allow CardBus to work.
brad [Mon, 18 Aug 2008 20:29:37 +0000 (20:29 +0000)]
Add sparc_bus_addr function for schizo to allow CardBus to work.

ok kettenis@

16 years agouse M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
kevlo [Mon, 18 Aug 2008 04:28:18 +0000 (04:28 +0000)]
use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
ok mglocker

16 years agoAnother dead struct member.
oga [Mon, 18 Aug 2008 00:01:49 +0000 (00:01 +0000)]
Another dead struct member.

16 years agokill struct drm_freelist, after removing markbufs and infobufs nothing
oga [Sun, 17 Aug 2008 23:49:02 +0000 (23:49 +0000)]
kill struct drm_freelist, after removing markbufs and infobufs nothing
touches it.

16 years agoKill a dead function and a dead struct member.
oga [Sun, 17 Aug 2008 23:36:22 +0000 (23:36 +0000)]
Kill a dead function and a dead struct member.

16 years agoCheck that the driver properly initialised before allowing agp_acquire()
oga [Sun, 17 Aug 2008 21:31:38 +0000 (21:31 +0000)]
Check that the driver properly initialised before allowing agp_acquire()
to succeed.

Inspired by Tobias Ulmer, thanks!

16 years agoCheck the return value of agp_enable() instead of assuming it completed.
oga [Sun, 17 Aug 2008 20:49:52 +0000 (20:49 +0000)]
Check the return value of agp_enable() instead of assuming it completed.
apply some knf and other formatting while i'm at it.

problem originally pointed out by Tobias Ulmer, thanks!

16 years agoKill the infobufs and markbufs calls. Nothing uses them.
oga [Sun, 17 Aug 2008 19:21:36 +0000 (19:21 +0000)]
Kill the infobufs and markbufs calls. Nothing uses them.

16 years agoUpdates from master repo. Can now compile both userland and kernel.
ragge [Sun, 17 Aug 2008 18:40:12 +0000 (18:40 +0000)]
Updates from master repo.  Can now compile both userland and kernel.
(with some patches...)

16 years agokill the stupid pci capability defines, we have our own. Don't wrap
oga [Sun, 17 Aug 2008 16:56:14 +0000 (16:56 +0000)]
kill the stupid pci capability defines, we have our own. Don't wrap
pci_read_capability while i'm at it.

16 years agodrm_load() and drm_unload() are a remnant of code meant to be shared
oga [Sun, 17 Aug 2008 16:13:10 +0000 (16:13 +0000)]
drm_load() and drm_unload() are a remnant of code meant to be shared
between the bsds. Just put them in attach/detach instead. Kills a little
bit of dead code, too.

16 years agoScale down cpu_clockrate[1] when we scale down the cpu clock frequency such
kettenis [Sun, 17 Aug 2008 15:55:55 +0000 (15:55 +0000)]
Scale down cpu_clockrate[1] when we scale down the cpu clock frequency such
that delay(9) continues to do the right thing.

16 years agoKill some redundant ifdefs, they're taken care of elsewhere.
oga [Sun, 17 Aug 2008 15:31:39 +0000 (15:31 +0000)]
Kill some redundant ifdefs, they're taken care of elsewhere.

16 years agoForce fdisk to use the same geometry as the miniroot2.5M disktab
krw [Sun, 17 Aug 2008 15:14:44 +0000 (15:14 +0000)]
Force fdisk to use the same geometry as the miniroot2.5M disktab
entry, the one that the disklabel will use, rather than the vnd
default geometry. Lets the generated miniroot44.fs boot again.

Problem found by Diana Eichart. Suggestions from drahn@.

ok deraadt@

16 years agoMake sure we can't sleep with a spinlock held
oga [Sun, 17 Aug 2008 14:37:31 +0000 (14:37 +0000)]
Make sure we can't sleep with a spinlock held

16 years agoGarbage collect stupid delay loop.
kettenis [Sun, 17 Aug 2008 14:25:19 +0000 (14:25 +0000)]
Garbage collect stupid delay loop.

16 years agoIf dwMaxPayloadTransferSize doesn't exactly match to an existing
mglocker [Sat, 16 Aug 2008 18:56:07 +0000 (18:56 +0000)]
If dwMaxPayloadTransferSize doesn't exactly match to an existing
endpoint, pick the next higher endpoint bandwidth.

16 years agoSpacing.
mglocker [Sat, 16 Aug 2008 16:47:32 +0000 (16:47 +0000)]
Spacing.

16 years agoSync ehci isochronous part with NetBSD:
mglocker [Sat, 16 Aug 2008 16:37:30 +0000 (16:37 +0000)]
Sync ehci isochronous part with NetBSD:
- Fix check for maximum bInterval value.
- Calculate frames/microframes values slightly different (but with mostly
same result finally).

16 years agofix
espie [Sat, 16 Aug 2008 12:26:07 +0000 (12:26 +0000)]
fix

16 years agorevert eval.c
espie [Sat, 16 Aug 2008 12:25:21 +0000 (12:25 +0000)]
revert eval.c

16 years agonot yet, committed too much
espie [Sat, 16 Aug 2008 12:23:50 +0000 (12:23 +0000)]
not yet, committed too much

16 years agoargument parsing should only skip spaces outside of parenthesis.
espie [Sat, 16 Aug 2008 12:21:46 +0000 (12:21 +0000)]
argument parsing should only skip spaces outside of parenthesis.
Inside matching parenthesis, keep spaces as is (use chrsave instead of
pbstr, since there's no way it can be a further macro expansion).
Fixes a long-standing issue with autoconf (   --option -> --option),
matches other m4 than gnum4

okay millert@, fries@

16 years agobe more liberal in include handling, namely we only error out if it's
espie [Sat, 16 Aug 2008 12:19:49 +0000 (12:19 +0000)]
be more liberal in include handling, namely we only error out if it's
the end of the last included file AND we still have a macro to expand.
autoconf uses this in wine, and it turns out other m4 also do things that
way (not only gnu m4).

okay fries@, millert@

16 years agoanother issue for which I have a patch.
espie [Sat, 16 Aug 2008 10:02:32 +0000 (10:02 +0000)]
another issue for which I have a patch.
Issue reported by Vortechz Anderson <utg_vrtz@yahoo.se>

16 years agoa new regression test, I has a diff for it.
espie [Sat, 16 Aug 2008 09:57:12 +0000 (09:57 +0000)]
a new regression test, I has a diff for it.

16 years agoApply a light paddling with the knf stick. No binary change.
oga [Sat, 16 Aug 2008 01:53:05 +0000 (01:53 +0000)]
Apply a light paddling with the knf stick. No binary change.

16 years agobios_dev -> ba_name and bios_apmp -> ba_apmp in DPRINTF statements.
krw [Sat, 16 Aug 2008 00:26:26 +0000 (00:26 +0000)]
bios_dev -> ba_name and bios_apmp -> ba_apmp in DPRINTF statements.
i386 kernels compile with BIOS_DEBUG again.

Spotted by Mathias Schmocker.

16 years agoMake the DZ_{READ,WRITE}_{BYTE,WORD} macros visible outside of dz.c, for
miod [Fri, 15 Aug 2008 22:50:25 +0000 (22:50 +0000)]
Make the DZ_{READ,WRITE}_{BYTE,WORD} macros visible outside of dz.c, for
other dz attachments to be able to use them (soon).

16 years agoFix array index computation in the machine check handler. Gives fatal bus errors
miod [Fri, 15 Aug 2008 22:47:45 +0000 (22:47 +0000)]
Fix array index computation in the machine check handler. Gives fatal bus errors
a chance to be reported correctly...

16 years agoIn dzcninit(), do not forget to enable the receiver in addition to the
miod [Fri, 15 Aug 2008 22:44:12 +0000 (22:44 +0000)]
In dzcninit(), do not forget to enable the receiver in addition to the
transmitter. On machines with glass console for which we do not have
a driver yet, and fall back to serial console, the PROM might not have
enabled it.

16 years agoMove the vxt-specific clock functions frow clock.c to the cpu-specific support
miod [Fri, 15 Aug 2008 22:41:46 +0000 (22:41 +0000)]
Move the vxt-specific clock functions frow clock.c to the cpu-specific support
file, fewer #ifdef this way.

16 years agoCorrect disassembly of the start of a function: fix display layout and skip
miod [Fri, 15 Aug 2008 22:41:02 +0000 (22:41 +0000)]
Correct disassembly of the start of a function: fix display layout and skip
only the 2 bytes of the procedure entry mask, not 4 bytes.

16 years agoRemove unused and incomplete vax_bus_t enum, and unused vaxbus_dma_get_tag()
miod [Fri, 15 Aug 2008 22:39:59 +0000 (22:39 +0000)]
Remove unused and incomplete vax_bus_t enum, and unused vaxbus_dma_get_tag()
macro and related function pointers.

16 years agoRename the cpu_dep hook ``steal_pages'' to ``init'', as it serves as an
miod [Fri, 15 Aug 2008 22:38:20 +0000 (22:38 +0000)]
Rename the cpu_dep hook ``steal_pages'' to ``init'', as it serves as an
early initialization routine (to enable caches, etc) while still running
physical, and does not allocate memory anymore.

(The irony in this is that forthcoming KA60 support actually steals pages
 in its init function...)

16 years agohmac.c is needed by softraid crypto now, even on non-wlan machines.
miod [Fri, 15 Aug 2008 19:42:03 +0000 (19:42 +0000)]
hmac.c is needed by softraid crypto now, even on non-wlan machines.

16 years agoPrefer unaligned accesses over copying the rx buffer on all archs that can
naddy [Fri, 15 Aug 2008 15:49:08 +0000 (15:49 +0000)]
Prefer unaligned accesses over copying the rx buffer on all archs that can
handle it, not only i386.  ok brad@

16 years agoAdd resolv.conf(5) option to force lookups by TCP: "options tcp"
djm [Fri, 15 Aug 2008 14:57:19 +0000 (14:57 +0000)]
Add resolv.conf(5) option to force lookups by TCP: "options tcp"

Also Extend "nameserver" declaration syntax to support port
numbers.  To avoid ambiguity these are only parsed when the address
is enclosed in square brackets, e.g. "nameserver [127.0.0.1]:5353"

Together these changes make forwarding DNS over a SSH tunnel very
easy, but unfortunately some programs in ports/ implement their
own resolvers (e.g. firefox). These will need to be modified to
support these options separately.

fixes jsing@ reyk@
ok deraadt@ millert@ krw@ + "I like it" from lots

16 years agoAdd -s option to usage().
jsing [Fri, 15 Aug 2008 14:41:21 +0000 (14:41 +0000)]
Add -s option to usage().

Prompted by jmc@

ok jmc@

16 years agouse new shared HMAC_SHA1 code in crypto/hmac.[ch] rather than local
djm [Fri, 15 Aug 2008 11:18:10 +0000 (11:18 +0000)]
use new shared HMAC_SHA1 code in crypto/hmac.[ch] rather than local
copy; ok hshoexer@

16 years agouse LLC_SNAPFRAMELEN here too.
damien [Fri, 15 Aug 2008 08:15:27 +0000 (08:15 +0000)]
use LLC_SNAPFRAMELEN here too.

16 years agoonly update stats when we actually wrote sth, relevant for -n, ok djm
henning [Thu, 14 Aug 2008 22:29:43 +0000 (22:29 +0000)]
only update stats when we actually wrote sth, relevant for -n, ok djm
From: Pierre Riteau <pierre.riteau@gmail.com>

16 years agoKill the _MCLDEREFERENCE() macro it was only used once and it should be only
claudio [Thu, 14 Aug 2008 19:39:40 +0000 (19:39 +0000)]
Kill the _MCLDEREFERENCE() macro it was only used once and it should be only
used once -- in m_free(). Removed so that people don't get stupid ideas.
OK thib@

16 years agoIf the AML SizeOf() method is called with an object reference it should
jsing [Thu, 14 Aug 2008 17:41:20 +0000 (17:41 +0000)]
If the AML SizeOf() method is called with an object reference it should
return the size of the referenced object. This fixes a panic on the ASUS
eeePC 1000H when attaching the acpiasus(4) driver.

Issue reported and fix tested by robert@

ok marco@

16 years agoAllow the sector size to be specified by the user when configuring a
jsing [Thu, 14 Aug 2008 17:10:29 +0000 (17:10 +0000)]
Allow the sector size to be specified by the user when configuring a
vnd(4) device, via a new -s option to vnconfig/mount_vnd. This allows us
to create disklabels and file systems that are suitable for use on
devices that have a non-512 byte sector size (eg. CDROMs).

With help from krw@ and feedback from pedro@.

ok krw@, pedro@

16 years agoieee80211_derive_pmkid() is not used either
damien [Thu, 14 Aug 2008 16:14:53 +0000 (16:14 +0000)]
ieee80211_derive_pmkid() is not used either

16 years ago#ifdef notyet ieee80211_kdf() as it is not used yet (shrink kernel a bit)
damien [Thu, 14 Aug 2008 16:10:01 +0000 (16:10 +0000)]
#ifdef notyet ieee80211_kdf() as it is not used yet (shrink kernel a bit)

16 years agomove the HostAP bridge code and the delivery of data frames to ether_input
damien [Thu, 14 Aug 2008 16:07:58 +0000 (16:07 +0000)]
move the HostAP bridge code and the delivery of data frames to ether_input
to a separate ieee80211_deliver_data() function.
this will later be called by the A-MSDU deaggregation routine.

16 years agoin ieee80211_input(), call if_start() after enqueuing frames in if_snd
damien [Thu, 14 Aug 2008 16:02:23 +0000 (16:02 +0000)]
in ieee80211_input(), call if_start() after enqueuing frames in if_snd
when acting as an access point instead of having each driver doing the
job.

tested by krw@ (ral AP) and me with several drivers.

16 years agoput ieee80211_dump_pkt() under #ifdef IEEE80211_DEBUG
damien [Thu, 14 Aug 2008 15:51:43 +0000 (15:51 +0000)]
put ieee80211_dump_pkt() under #ifdef IEEE80211_DEBUG

16 years agofix comments suggested by eric@, remove stupid DPRINTF()
ratchov [Thu, 14 Aug 2008 15:25:16 +0000 (15:25 +0000)]
fix comments suggested by eric@, remove stupid DPRINTF()

16 years agoadd missing semicolon; ok mbalmer@, marco@
robert [Thu, 14 Aug 2008 14:31:31 +0000 (14:31 +0000)]
add missing semicolon; ok mbalmer@, marco@

16 years agolet's make this half useful to recover from crashed disks with wrong info.
espie [Thu, 14 Aug 2008 13:06:04 +0000 (13:06 +0000)]
let's make this half useful to recover from crashed disks with wrong info.

16 years agoconvert the last traces of btoc/ctob macros
martin [Thu, 14 Aug 2008 11:41:30 +0000 (11:41 +0000)]
convert the last traces of btoc/ctob macros

ok miod@

16 years agosimplify S definition to just srcdir, since it appears there's no special
espie [Thu, 14 Aug 2008 10:18:34 +0000 (10:18 +0000)]
simplify S definition to just srcdir, since it appears there's no special
case anymore.
Note that you can always override it from the command line if you need it.

after discussion with deraadt@ and tedu@

16 years agoin abuf_rgetblk() the ``start'' pointer may take a value beyond the
ratchov [Thu, 14 Aug 2008 10:02:10 +0000 (10:02 +0000)]
in abuf_rgetblk() the ``start'' pointer may take a value beyond the
end of the buffer because periodic boundary conditions of the FIFO are
not met

ok jakemsr

16 years agomove all device related stuff from aucat.c to a new dev.c file.
ratchov [Thu, 14 Aug 2008 09:58:55 +0000 (09:58 +0000)]
move all device related stuff from aucat.c to a new dev.c file.
The new dev_xxx() routines expose a "high level" self-contained
interface to the device. At initialization, the device is opened
and two chains of aproc structures are created:

 * a playback chain that exposes a (initially) empty mix
   aproc to which the rest of the code can attach new
   streams to be played

 * record chain that exposes a (initially) empty sub aproc
   to which the rest of the code can attach new stream to
   to record

The rest of the code, has just to use dev_attach() routine to
attach streams. While we're at it, add a ``devops'' structure
containing pointers to the device-specific routines. This will
allow later to add support for other type of device than the
Sun API.

Also, write the .wav headers in file_del(), so put all header
related data in the file strucuture. This allows to close() the
file, as soon as wpipe_xxx() aproc terminates. This will be
useful for the server, because it will need to close() descripts
of closed connections immediately.

add mix_pushzero() routine to fill the mixer with silence. It
will be used to avoid the mixer to underrun when there are no
input streams. Since we always have at least one input stream
there's no behaviour change.

ok jakemsr

16 years agoin file.c, before dereferencing pointers to in(), out(), eof(),
ratchov [Thu, 14 Aug 2008 09:48:50 +0000 (09:48 +0000)]
in file.c, before dereferencing pointers to in(), out(), eof(),
hup() routines of the aproc strucure check that the aproc
structure has not desappeared. This never happens currently, but
will be allowed later. No behaviour change.

ok jakemsr

16 years agoadd an "AUTOQUIT" flag to mix and sub aprocs. If the flag is
ratchov [Thu, 14 Aug 2008 09:47:51 +0000 (09:47 +0000)]
add an "AUTOQUIT" flag to mix and sub aprocs. If the flag is
set, the mix aproc will exit once there are no more input
streams, similarly the sub aproc will exit once there are no
more ouput streams. If the flag is not set, the mix aproc will
generate silence, and the sub aproc will drop samples. By
default this flag is set, so no behaviour change.

ok jakemsr

16 years agoadd a bytes counter to abuf structures to count the number of
ratchov [Thu, 14 Aug 2008 09:46:36 +0000 (09:46 +0000)]
add a bytes counter to abuf structures to count the number of
bytes that entered the FIFO. The counter may overflow, so it
should be used with "modulo 2^32" arithmetic. The counter will
be used later to synchronize playback to record. No behaviour
change.

ok jakemsr

16 years agoadd a xxx_done() method to aproc structures, that cleans up just
ratchov [Thu, 14 Aug 2008 09:45:23 +0000 (09:45 +0000)]
add a xxx_done() method to aproc structures, that cleans up just
before free()ing the aproc structure, this is cleaner and will
allow to reuse wpipe_xxx() and rpipe_xxx() when defining new
aprocs. No behaviour change.

ok jakemsr

16 years agomove mix/sub underrun/overrun handling code and data in the
ratchov [Thu, 14 Aug 2008 09:44:15 +0000 (09:44 +0000)]
move mix/sub underrun/overrun handling code and data in the
generic abuf structure, so it can reused. Required for an audio
server. No behaviour change.

ok jakemsr

16 years agofactor code that discards data from abuf strucure into a single
ratchov [Thu, 14 Aug 2008 09:39:16 +0000 (09:39 +0000)]
factor code that discards data from abuf strucure into a single
abuf_rdiscard() routine. Similarly add abuf_wcommit() routine for
writing. The purpose is to stop manupulating FIFO pointers in
various places outiside abuf.c, its too error prone.
No behaviour change.

ok jakemsr

16 years agoMatch libpthread's behavior and make pthread_join(NULL, whatever) fail
guenther [Thu, 14 Aug 2008 05:57:06 +0000 (05:57 +0000)]
Match libpthread's behavior and make pthread_join(NULL, whatever) fail
instead of crashing

ok kurt@
first observed by Jung <moorang at gmail.com>

16 years agoFix 5771/library: in pthread_exit(), delay the call to _sem_post() that
guenther [Thu, 14 Aug 2008 05:20:44 +0000 (05:20 +0000)]
Fix 5771/library: in pthread_exit(), delay the call to _sem_post() that
unblocks the pthread_join() for this thread until the exiting thread is
completely done with its thread structure, as the joining thread will
free it once unblocked.  Also, don't bother to call _sem_post() if the
thread is detached.

ok kurt@

16 years agoIf the initial thread calls pthread_exit(), don't overwrite its thread
guenther [Thu, 14 Aug 2008 05:15:41 +0000 (05:15 +0000)]
If the initial thread calls pthread_exit(), don't overwrite its thread
structure, as the 'tid' member there is used by other parts of
librthread to determine whether the current thread is the initial thread

16 years agoTools from /usr may not be used in netstart since it may be NFS-mounted
sthen [Thu, 14 Aug 2008 00:59:50 +0000 (00:59 +0000)]
Tools from /usr may not be used in netstart since it may be NFS-mounted
and not available at that time. Rewrite the hostname.if permission check
to use only /bin/ls and the shell. Requested by deraadt.

ok todd, "Twisted." deraadt

16 years agoMake sure that we don't sleep with a lock held, some small cleanup while
oga [Wed, 13 Aug 2008 21:56:50 +0000 (21:56 +0000)]
Make sure that we don't sleep with a lock held, some small cleanup while
i'm here.

16 years agoCheck for zero in drm_calloc() to prevent divide-by-zero. Also rearrange
oga [Wed, 13 Aug 2008 20:45:42 +0000 (20:45 +0000)]
Check for zero in drm_calloc() to prevent divide-by-zero. Also rearrange
the two calls to drm_calloc() that had nmemb and size the wrong way
around.

16 years agoKill file_priv->refs, it is always 1. Also move two things from the
oga [Wed, 13 Aug 2008 20:38:26 +0000 (20:38 +0000)]
Kill file_priv->refs, it is always 1. Also  move two things from the
softc into file_priv since otherwise the wrong value could rarely be
used.

16 years agoAdd VIDIOC_ENUM_FRAMESIZES ioctl. This permits applications to query the
mglocker [Wed, 13 Aug 2008 20:29:34 +0000 (20:29 +0000)]
Add VIDIOC_ENUM_FRAMESIZES ioctl.  This permits applications to query the
available formats and resolutions of a device (e.g. "luvcview -L").

16 years agoChange the drm_lock*() api to take a pointer to the struct as a
oga [Wed, 13 Aug 2008 20:27:58 +0000 (20:27 +0000)]
Change the drm_lock*() api to take a pointer to the struct as a
parameter, this makes things a little cleaner and removes the need to
pass in the softc for some functions.

16 years agoidgen32 wasn't really right here. Change back to how it was, but
oga [Wed, 13 Aug 2008 20:22:55 +0000 (20:22 +0000)]
idgen32 wasn't really right here. Change back to how it was, but
done a little nicer.

Advice from deraadt@.