]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoExplain why two apparently-identical archive_read_data() calls
Tim Kientzle [Sun, 10 Aug 2008 03:13:42 +0000 (03:13 +0000)]
Explain why two apparently-identical archive_read_data() calls
really should have different return values.

16 years agoMfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
Tim Kientzle [Sun, 10 Aug 2008 02:06:28 +0000 (02:06 +0000)]
MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
robust against multiple calls to their destroy() functions.

16 years agoAdd quirks for making uhid(4) ignore the Apple iPhone and iPhone 3G.
Henrik Brix Andersen [Sat, 9 Aug 2008 22:25:13 +0000 (22:25 +0000)]
Add quirks for making uhid(4) ignore the Apple iPhone and iPhone 3G.

Reviewed by: sam
Approved by: sam
MFC after: 3 days

16 years agofix syntax
Sam Leffler [Sat, 9 Aug 2008 21:51:57 +0000 (21:51 +0000)]
fix syntax

16 years agoSimplify session selection/allocation.
Pawel Jakub Dawidek [Sat, 9 Aug 2008 20:01:01 +0000 (20:01 +0000)]
Simplify session selection/allocation.

16 years ago- Fix freeing session on newsession failure.
Pawel Jakub Dawidek [Sat, 9 Aug 2008 19:48:59 +0000 (19:48 +0000)]
- Fix freeing session on newsession failure.
- Update copyright years.

16 years agoImplify sessions freeing loop.
Pawel Jakub Dawidek [Sat, 9 Aug 2008 19:47:19 +0000 (19:47 +0000)]
Implify sessions freeing loop.

16 years agoWe don't have to drop a lock around malloc(M_NOWAIT).
Pawel Jakub Dawidek [Sat, 9 Aug 2008 19:45:43 +0000 (19:45 +0000)]
We don't have to drop a lock around malloc(M_NOWAIT).

16 years agoWhen freeing session, restore its ID after zeroing memory.
Pawel Jakub Dawidek [Sat, 9 Aug 2008 19:43:44 +0000 (19:43 +0000)]
When freeing session, restore its ID after zeroing memory.

Bug tracked down by: Patrick Lamaiziere <patfbsd@davenulle.org>

16 years agoSessions in-use are at the end of the queue, so use TAILQ_FOREACH_REVERSE()
Pawel Jakub Dawidek [Sat, 9 Aug 2008 19:42:37 +0000 (19:42 +0000)]
Sessions in-use are at the end of the queue, so use TAILQ_FOREACH_REVERSE()
when looking for them.

Idea from: Patrick Lamaiziere <patfbsd@davenulle.org>

16 years agofix typo
Warner Losh [Sat, 9 Aug 2008 17:29:36 +0000 (17:29 +0000)]
fix typo

Submitted by: N.J. Mann

16 years agoClean up of dead code and possible unassigned variable usage.
Ivan Voras [Sat, 9 Aug 2008 16:47:30 +0000 (16:47 +0000)]
Clean up of dead code and possible unassigned variable usage.

Found by: LLVM/Clang Static Checker
Approved by: gnn (mentor)

16 years agoIt turns out that checking the first DWORD register is more reliable
Warner Losh [Sat, 9 Aug 2008 15:55:10 +0000 (15:55 +0000)]
It turns out that checking the first DWORD register is more reliable
on a variety of cards.  Adjust the comments accordingly to match the
code.  Even if the vendor chose 0xffff for the device ID, the vendor
ID can't be 0xffff, so the test is still valid from a standards
perspective.

16 years agoTypo: glxsb(4) was imported to FreeBSD 8.0, not 7.0.
Philip Paeps [Sat, 9 Aug 2008 15:09:51 +0000 (15:09 +0000)]
Typo: glxsb(4) was imported to FreeBSD 8.0, not 7.0.

Spotted by: kib

