]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoAnnotate creal(), cimag(), and conj() with __pure2.
das [Thu, 7 Aug 2008 14:40:52 +0000 (14:40 +0000)]
Annotate creal(), cimag(), and conj() with __pure2.

15 years agoUse cpack() and the gcc extension __imag__ to implement cimag() and
das [Thu, 7 Aug 2008 14:39:56 +0000 (14:39 +0000)]
Use cpack() and the gcc extension __imag__ to implement cimag() and
conj() instead of using expressions like z * I. The latter is bad for
several reasons:

1. It is implemented using arithmetic, which is unnecessary, and can
   generate floating point exceptions, contrary to the requirements on
   these functions.

2. gcc implements complex multiplication using a formula that breaks
   down for infinities, e.g., it gives INFINITY * I == nan + inf I.

15 years agoMinor white space tweaks.
rwatson [Thu, 7 Aug 2008 09:06:04 +0000 (09:06 +0000)]
Minor white space tweaks.

MFC after: 1 week

15 years agoCorrect comment typo.
rwatson [Thu, 7 Aug 2008 09:03:51 +0000 (09:03 +0000)]
Correct comment typo.

MFC after: 1 week (after inpcb rwlocking)

15 years agoComment out information about Jumbo Frame support, it's not
brueffer [Thu, 7 Aug 2008 07:32:40 +0000 (07:32 +0000)]
Comment out information about Jumbo Frame support, it's not
implemented yet.  While here, fix a whitespace nit.

Discussed with: delphij

15 years agoFix ACL preservation, apparently broken in 1.47.
trasz [Thu, 7 Aug 2008 07:29:26 +0000 (07:29 +0000)]
Fix ACL preservation, apparently broken in 1.47.

Approved by: rwatson
MFC after: 3 weeks

15 years ago- acificfrancexchange -> pacificfrancexchange
edwin [Thu, 7 Aug 2008 05:35:01 +0000 (05:35 +0000)]
- acificfrancexchange -> pacificfrancexchange
- Add comments about the pegged currencies.

Submitted by: GeJ on #bsdports

15 years agoIntroduce pmap_change_attr_locked().
alc [Thu, 7 Aug 2008 04:56:29 +0000 (04:56 +0000)]
Introduce pmap_change_attr_locked().

15 years agoUpdate the units library file.
edwin [Thu, 7 Aug 2008 00:14:56 +0000 (00:14 +0000)]
Update the units library file.

- Merge changes from NetBSD and OpenBSD.
- Add the Euro as a primitive unit, add old converted currency and
  pegged currency (Obtained from Wikipedia)
- Rename "dollar" to "usdollar" as primitive unit, remove non-pegged
  currency and add pegged currency (Obtained from Wikipedia)
- Updated the accuracy of a lot of constants (Obtained from Wikipedia)

PR: bin/106545 bin/88252
Submitted by: trasz<trasz@pin.if.uz.zgora.pl>, J Vinopal <banshee@abattoir.com>
Approved by: bde@ (mentor)
MFC after: 1 week

15 years agoWhen the miibus for the AX88x90 or TC5299J cards fails to attach, we
imp [Wed, 6 Aug 2008 22:22:27 +0000 (22:22 +0000)]
When the miibus for the AX88x90 or TC5299J cards fails to attach, we
would call ed_release_resources() when we should have called
ed_detach() to properly undo the effects of prior calls to
ed_attach().  This would leave a stray ed interface ifnet alive in the
system, which was, well, bad, since we called if_free() on the
underlying memory...  Fix the ed_detach routine to cope being called
in this context now.

This should never come up because the miibus is always there.  Except
for now when it seems to be failing for reasons unknown...  That's a
different bug that hits at least ed, xl, dc and fxp...

15 years agoMake atacontrol(8) rebuild work when /usr is not mounted or from /rescue
antoine [Wed, 6 Aug 2008 18:08:02 +0000 (18:08 +0000)]
Make atacontrol(8) rebuild work when /usr is not mounted or from /rescue

PR: bin/125680
MFC after: 1 month
Tested by: Stef Walter

15 years agoFix ia64 build.
dfr [Wed, 6 Aug 2008 17:11:12 +0000 (17:11 +0000)]
Fix ia64 build.

15 years agoadd WPS oui
sam [Wed, 6 Aug 2008 15:54:59 +0000 (15:54 +0000)]
add WPS oui

Submitted by: "Chuck Tuffli" <chuck@tuffli.net>
MFC after: 3 days