16 years agoAdd the glxsb(4) manual page.
Philip Paeps [Sat, 9 Aug 2008 14:54:19 +0000 (14:54 +0000)]
Add the glxsb(4) manual page.

Submitted by: Patrick Lamaizière <patfbsd -at- davenulle.org>
MFC after: 1 week

16 years agoAdd glxsb(4) driver for the Security Block in AMD Geode LX processors (as
Philip Paeps [Sat, 9 Aug 2008 14:52:31 +0000 (14:52 +0000)]
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (as
found in Soekris hardware, for instance).  The hardware supports acceleration
of AES-128-CBC accessible through crypto(4) and supplies entropy to random(4).

TODO:

    o Implement rndtest(4) support
    o Performance enhancements

Submitted by: Patrick Lamaizière <patfbsd -at- davenulle.org>
Reviewed by: jhb, sam
MFC after: 1 week

16 years agoDelete unused files in the window(1) directory that contain a colon.
Ed Schouten [Sat, 9 Aug 2008 14:44:04 +0000 (14:44 +0000)]
Delete unused files in the window(1) directory that contain a colon.

During the import of the 4.4BSD Lite sources, four files got added to
the repository called :tt, :tty, :var and :ww. They seem to contain some
kind of debug information. These files aren't used/installed anywhere.

Unfortunately the colons in the filenames prevents us from checking out
the source tree on file systems that don't support colons (such as FAT).
Just remove these unneeded files to keep SVN happy.

Reported by: Rohit Tripathi <rohit trip gmail com>
MFC after: 3 days

16 years agoRemove unneeded D_NEEDGIANT from /dev/fd/{0,1,2}.
Ed Schouten [Sat, 9 Aug 2008 12:42:12 +0000 (12:42 +0000)]
Remove unneeded D_NEEDGIANT from /dev/fd/{0,1,2}.

There is no reason the fdopen() routine needs Giant. It only sets
curthread->td_dupfd, based on the device unit number of the cdev.

I guess we won't get massive performance improvements here, but still, I
assume we eventually want to get rid of Giant.

16 years agoNit
Dag-Erling Smørgrav [Sat, 9 Aug 2008 11:28:57 +0000 (11:28 +0000)]
Nit

16 years agoAdd sbuf_new_auto as a shortcut for the very common case of creating a
Dag-Erling Smørgrav [Sat, 9 Aug 2008 11:14:05 +0000 (11:14 +0000)]
Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from: Varnish
MFC after: 2 weeks

16 years agoSwitch to simplified BSD license (with phk's approval), plus whitespace
Dag-Erling Smørgrav [Sat, 9 Aug 2008 10:26:21 +0000 (10:26 +0000)]
Switch to simplified BSD license (with phk's approval), plus whitespace
and style(9) cleanup.

16 years agoAdd late customize hook
Poul-Henning Kamp [Sat, 9 Aug 2008 09:37:44 +0000 (09:37 +0000)]
Add late customize hook

Submitted by:  Patrick M. Hausen
Sat on for far too long: phk

16 years agoAdd -i option to supress image building.
Poul-Henning Kamp [Sat, 9 Aug 2008 09:27:54 +0000 (09:27 +0000)]
Add -i option to supress image building.

Submitted by: keramida

16 years agoTrack /etc/ttys change to uart(4)
Poul-Henning Kamp [Sat, 9 Aug 2008 09:27:06 +0000 (09:27 +0000)]
Track /etc/ttys change to uart(4)

16 years agoAfter some intial testing, there are even slower cards than the ones
Warner Losh [Sat, 9 Aug 2008 07:41:18 +0000 (07:41 +0000)]
After some intial testing, there are even slower cards than the ones
that I have.  Wait up to 1.1s for the card to become ready.  Document
what the standards say, and use that to justify the behavior in the
code: PCI standard says that a card must respond to configuration
cycles within 2^25 cycles after reset goes high, which is
approximately 1s.  Therefore, give cards a little break and wait for
up to 1.1s for VENDOR to become valid.  Only look at the vendor part
of the ID, since only it can't be 0xffff (although in practice
vendor/device will always be != 0xfffffffff).  Include detailed
pointers to standards so epople understand why we're doing what we're
doing and why it just might be OK.  Make it clear in the timeout
message that it is just a warning, sinc we try to soldier on as best
we can anyway.

This should eliminate an error message that r181453 produced on
certain Atheros cards.

16 years agoOnly symlink booted kernel directory to /boot/kernel if user has explicitly
David E. O'Brien [Sat, 9 Aug 2008 06:35:19 +0000 (06:35 +0000)]
Only symlink booted kernel directory to /boot/kernel if user has explicitly
requested it.  This is too dangerous to just do behind the admin's back.

16 years agoIntel describes the behavior of their processors as "undefined" if two or
Alan Cox [Sat, 9 Aug 2008 05:46:13 +0000 (05:46 +0000)]
Intel describes the behavior of their processors as "undefined" if two or
more mappings to the same physical page have different memory types, i.e.,
PAT settings.  Consequently, if pmap_change_attr() is applied to a virtual
address range within the kernel map, then the corresponding ranges of the
direct map also need to be changed.  Enhance pmap_change_attr() to handle
this case automatically.

Add a comment describing what pmap_change_attr() does.

Discussed with: jhb

16 years agoVerify that the WPA flags set are actually compatible with the
Warner Losh [Sat, 9 Aug 2008 05:46:01 +0000 (05:46 +0000)]
Verify that the WPA flags set are actually compatible with the
driver's set of valid flags.  Otherwise, wpa_supplicant wouldn't
report an error for old wi cards that can't do WPA.

Reviewed by: sam@

16 years agorecognize WPS ie's
Sam Leffler [Sat, 9 Aug 2008 05:37:22 +0000 (05:37 +0000)]
recognize WPS ie's

Submitted by: "Chuck Tuffli" <chuck@tuffli.net>
MFC after: 1 week

16 years agoRather than waiting a fixed amount of time, which might not be enough
Warner Losh [Sat, 9 Aug 2008 04:08:36 +0000 (04:08 +0000)]
Rather than waiting a fixed amount of time, which might not be enough
and also holds things up, check every 20ms to see if we can read the
vendor of device 0.0.  It will be 0xffffffff until the card is out of
reset.  Always wait at least 20ms, for safety.

I think this is a better fix to the reset problem.  However, I did it
as a separate commit in case something bad happens, people can roll
back to the commit before this one to see if that gives them reliable
behavior.  I don't have FreeBSD up on enough machines to do exhaustive
testing on all known bridges...

16 years agoChange -1 to 0xfffffffful since the interface returns uint32_t.
Warner Losh [Sat, 9 Aug 2008 03:54:12 +0000 (03:54 +0000)]
Change -1 to 0xfffffffful since the interface returns uint32_t.

16 years agoWhile most bridges can bring a card out of reset in 20ms, there are
Warner Losh [Sat, 9 Aug 2008 03:37:12 +0000 (03:37 +0000)]
While most bridges can bring a card out of reset in 20ms, there are
some bridge + card combinations that take longer for reasons unknown.
Adjust the timeout to be 100ms on all !RICOH bridges, but leave RICOH
at 400ms.  The 400ms is "lore" from other open source projects, and
I've never see my ricoh bridge chips take this long.  Maybe it is the
same thing?  Maybe a bit should be read instead of a hard-wired pause?

After this adjustment, a few cards that I'd insert and get only:
cbb0: card_power: 3V
cbb0: card_power: 0V
with full debugging enabled would actually try to attach.

Reported by: sam@ (I think)
MFC after: 3 days

16 years agoOnly symlink booted kernel directory to /boot/kernel if user has explicitly
David E. O'Brien [Sat, 9 Aug 2008 01:19:00 +0000 (01:19 +0000)]
Only symlink booted kernel directory to /boot/kernel if user has explicitly
requested it.  This is too dangerous to just do behind the admin's back.

16 years agoAdd prototype defination for setfib(2) to sys/socket.h.
Xin LI [Fri, 8 Aug 2008 22:40:04 +0000 (22:40 +0000)]
Add prototype defination for setfib(2) to sys/socket.h.

16 years ago- Bump __FreeBSD_version for cpuctl(4) added.
Stanislav Sedov [Fri, 8 Aug 2008 21:36:49 +0000 (21:36 +0000)]
- Bump __FreeBSD_version for cpuctl(4) added.

Approved by: kib

16 years agoRemove variables which are assigned values and never used thereafter.
Colin Percival [Fri, 8 Aug 2008 20:42:42 +0000 (20:42 +0000)]
Remove variables which are assigned values and never used thereafter.

Found by: LLVM/Clang Static Checker
Approved by: jasone

16 years ago- Initialize the vm86 structure to a known-good state. Specifically, always
John Baldwin [Fri, 8 Aug 2008 19:41:20 +0000 (19:41 +0000)]
- Initialize the vm86 structure to a known-good state.  Specifically, always
  set the %eflags used during a BIOS call via BTX to 0x202.  Previously
  the flags field was uninitialized garbage, and thus it was "random" if
  interrupts were enabled or not during BIOS calls.
- Use constants from <machine/psl.h> for fields in %eflags.

MFC after: 3 days

16 years agoFix the hangs reported with the real mode BTX:
John Baldwin [Fri, 8 Aug 2008 19:39:11 +0000 (19:39 +0000)]
Fix the hangs reported with the real mode BTX:
- I had errantly assumed that all user requests should run with interrupts
  enabled.  User requests for software interrupts, however, need to disable
  interrupts (and tracing) just like hardware interrupts.
- Disable alignment checking when emulating a hardware interrupt as well
  (based on the description of the real mode operation of the 'INT'
  instruction in the IA-32 manuals).
- Use constants for fields in %eflags.

Tested by: bz
MFC after: 3 days

16 years agoAdd a "glimpse" target to the kernel Makefile.
Philip Paeps [Fri, 8 Aug 2008 18:00:33 +0000 (18:00 +0000)]
Add a "glimpse" target to the kernel Makefile.

Glimpse is a powerful "grep on an index".
Especially addictive on slow laptop hard disks.

MFC after: 2 days

16 years ago- Add cpuctl(4) pseudo-device driver to provide access to some low-level
Stanislav Sedov [Fri, 8 Aug 2008 16:26:53 +0000 (16:26 +0000)]
- Add cpuctl(4) pseudo-device driver to provide access to some low-level
  features of CPUs like reading/writing machine-specific registers,
  retrieving cpuid data, and updating microcode.
- Add cpucontrol(8) utility, that provides userland access to
  the features of cpuctl(4).
- Add subsequent manpages.

The cpuctl(4) device operates as follows. The pseudo-device node cpuctlX
is created for each cpu present in the systems. The pseudo-device minor
number corresponds to the cpu number in the system. The cpuctl(4) pseudo-
device allows a number of ioctl to be preformed, namely RDMSR/WRMSR/CPUID
and UPDATE. The first pair alows the caller to read/write machine-specific
registers from the correspondent CPU. cpuid data could be retrieved using
the CPUID call, and microcode updates are applied via UPDATE.

The permissions are inforced based on the pseudo-device file permissions.
RDMSR/CPUID will be allowed when the caller has read access to the device
node, while WRMSR/UPDATE will be granted only when the node is opened
for writing. There're also a number of priv(9) checks.

The cpucontrol(8) utility is intened to provide userland access to
the cpuctl(4) device features. The utility also allows one to apply
cpu microcode updates.

Currently only Intel and AMD cpus are supported and were tested.

Approved by: kib
Reviewed by: rpaulo, cokane, Peter Jeremy
MFC after: 1 month

16 years agoRemove D_NEEDGIANT from io(4).
Ed Schouten [Fri, 8 Aug 2008 13:43:56 +0000 (13:43 +0000)]
Remove D_NEEDGIANT from io(4).

There is no need to mark this device node to use Giant. The only
architectures that use io(4) (i386 and amd64) only change a flag in
td->td_frame, which is only accessed by curthread.

Apart from this change, I think some fishy things may happen when using
/dev/io in multithreaded applications. I haven't tested, but looking at
the code, the flag doesn't get cleared when close() is called from
another thread, but this may not be this important.

I'm not removing D_NEEDGIANT from mem(4), because this driver isn't
Giant safe at all (it calls GIANT_REQUIRED).

16 years agoAdd /usr/share/man/whatis, /var/db/locate.database, and /var/log to the
Colin Percival [Fri, 8 Aug 2008 10:36:16 +0000 (10:36 +0000)]
Add /usr/share/man/whatis, /var/db/locate.database, and /var/log to the
list of paths which `freebsd-update IDS` should ignore by default.

16 years agoReplace description on how to do CVS imports on this module with a
Edwin Groothuis [Fri, 8 Aug 2008 04:37:43 +0000 (04:37 +0000)]
Replace description on how to do CVS imports on this module with a
description on how to do SVN imports on this module.

Approved by: bde (implicit)

16 years agoIn `freebsd-update IDS`, strip out file flags before we look for
Colin Percival [Fri, 8 Aug 2008 04:34:00 +0000 (04:34 +0000)]
In `freebsd-update IDS`, strip out file flags before we look for
non-matching index lines.  This fixes a bug where bogus warnings would
be printed file has the wrong file flags AND has been updated by
FreeBSD Update.

Reported by: Royce Williams

16 years agoMFV on tzdata2008e:
Edwin Groothuis [Fri, 8 Aug 2008 04:29:39 +0000 (04:29 +0000)]
MFV on tzdata2008e:

- Fix dates in 2008/2009 for Africa/Mauritius.
- Leap second notification for the end of 2008.

Approved by: bde (mentor, implicit), des
MFC after: 1 week

16 years agoVendor import no tzdata2008e:
Edwin Groothuis [Fri, 8 Aug 2008 04:26:48 +0000 (04:26 +0000)]
Vendor import no tzdata2008e:

- Fix dates in 2008/2009 for Africa/Mauritius.
- Leap second notification for the end of 2008.

Approved by: bde (mentor, implicit), des

16 years agoMFV of tzdata2008d
Edwin Groothuis [Fri, 8 Aug 2008 04:20:36 +0000 (04:20 +0000)]
MFV of tzdata2008d

- Mauritius will have a DST experiment between 2008-11-01 and 2009-03-31.
- Add/Fix historical data for C-Eur, the SovietZone, Germany,
  Bahamas, San Luis.
- Add information about West Para (America/Santarem)
- America/Eirunepe and America/Rio_Branco go to UTC-4

Approved by: bde (mentor, implicit), des
MFC after: 1 week

16 years agoVendor import of tzdata2008d
Edwin Groothuis [Fri, 8 Aug 2008 03:56:52 +0000 (03:56 +0000)]
Vendor import of tzdata2008d

- Mauritius will have a DST experiment between 2008-11-01 and 2009-03-31.
- Add/Fix historical data for C-Eur, the SovietZone, Germany,
  Bahamas, San Luis.
- Add information about West Para (America/Santarem)
- America/Eirunepe and America/Rio_Branco go to UTC-4

Approved by: bde (mentor, implicit), des

16 years agoMFV of tzdata2008c
Edwin Groothuis [Fri, 8 Aug 2008 03:48:10 +0000 (03:48 +0000)]
MFV of tzdata2008c

- Africa/Morocco will have DST in 2008.
- Asia/Choibalsan should be GMT+08:00.
- Asia/Pakistan will have DST in 2008.

Also set all the svn:eol-style properties to native.

Approved by: bde (mentor, implicit), des
MFC after: 1 week

16 years agoVendor import of tzdata2008c
Edwin Groothuis [Fri, 8 Aug 2008 03:35:34 +0000 (03:35 +0000)]
Vendor import of tzdata2008c

- Africa/Morocco will have DST in 2008.
- Asia/Choibalsan should be GMT+08:00.
- Asia/Pakistan will have DST in 2008.

Also set all the svn:eol-style properties to native.

Approved by: bde (mentor, implicit), des

16 years agoRevert the change in leapseconds for 31 december 2008, so I can
Edwin Groothuis [Fri, 8 Aug 2008 03:18:30 +0000 (03:18 +0000)]
Revert the change in leapseconds for 31 december 2008, so I can
properly bootstrap the merge history on this module.

Approved by: bde (implicit)

16 years agoCleanup (cont)
Edwin Groothuis [Fri, 8 Aug 2008 02:55:34 +0000 (02:55 +0000)]
Cleanup (cont)

Remove Theory, which isn't part of the zoneinfo module but came out
of /head/usr.sbin/zic (and isn't installed from there neither).

Approved by: bde (implicit)
MFC after: 1 week

16 years ago1) Fix longstanding math bug with denominator > 1 (wrong probability).
Andrey A. Chernov [Fri, 8 Aug 2008 02:46:47 +0000 (02:46 +0000)]
1) Fix longstanding math bug with denominator > 1 (wrong probability).
Test case:
random -f some_small_file 10000
(in most cases must be no output)
2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be
choosed) with EFBIG err()
3) After line is found, terminate list loop for -U case too,
since nothing to do in the rest of the loop left.

16 years agoCleanup (cont)
Edwin Groothuis [Fri, 8 Aug 2008 02:44:04 +0000 (02:44 +0000)]
Cleanup (cont)

Remove Makefile, which isn't part of the distributed sources.

Remove Theory, which isn't part of the distributed source but came
out of /vendor/tzcode/.

Approved by: bde (mentor, implicit)

16 years agoI was confused a bit by the wrong construction with RAND_MAX
Andrey A. Chernov [Fri, 8 Aug 2008 01:42:17 +0000 (01:42 +0000)]
I was confused a bit by the wrong construction with RAND_MAX
used in randomize_fd.c.
Although the max value is the same currently, RAND_MAX is for rand(),
not for random().
So move RANDOM_MAX const to the common file now, make it UL and
use in randomize_fd.c too.
(in any case its old value was 1 less then must be, as noted in
the prev. commit)

16 years ago1) Replace hardcoded RANDOM_MAX macro with wrong (1 less than must be)
Andrey A. Chernov [Fri, 8 Aug 2008 01:02:30 +0000 (01:02 +0000)]
1) Replace hardcoded RANDOM_MAX macro with wrong (1 less than must be)
value with ((double)RAND_MAX + 1)
2) For exit code increase valid denominator upper range from 255 to 256
since returned value is [0 .. denom - 1]