15 years agoFix 64bt build.
dfr [Wed, 6 Aug 2008 15:33:00 +0000 (15:33 +0000)]
Fix 64bt build.

15 years agoUser may do "mount -o snapshot ...", that causes new FFS mount to be
kib [Wed, 6 Aug 2008 14:47:19 +0000 (14:47 +0000)]
User may do "mount -o snapshot ...", that causes new FFS mount to be
performed with snapshot option, while the mp->mnt_opt is NULL.
Protect against NULL pointer dereference.

Noted by: Mateusz Guzik <mjguzik gmail com>
MFC after: 3 days

15 years agoAdd an implementation of the RPCSEC_GSS authentication protocol for RPC. This
dfr [Wed, 6 Aug 2008 14:02:05 +0000 (14:02 +0000)]
Add an implementation of the RPCSEC_GSS authentication protocol for RPC. This
is based on an old implementation from the University of Michigan with lots of
changes and fixes by me and the addition of a Solaris-compatible API.

Sponsored by: Isilon Systems
Reviewed by: alfred

15 years agoFix a copy/paste error
kevlo [Wed, 6 Aug 2008 07:52:59 +0000 (07:52 +0000)]
Fix a copy/paste error

15 years agoUnify the initial card probe/attach procedure with the kldload
imp [Wed, 6 Aug 2008 07:34:35 +0000 (07:34 +0000)]
Unify the initial card probe/attach procedure with the kldload
procedure.  There were some subtle differences before that could lead
to a variety of bugs, including resources being lost (in one case
forever).  pccard_probe_and_attach_card does this now, and includes
comments about what's going on and why, since it isn't obvious from
the code.  Please let me know if I've missed anything...

Provide a new function called pccard_select_cfe that allows drivers to
select which configuration entry to use.  This is needed for some
older pre-MFC standard cards with many functions that want to activate
all their functions by selecting alternative entries, or to work
around broken ones.  pccard_select_cfe will migrate into the
pccard_if.m interface as its interface stabilizes to keep all the
pccard drivers from referencing any symbols in the pccard.ko module
directly.

Fix a printf to refer to the right function name.

15 years agoCleanup for WARNS 6.
marcel [Wed, 6 Aug 2008 03:14:18 +0000 (03:14 +0000)]
Cleanup for WARNS 6.

15 years agoMinor style tweaks.
jhb [Tue, 5 Aug 2008 21:59:20 +0000 (21:59 +0000)]
Minor style tweaks.

15 years agoRemove the second check for a 64-bit BAR value on a 32-bit system in
jhb [Tue, 5 Aug 2008 21:04:00 +0000 (21:04 +0000)]
Remove the second check for a 64-bit BAR value on a 32-bit system in
pci_add_map().  First, this condition is already handled earlier in
the function.  Second, as written the check would never fire as the
'start' value was overwritten with a long value (rman_get_start() returns
long) before the comparison was done.

Discussed with: imp
MFC after: 2 weeks