16 years agoRemove some unused variables.
David Schultz [Fri, 8 Aug 2008 00:21:27 +0000 (00:21 +0000)]
Remove some unused variables.

Reported by: Intel C Compiler

16 years agoremove the empty "datfiles" directory.
Edwin Groothuis [Fri, 8 Aug 2008 00:18:22 +0000 (00:18 +0000)]
remove the empty "datfiles" directory.

Approved by: bde (mentor, implicit), des

16 years agoRemove the "datfiles" directory
Edwin Groothuis [Fri, 8 Aug 2008 00:16:08 +0000 (00:16 +0000)]
Remove the "datfiles" directory

16 years agoIn the line
David Schultz [Fri, 8 Aug 2008 00:15:16 +0000 (00:15 +0000)]
In the line
   #pragma STDC CX_LIMITED_RANGE   ON
the "ON" needs to be in caps. gcc doesn't understand this pragma
anyway and assumes it is always on in any case, but icc supports
it and cares about the case.

16 years agoFlatting the vendor dist tree of tzdata.
Edwin Groothuis [Thu, 7 Aug 2008 23:59:20 +0000 (23:59 +0000)]
Flatting the vendor dist tree of tzdata.

Approved by: bde (mentor, implicit), des

16 years agoAllow 53C1010 without NVRAM to negotiate Ultra-3.
Marius Strobl [Thu, 7 Aug 2008 23:41:17 +0000 (23:41 +0000)]
Allow 53C1010 without NVRAM to negotiate Ultra-3.

MFC after: 3 days

16 years ago- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
Marius Strobl [Thu, 7 Aug 2008 22:46:25 +0000 (22:46 +0000)]
- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
  no particular reason for them to be implemented in assembler and
  having them in C allows easier extension as well as using more C
  macros and {d,i}tlb_slot_max rather than hard-coding magic (and
  actually spitfire-only) values.
- Fix the compilation of pmap_print_tte().
- Change pmap_print_tlb() to use ldxa() rather than re-rolling it
  inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than
  hardcoding magic (and actually spitfire-only) values.
- While at it, suffix the above mentioned functions with "_sun4u" to
  underline they're architecture-specific.
- Use __FBSDID and macros instead of magic values in locore.S.
- Remove unused includes and smp_stack in locore.S.

16 years agoUse arc4random_uniform(3)
Andrey A. Chernov [Thu, 7 Aug 2008 22:22:41 +0000 (22:22 +0000)]
Use arc4random_uniform(3)

16 years agoUse __FreeBSD_version check since it is bootstrap tool
Andrey A. Chernov [Thu, 7 Aug 2008 21:36:09 +0000 (21:36 +0000)]
Use __FreeBSD_version check since it is bootstrap tool

16 years agoFix a small problem in the comment about departure from NetBSD.
Warner Losh [Thu, 7 Aug 2008 21:16:14 +0000 (21:16 +0000)]
Fix a small problem in the comment about departure from NetBSD.
Also, r181392 fixed a small problem with multifunction cards that would
cause the card not to power down when the last driver detached from it.