15 years agoAdd a script to perform simple analysis of a crash dump (either a full
jhb [Tue, 5 Aug 2008 20:41:46 +0000 (20:41 +0000)]
Add a script to perform simple analysis of a crash dump (either a full
dump or minidump).  When the script is run, it generates a text file
containing the output of several commands run againt the core dump such
as kgdb (stack trace), ps, netstat, vmstat, iostat, dmesg, and fstat.

Obtained from: Yahoo!
MFC after: 2 weeks

15 years agoIf a thread that is swapped out is made runnable, then the setrunnable()
jhb [Tue, 5 Aug 2008 20:02:31 +0000 (20:02 +0000)]
If a thread that is swapped out is made runnable, then the setrunnable()
routine wakes up proc0 so that proc0 can swap the thread back in.
Historically, this has been done by waking up proc0 directly from
setrunnable() itself via a wakeup().  When waking up a sleeping thread
that was swapped out (the usual case when waking proc0 since only sleeping
threads are eligible to be swapped out), this resulted in a bit of
recursion (e.g. wakeup() -> setrunnable() -> wakeup()).

With sleep queues having separate locks in 6.x and later, this caused a
spin lock LOR (sleepq lock -> sched_lock/thread lock -> sleepq lock).
An attempt was made to fix this in 7.0 by making the proc0 wakeup use
the ithread mechanism for doing the wakeup.  However, this required
grabbing proc0's thread lock to perform the wakeup.  If proc0 was asleep
elsewhere in the kernel (e.g. waiting for disk I/O), then this degenerated
into the same LOR since the thread lock would be some other sleepq lock.

Fix this by deferring the wakeup of the swapper until after the sleepq
lock held by the upper layer has been locked.  The setrunnable() routine
now returns a boolean value to indicate whether or not proc0 needs to be
woken up.  The end result is that consumers of the sleepq API such as
*sleep/wakeup, condition variables, sx locks, and lockmgr, have to wakeup
proc0 if they get a non-zero return value from sleepq_abort(),
sleepq_broadcast(), or sleepq_signal().

Discussed with: jeff
Glanced at by: sam
Tested by: Jurgen Weber  jurgen - ish com au
MFC after: 2 weeks

15 years agoIf the kernel fails to allocate resources for the initial value of a BAR
jhb [Tue, 5 Aug 2008 18:24:41 +0000 (18:24 +0000)]
If the kernel fails to allocate resources for the initial value of a BAR
for a PCI device during the boot-time probe of the parent PCI bus, then
zero the BAR and clear the resource list entry for that BAR.  This forces
the PCI bus driver to request a valid resource range from the parent bridge
driver when the device driver tries to allocate the BAR.  Similarly, if the
initial value of a BAR is a valid range but it is > 4GB and the current OS
only has 32-bit longs, then do a full teardown of the initial value of the
BAR to force a reallocation.

Reviewed by: imp
MFC after: 1 week

15 years ago- Consolidate module version for the pcf module into just pcf.c instead
jhb [Tue, 5 Aug 2008 17:39:37 +0000 (17:39 +0000)]
- Consolidate module version for the pcf module into just pcf.c instead
  of having duplicate versions in each bus attachment.
- Add a DRIVER_MODULE() instance so that the iicbus(4) driver will
  actually attach to pcf(4) driver instances.
- Fix compile of envctrl.c.

Pointy hat: jhb (3)

15 years agoAdd lifetime informations to generated SPD entries when SPDDUMP
vanhu [Tue, 5 Aug 2008 15:36:50 +0000 (15:36 +0000)]
Add lifetime informations to generated SPD entries when SPDDUMP

Approved by: gnn (mentor)
MFC after: 4 weeks

15 years agoufsmount.h uses "struct\tfoo *bar;", except where it doesn't.
des [Tue, 5 Aug 2008 15:24:07 +0000 (15:24 +0000)]
ufsmount.h uses "struct\tfoo *bar;", except where it doesn't.
quota.h uses "struct foo\t*bar;", except where it doesn't.
Try to make them both agree with themselves (though not with eachother)

15 years agoWhitespace, prototypes
des [Tue, 5 Aug 2008 10:25:55 +0000 (10:25 +0000)]
Whitespace, prototypes

15 years ago- Reflect the iicbus infrastructure changes.
stas [Tue, 5 Aug 2008 08:38:33 +0000 (08:38 +0000)]
- Reflect the iicbus infrastructure changes.

Approved by: raj

15 years ago- Reflect changes in iic infrastructure.
stas [Tue, 5 Aug 2008 08:20:58 +0000 (08:20 +0000)]
- Reflect changes in iic infrastructure.

15 years agoMove functions which are only locally used into their C files and
edwin [Tue, 5 Aug 2008 08:16:37 +0000 (08:16 +0000)]
Move functions which are only locally used into their C files and
make them static.

usage() in calendar.c
event_*() in io.c

PR: bin/118644
Approved by: bde@ (mentor)

15 years agostyle(9)ify usr.bin/calendar
edwin [Tue, 5 Aug 2008 08:11:54 +0000 (08:11 +0000)]
style(9)ify usr.bin/calendar

PR: bin/118644
Approved by: bde@ (mentor)
MFC after: 1 week

15 years agoRemove a comment about bridging wireless client, the new net80211 vap code
thompsa [Mon, 4 Aug 2008 23:16:07 +0000 (23:16 +0000)]
Remove a comment about bridging wireless client, the new net80211 vap code
supports this.

15 years agoFix build when WITHOUT_DYNAMICROOT is specified in src.conf(5).
mlaier [Mon, 4 Aug 2008 22:45:27 +0000 (22:45 +0000)]
Fix build when WITHOUT_DYNAMICROOT is specified in src.conf(5).

15 years agoAdd EPERM to the ERRORS section.
trhodes [Mon, 4 Aug 2008 22:22:17 +0000 (22:22 +0000)]
Add EPERM to the ERRORS section.

PR: 125746

15 years agoLock the consumers of the iicbus(4) infrastructure:
jhb [Mon, 4 Aug 2008 21:14:24 +0000 (21:14 +0000)]
Lock the consumers of the iicbus(4) infrastructure:
- ad7418(4) uses an sx lock instead of a mtx since the iicbus(4) stuff it
  calls can sleep (request_bus()).  Also, I expanded the locking slightly
  to serialize writes to data stored in the softc.
- Similarly, the icee(4) driver now uses an sx lock instead of a mutex.
  I also removed the pointless OPENED flag and flags field from the softc.
- The locking for the ic(4) driver was a bit trickier:
  - Add a mutex to the softc to protect softc data.
  - The driver uses malloc'd buffers that are the size of the interface
    MTU to send and receive packets.  Previously, these were allocated
    every time the interface was brought up and anytime the MTU was
    changed, with various races that could result in memory leaks.  I
    changed this to be a bit simpler and more like other NIC drivers in
    that we allocate buffers during attach for the default MTU size and
    only reallocate them on MTU changes.  The reallocation procedure
    goes to some lengths with various flags to not replace either the
    the receive or transmit buffers while the driver is busy receiving
    or transmitting a packet.
  - Store the device_t of the driver in the softc instead of detours into
    new-bus using if_dunit from the ifnet and an even more bizarre detour
    to get the softc instead of using if_softc.
  - Drop the driver mutex when invoking netisr_dispatch() to pass the
    packet up to IP.
  - Use if_printf().

15 years agoAdd locking to the core iicbus(4) drivers:
jhb [Mon, 4 Aug 2008 21:03:06 +0000 (21:03 +0000)]
Add locking to the core iicbus(4) drivers:
- Add an sx lock to the iic(4) driver to serialize open(), close(), read(),
  and write and to protect sc_addr and sc_count in the softc.
- Use cdev->si_drv1 instead of using the minor number of the cdev to
  lookup the softc via newbus in iic(4).
- Store the device_t in the softc to avoid a similar detour via minor
  numbers in iic(4).
- Only add at most one instance of iic(4) and iicsmb(4) to each iicbus(4)
  instance, and do it in the child driver.
- Add a mutex to the iicbus(4) softc to synchronize the request/release bus
  stuff.
- Use __BUS_ACCESSOR() for IICBUS_ACCESSOR() instead of rolling our own.
- Add a mutex to the iicsmb(4) softc to protect softc state updated in the
  interrupt handler.
- Remove Giant from all the smbus methods in iicsmb(4) now that all the
  iicbus(4) backend is locked.

15 years agoAdd locking to the various iicbus(4) bridge drivers:
jhb [Mon, 4 Aug 2008 20:46:15 +0000 (20:46 +0000)]
Add locking to the various iicbus(4) bridge drivers:
- Just grab Giant in the ixp425_iic(4) driver since this driver uses
  a shared address/data register window pair to access the actual
  I2C registers.  None of the other ixp425 drivers lock access to these
  shared address/data registers yet and that would need to be done before
  this could use any meaningful locking.
- Add locking to the interrupt handler and 'iicbus_reset' methods of the
  at91_twi(4) driver.
- Add locking to the pcf(4) driver.  Other pcf(4) fixes include:
  - Don't needlessly zero the softc.
  - Use bus_foo rather than bus_space_foo and remove bus space tag and
    handle from softc.
- The lpbb(4) driver just grabs Giant for now.  This will be refined later
  when ppbus(4) is locked.
- As was done with smbus earlier, move the DRIVER_MODULE() lines to match
  the bus driver (either iicbus or iicbb) to the bridge driver into the
  bridge drivers.

Tested by: sam (arm/ixp425)

15 years agoDo not modify td->td_intr_nesting_level, it is now done in the MI code.
cognet [Mon, 4 Aug 2008 20:29:39 +0000 (20:29 +0000)]
Do not modify td->td_intr_nesting_level, it is now done in the MI code.
This fixes the cpu time being falsely reported as interrupt time.

MFC after: 3 days

15 years agoClose two different races with concurrent opens of pty master devices
jhb [Mon, 4 Aug 2008 19:51:23 +0000 (19:51 +0000)]
Close two different races with concurrent opens of pty master devices
that could result in leaked ttys or a leaked pty + tty pair.

MFC after: 1 week

15 years ago- Close a race with concurrent open's of a pts master device which could
jhb [Mon, 4 Aug 2008 19:49:05 +0000 (19:49 +0000)]
- Close a race with concurrent open's of a pts master device which could
  result in leaked tty structures.
- When constructing a new pty, allocate it's tty structure before adding
  it to the list.

MFC after: 1 week

15 years agoFix a typo.
jhb [Mon, 4 Aug 2008 19:45:15 +0000 (19:45 +0000)]
Fix a typo.

15 years agoAdd locking to snc(4) so it is MPSAFE:
jhb [Mon, 4 Aug 2008 19:19:18 +0000 (19:19 +0000)]
Add locking to snc(4) so it is MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private timer routine to drive the transmit watchdog timer instead
  of using if_watchdog/if_timer.
- If if_alloc() fails during attach, fail the attach with an error rather
  than panic'ing.
- Clear RUNNING and OACTIVE only in sncstop().
- Don't mess with IFF_UP.
- Don't leak 'struct ifnet' on detach.
- Setup interrupt handler after ether_ifattach().
- Call ether_ifdetach() rather than if_detach() in the pccard detach
  routine.

Tested by: no one despite repeated requests

15 years agoAdd coretemp(4) and k8temp(4).
rpaulo [Mon, 4 Aug 2008 16:13:42 +0000 (16:13 +0000)]
Add coretemp(4) and k8temp(4).

MFC after: 1 day

15 years agoFix ARM nocache allocator:
raj [Mon, 4 Aug 2008 14:47:49 +0000 (14:47 +0000)]
Fix ARM nocache allocator:

- let the loop iterate every page (as intended), and not some multiplies
  (which led to a fake exhaustion of the ARM_NOCACHE_KVA_SIZE)

- eliminate using MIN(): it compared number of pages vs. address
  (ARM_TP_ADDRESS), which was bogus

Reviewed by: cognet, imp
Obtained from: Piotr Ziecik kosmo ! semihalf dot com
MFC after: 3 days

15 years agoMerge state reuse for tcp.
mlaier [Mon, 4 Aug 2008 14:42:09 +0000 (14:42 +0000)]
Merge state reuse for tcp.

PR: kern/125261
Obtained from: OpenBSD
MFC after: 1 week

15 years agoWe need -I$S to compile the elf trampoline.
cognet [Mon, 4 Aug 2008 14:38:38 +0000 (14:38 +0000)]
We need -I$S to compile the elf trampoline.

MFC after: 3 days

15 years agoRemove unneeded #include <stdlib.h> (?)
cognet [Mon, 4 Aug 2008 14:37:32 +0000 (14:37 +0000)]
Remove unneeded #include <stdlib.h> (?)

MFC after: 3 days

15 years agoLower the priority of the sleep in the syscons for "waitvt" wchan to
kib [Mon, 4 Aug 2008 12:22:33 +0000 (12:22 +0000)]
Lower the priority of the sleep in the syscons for "waitvt" wchan to
PZERO + 1. The sleeping process at the priority <= PZERO is counted as
blocked, or, as comment states, 'disk wait'. PZERO + 1 works as well,
and does not cause user confusion.

Reported by: sam <samflanker at gmail com>
MFC after: 1 week

15 years agoMake pmap_kenter_attr() static.
alc [Mon, 4 Aug 2008 08:04:09 +0000 (08:04 +0000)]
Make pmap_kenter_attr() static.

15 years agoMark functions as __dead2 in order to help the LLVM static checker
cperciva [Mon, 4 Aug 2008 07:36:53 +0000 (07:36 +0000)]
Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

Reported by: edwin

15 years agoDereferencing uninitialized pointers considered harmful. Prior to this
cperciva [Mon, 4 Aug 2008 07:01:42 +0000 (07:01 +0000)]
Dereferencing uninitialized pointers considered harmful.  Prior to this
commit, calling i386_parsedev(..., X, ...) where X is "ad", "bge", or
any other disk or network device name without a unit number, would
result in dereferencing whatever happened to be on the stack where the
variable "cp" is stored.

Found by: LLVM/Clang Static Checker

15 years agoInitialize "nconv" to a reasonable value in all code paths. Prior to
cperciva [Mon, 4 Aug 2008 06:55:42 +0000 (06:55 +0000)]
Initialize "nconv" to a reasonable value in all code paths.  Prior to
this commit, sprintf("%s", "") could fail depending on what happened
to be on the stack.

Found by: LLVM/Clang Static Checker

15 years agoSet "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior
cperciva [Mon, 4 Aug 2008 06:53:13 +0000 (06:53 +0000)]
Set "max" to a reasonable value if BLOCKSIZE has a bogus unit.  Prior
to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown
blocksize" as expected, but sometimes also "maximum blocksize is 1G"
and "minimum blocksize is 512" depending on what happened to be on
the stack.

Found by: LLVM/Clang Static Checker

15 years agoDon't close file descriptor number <whatever random garbage was on the
cperciva [Mon, 4 Aug 2008 06:48:54 +0000 (06:48 +0000)]
Don't close file descriptor number <whatever random garbage was on the
stack>.

Found by: LLVM/Clang Static Checker
MFC after: 1 week

15 years agoSetting a variable to the same value twice doesn't actually make it
cperciva [Mon, 4 Aug 2008 06:39:52 +0000 (06:39 +0000)]
Setting a variable to the same value twice doesn't actually make it
more likely to have the right value.  Remove superfluous assignments.

Found by: LLVM/Clang Static Checker

15 years agoRearrange conditional compilation directives. This makes syntax
yongari [Mon, 4 Aug 2008 04:00:10 +0000 (04:00 +0000)]
Rearrange conditional compilation directives. This makes syntax
highlighting work in vim.

15 years agoRemove return keyword at the end of functions that return void.
yongari [Mon, 4 Aug 2008 03:51:20 +0000 (03:51 +0000)]
Remove return keyword at the end of functions that return void.

15 years agoRemove register keyword.
yongari [Mon, 4 Aug 2008 03:47:29 +0000 (03:47 +0000)]
Remove register keyword.

15 years agoUse ANSI C declarations for all functions.
yongari [Mon, 4 Aug 2008 03:45:07 +0000 (03:45 +0000)]
Use ANSI C declarations for all functions.

15 years agoDon't enable TSO by default. Users of RTL8169/8110 reported
yongari [Mon, 4 Aug 2008 02:34:40 +0000 (02:34 +0000)]
Don't enable TSO by default. Users of RTL8169/8110 reported
watchdog timeout issues and the root cause seems to stem from
silicon bug of controller. Personally I couldn't reproduce it on
RTL8169 controller but it seems it's dependent on usage pattern.
For newer PCIe based controllers I have no TSO complaints but
turning off TSO would be more safe. Users who are sure that
their controller works with TSO can still reenable the TSO with
ifconfig(8).

Reported by: Oliver Lehmann (lehmann at ans-netz dot de), Eugene Butusov (ebutusov at gmail dot com)

15 years agoThe number of bits reserved for MSS in RealTek controllers is
yongari [Mon, 4 Aug 2008 02:05:09 +0000 (02:05 +0000)]
The number of bits reserved for MSS in RealTek controllers is
11bits. This limits the maximum interface MTU size in TSO case
as upper stack should not generate TCP segments with MSS greater
than the limit. Armed with this information, disable TSO if
interface MTU is greater than the limit.

15 years agoMark functions as __dead2 in order to help the LLVM static checker
cperciva [Mon, 4 Aug 2008 01:25:48 +0000 (01:25 +0000)]
Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".

15 years agoMake quota(1) to compile with WARNS=6:
delphij [Mon, 4 Aug 2008 00:43:49 +0000 (00:43 +0000)]
Make quota(1) to compile with WARNS=6:
 - ANSI'fy showrawquotas().
 - Shut up GCC by initializing bgrace and igrace.  The situation
   that caused the GCC warning can never happen though.

15 years agoRestructure and use different variables in the tests that involve
scf [Sun, 3 Aug 2008 22:47:23 +0000 (22:47 +0000)]
Restructure and use different variables in the tests that involve
environ[0] to be more obvious that environ is not NULL before environ[0]
is tested.  Although I believe the previous code worked, this change
improves code maintainability.

Reviewed by: ache
MFC after: 3 days

15 years agoAdd EAGAIN to the ERRORS list, as found in kern_jail.c.
trhodes [Sun, 3 Aug 2008 21:56:58 +0000 (21:56 +0000)]
Add EAGAIN to the ERRORS list, as found in kern_jail.c.

PR: 125253
Submitted by: Mateusz Guzik <mjguzik@gmail.com> (original version)

15 years agoKill a dead variable
antoine [Sun, 3 Aug 2008 21:07:19 +0000 (21:07 +0000)]
Kill a dead variable

PR: 126223
Submitted by: Mateusz Guzik

15 years agoctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so for
cognet [Sun, 3 Aug 2008 20:36:40 +0000 (20:36 +0000)]
ctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so for
big endian platforms where time_t is 64bits (ie armeb and sparc64), it will
be a problem.
Use a temporary time_t to work around this.

Submitted by: Matthew Luckie <mjl AT luckie DOT org dot nz>
MFC after: 3 days

15 years agoRestored from previous backing out (because that is OpenBSD way, so
ache [Sun, 3 Aug 2008 20:15:22 +0000 (20:15 +0000)]
Restored from previous backing out (because that is OpenBSD way, so
assumed to be reviewd by them):
Stir directly from the kernel PRNG, without taking less random pid & time
bytes too (when it is possible).

The difference with OpenBSD code is that they have KERN_ARND sysctl for
that task, while we need to read /dev/random

15 years ago- back out my last commit as it seems to be wrong.
danger [Sun, 3 Aug 2008 19:01:07 +0000 (19:01 +0000)]
- back out my last commit as it seems to be wrong.

Spotted by: das

15 years agoFix some style bogosity from fdlibm.
das [Sun, 3 Aug 2008 17:49:05 +0000 (17:49 +0000)]
Fix some style bogosity from fdlibm.

15 years agoMinor improvements:
das [Sun, 3 Aug 2008 17:39:54 +0000 (17:39 +0000)]
Minor improvements:
- Improve the order of some tests.
- Fix style.

Submitted by: bde

15 years agoRemove broken code to replace st_mode value with ACCESSPERMS when
rwatson [Sun, 3 Aug 2008 15:44:56 +0000 (15:44 +0000)]
Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked.  The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.

This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms.  The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.

PR: 25018
MFC after: 3 days

15 years agoAdd "add pc, whatever" as a branch instruction, we use it in memcpy().
cognet [Sun, 3 Aug 2008 15:35:32 +0000 (15:35 +0000)]
Add "add pc, whatever" as a branch instruction, we use it in memcpy().

MFC after: 3 days

15 years agoDDB scripting, textdumps, output capture, etc, all will appear in
rwatson [Sun, 3 Aug 2008 14:27:06 +0000 (14:27 +0000)]
DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.

Spotted by: Ulrich Spoerlein <uspoerlein at gmail dot com>
MFC after: 3 days

15 years agoFill in a few sysctl descriptions.
trhodes [Sun, 3 Aug 2008 14:26:15 +0000 (14:26 +0000)]
Fill in a few sysctl descriptions.

Reviewed by: alc, Matt Dillon <dillon@apollo.backplane.com>
Approved by: alc

15 years agoDDB scripting, textdumps, output capture, etc, all will appear in
rwatson [Sun, 3 Aug 2008 14:14:43 +0000 (14:14 +0000)]
DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.

Spotted by: Ulrich Spoerlein <uspoerlein at gmail dot com>
MFC after: 3 days

15 years agoDocument a few sysctls.
trhodes [Sun, 3 Aug 2008 14:11:06 +0000 (14:11 +0000)]
Document a few sysctls.

Approved by: imp

15 years agoCalling linker_load_dependencies() while holding the module'
kib [Sun, 3 Aug 2008 13:33:45 +0000 (13:33 +0000)]
Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.

Reported and tested by: pjd
MFC after: 1 week

15 years agoDisconnect drivers that haven't been ported to MPSAFE TTY yet.
ed [Sun, 3 Aug 2008 10:32:17 +0000 (10:32 +0000)]
Disconnect drivers that haven't been ported to MPSAFE TTY yet.

As clearly mentioned on the mailing lists, there is a list of drivers
that have not been ported to the MPSAFE TTY layer yet. Remove them from
the kernel configuration files. This means people can now still use
these drivers if they explicitly put them in their kernel configuration
file, which is good.

People should keep in mind that after August 10, these drivers will not
work anymore. Even though owners of the hardware are capable of getting
these drivers working again, I will see if I can at least get them to a
compilable state (if time permits).

15 years agocalendar.holiday: Buinea-bissau should be Guinea-Bissau
edwin [Sun, 3 Aug 2008 09:21:47 +0000 (09:21 +0000)]
calendar.holiday:  Buinea-bissau should be Guinea-Bissau

PR: conf/126199
Submitted by: comet--berkeley (aka Pablo Picasso) <comet@transbay.net>
Approved by: bde@

15 years agoKernel config for the Linksys NSLU2. This is just a basic configuration,
imp [Sun, 3 Aug 2008 07:10:25 +0000 (07:10 +0000)]
Kernel config for the Linksys NSLU2.  This is just a basic configuration,
with no support for the LED, buttons, realtime clock or flash support.

15 years agoMove the grekey to its own file, ifconfig.c does not have interface specific
thompsa [Sun, 3 Aug 2008 03:36:12 +0000 (03:36 +0000)]
Move the grekey to its own file, ifconfig.c does not have interface specific
code.

Submitted by: sam

15 years agoHandle ldr pc, [reg] in branch_taken().
cognet [Sun, 3 Aug 2008 01:53:14 +0000 (01:53 +0000)]
Handle ldr pc, [reg] in branch_taken().

Obtained from: NetBSD
MFC after: 3 days

15 years agoAdd blx as a branch instruction.
cognet [Sun, 3 Aug 2008 01:51:30 +0000 (01:51 +0000)]
Add blx as a branch instruction.

MFC after: 3 days

15 years agoBumpd date
imp [Sat, 2 Aug 2008 23:41:10 +0000 (23:41 +0000)]
Bumpd date
Minor word smithing on the need for newer firmware.

15 years agoAdd entry for Prism-3 based Siemens SpeedStream card. It has
imp [Sat, 2 Aug 2008 23:29:35 +0000 (23:29 +0000)]
Add entry for Prism-3 based Siemens SpeedStream card.  It has
identical packaging and model numbers, but has had the Prism-II chips
replaced by Prism-3.  The wi driver was just updated with the new
entry.

15 years agoMinor style nit.
imp [Sat, 2 Aug 2008 22:53:43 +0000 (22:53 +0000)]
Minor style nit.

15 years agoMinor style tweaks.
rwatson [Sat, 2 Aug 2008 22:30:51 +0000 (22:30 +0000)]
Minor style tweaks.

15 years agoRename mac_partition_enabled to partition_enabled to synchronize with
rwatson [Sat, 2 Aug 2008 20:53:59 +0000 (20:53 +0000)]
Rename mac_partition_enabled to partition_enabled to synchronize with
other policies that similarly now avoid the additional mac_ prefix on
variables.

MFC after: soon

15 years agoAdd an altnerative Siemens SpeedStream ID. This one is for a Prism 3
imp [Sat, 2 Aug 2008 20:50:13 +0000 (20:50 +0000)]
Add an altnerative Siemens SpeedStream ID.  This one is for a Prism 3
card.  I got a pair of these at a garage sale for US$1.00 today...

15 years agoReport what kind of chip only under bootverbose since that's now
imp [Sat, 2 Aug 2008 20:49:01 +0000 (20:49 +0000)]
Report what kind of chip only under bootverbose since that's now
exported via a sysctl.

15 years agoMinor tweaks to names and comments now that I understand what's going
imp [Sat, 2 Aug 2008 20:45:28 +0000 (20:45 +0000)]
Minor tweaks to names and comments now that I understand what's going
on better.

15 years agoAdd an alternative ID for the Siemens SpeedStream SS1021: 0x3021.
imp [Sat, 2 Aug 2008 20:36:25 +0000 (20:36 +0000)]
Add an alternative ID for the Siemens SpeedStream SS1021: 0x3021.

15 years agoAdd a quote too good to miss from:
phk [Sat, 2 Aug 2008 20:11:56 +0000 (20:11 +0000)]
Add a quote too good to miss from:

http://www.schneier.com/blog/archives/2008/08/schneier_misquo.html

(and reorder one I appearantly didn't get in the right place last time.)

15 years agoTest that the result is correctly rounded when |y/x| is huge.
das [Sat, 2 Aug 2008 19:21:33 +0000 (19:21 +0000)]
Test that the result is correctly rounded when |y/x| is huge.

15 years agoA few minor corrections, including some from bde:
das [Sat, 2 Aug 2008 19:17:00 +0000 (19:17 +0000)]
A few minor corrections, including some from bde:
- When y/x is huge, it's faster and more accurate to return pi/2
  instead of pi - pi/2.
- There's no need for 3 lines of bit fiddling to compute -z.
- Fix a comment.

15 years agochange list wme to only print the channel parameters; to
sam [Sat, 2 Aug 2008 18:10:14 +0000 (18:10 +0000)]
change list wme to only print the channel parameters; to
get channel+bss use -v

15 years agodon't silently exit if the regdomain.xml file is missing
sam [Sat, 2 Aug 2008 18:06:27 +0000 (18:06 +0000)]
don't silently exit if the regdomain.xml file is missing

15 years agoadd missing lock for htinfo update
sam [Sat, 2 Aug 2008 18:04:09 +0000 (18:04 +0000)]
add missing lock for htinfo update

Submitted by: Chris Zimmermann