16 years agoPermit Giant to be passed as the explicit interlock either to
John Baldwin [Thu, 7 Aug 2008 21:00:13 +0000 (21:00 +0000)]
Permit Giant to be passed as the explicit interlock either to
msleep/mtx_sleep or the various cv_*wait*() routines.  Currently, the
"unlock" behavior of PDROP and cv_wait_unlock() with Giant is not
permitted as it is will be confusing since Giant is fully unrecursed and
unlocked during a thread sleep.

This is handy for subsystems which wish to allow unlocked drivers to
continue to use Giant such as CAM, the new TTY layer, and the new USB
stack.  CAM currently uses a hack that I told Scott to use because I
really didn't want to permit this behavior, and the TTY and USB patches
both have various patches to permit this.

MFC after: 2 weeks

16 years agoConvert to new style PC Card front end driver. Add support for the
Warner Losh [Thu, 7 Aug 2008 20:55:20 +0000 (20:55 +0000)]
Convert to new style PC Card front end driver.  Add support for the
NEC PC-9801N-J02 and PC-9801N-J02R.  I can't test the former because
it requires resources that conflict with my laptop.  I can't test the
latter because my dog chewed up my -J02R card and it didn't survive
well enough for me to test.

16 years agoAdd NEC PC-9802N-J02 (confirmed) and NEC PC-9202N-J02R (speculative)
Warner Losh [Thu, 7 Aug 2008 20:52:54 +0000 (20:52 +0000)]
Add NEC PC-9802N-J02 (confirmed) and NEC PC-9202N-J02R (speculative)
to the list of devices.

16 years agoAdd card_if.h and pccarddevs.h
Warner Losh [Thu, 7 Aug 2008 20:51:51 +0000 (20:51 +0000)]
Add card_if.h and pccarddevs.h

16 years agoDocument the new return values for sleepq_abort(), sleepq_broadcast(), and
John Baldwin [Thu, 7 Aug 2008 20:47:01 +0000 (20:47 +0000)]
Document the new return values for sleepq_abort(), sleepq_broadcast(), and
sleepq_signal().

Prodded by: attilio

16 years agoAdd reference to arc4random_uniform(3)
Andrey A. Chernov [Thu, 7 Aug 2008 20:07:30 +0000 (20:07 +0000)]
Add reference to arc4random_uniform(3)

16 years agoUse arc4random_uniform(3)
Andrey A. Chernov [Thu, 7 Aug 2008 20:05:51 +0000 (20:05 +0000)]
Use arc4random_uniform(3)

16 years agoUse arc4random_uniform(3)
Andrey A. Chernov [Thu, 7 Aug 2008 20:02:42 +0000 (20:02 +0000)]
Use arc4random_uniform(3)

Obtained from:  OpenBSD

16 years agoUpdate SCSI opcodes and ASCs from t10.org.
Jung-uk Kim [Thu, 7 Aug 2008 17:25:05 +0000 (17:25 +0000)]
Update SCSI opcodes and ASCs from t10.org.

http://www.t10.org/lists/1spc-lst.htm

Note opcodes for scanner and communication devices are taken from the previous
revision because they are not listed in the files any more.
Also, note newly added ASCs are all marked with 'XXX TBD' and take SS_RDEF action
for now.  Some ASCs need SS_TUR for error recovery or SS_FATAL to prevent further
retrials.  We should deal with them later.

Reviewed by: scottl, ken

16 years agoImplement cproj{,f,l}().
David Schultz [Thu, 7 Aug 2008 15:07:48 +0000 (15:07 +0000)]
Implement cproj{,f,l}().

16 years agoUse humanize_number to report pen-sizes so people don't have to count
Poul-Henning Kamp [Thu, 7 Aug 2008 14:48:35 +0000 (14:48 +0000)]
Use humanize_number to report pen-sizes so people don't have to count
the digits when trying to install openoffice.

16 years agoAnnotate creal(), cimag(), and conj() with __pure2.
David Schultz [Thu, 7 Aug 2008 14:40:52 +0000 (14:40 +0000)]
Annotate creal(), cimag(), and conj() with __pure2.

16 years agoUse cpack() and the gcc extension __imag__ to implement cimag() and
David Schultz [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.

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

MFC after: 1 week

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

MFC after: 1 week (after inpcb rwlocking)

16 years agoComment out information about Jumbo Frame support, it's not
Christian 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

16 years agoFix ACL preservation, apparently broken in 1.47.
Edward Tomasz Napierala [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

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

Submitted by: GeJ on #bsdports

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

16 years agoUpdate the units library file.
Edwin Groothuis [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

16 years agoWhen the miibus for the AX88x90 or TC5299J cards fails to attach, we
Warner Losh [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...

16 years agoMake atacontrol(8) rebuild work when /usr is not mounted or from /rescue
Antoine Brodin [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

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

16 years agoadd WPS oui
Sam Leffler [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

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

16 years agoUser may do "mount -o snapshot ...", that causes new FFS mount to be
Konstantin Belousov [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

16 years agoAdd an implementation of the RPCSEC_GSS authentication protocol for RPC. This
Doug Rabson [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

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

16 years agoUnify the initial card probe/attach procedure with the kldload
Warner Losh [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.

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

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

16 years agoRemove the second check for a 64-bit BAR value on a 32-bit system in
John Baldwin [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

16 years agoAdd a script to perform simple analysis of a crash dump (either a full
John Baldwin [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

16 years agoIf a thread that is swapped out is made runnable, then the setrunnable()
John Baldwin [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