Commit Graph

140597 Commits

Author SHA1 Message Date
Poul-Henning Kamp
36a6be7fc9 Add -i option to supress image building.
Submitted by:	keramida
2008-08-09 09:27:54 +00:00
Poul-Henning Kamp
fc0708f69f Track /etc/ttys change to uart(4) 2008-08-09 09:27:06 +00:00
Warner Losh
1b146a73ee 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.
2008-08-09 07:41:18 +00:00
David E. O'Brien
d606fed624 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.
2008-08-09 06:35:19 +00:00
Alan Cox
b09485a336 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
2008-08-09 05:46:13 +00:00
Warner Losh
3dfff737f3 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@
2008-08-09 05:46:01 +00:00
Sam Leffler
ed8b5a9370 recognize WPS ie's
Submitted by:	"Chuck Tuffli" <chuck@tuffli.net>
MFC after:	1 week
2008-08-09 05:37:22 +00:00
Warner Losh
bfd58cce84 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...
2008-08-09 04:08:36 +00:00
Warner Losh
e33abcc50c Change -1 to 0xfffffffful since the interface returns uint32_t. 2008-08-09 03:54:12 +00:00
Warner Losh
ae438af62d 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
2008-08-09 03:37:12 +00:00
David E. O'Brien
01faf7789b 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.
2008-08-09 01:19:00 +00:00
Xin LI
cb752f1da5 Add prototype defination for setfib(2) to sys/socket.h. 2008-08-08 22:40:04 +00:00
Stanislav Sedov
d7a70ce7d4 - Bump __FreeBSD_version for cpuctl(4) added.
Approved by:	kib
2008-08-08 21:36:49 +00:00
Colin Percival
c123de30b6 Remove variables which are assigned values and never used thereafter.
Found by:	LLVM/Clang Static Checker
Approved by:	jasone
2008-08-08 20:42:42 +00:00
John Baldwin
c22616ec0b - 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
2008-08-08 19:41:20 +00:00
John Baldwin
beb5dae355 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
2008-08-08 19:39:11 +00:00
Philip Paeps
ae289dcbac 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
2008-08-08 18:00:33 +00:00
Stanislav Sedov
e085f869d5 - 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
2008-08-08 16:26:53 +00:00
Ed Schouten
cacdd70cc7 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).
2008-08-08 13:43:56 +00:00
Colin Percival
9c4ca95bf7 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.
2008-08-08 10:36:16 +00:00
Edwin Groothuis
f281c10a84 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)
2008-08-08 04:37:43 +00:00
Colin Percival
bb10a826c1 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
2008-08-08 04:34:00 +00:00
Edwin Groothuis
feacbe24de 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
2008-08-08 04:29:39 +00:00
Edwin Groothuis
77de96ce1a 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
2008-08-08 04:26:48 +00:00
Edwin Groothuis
a88fb43c2a 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
2008-08-08 04:20:36 +00:00
Edwin Groothuis
05d953cbee 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
2008-08-08 03:56:52 +00:00
Edwin Groothuis
01910fcbf4 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
2008-08-08 03:48:10 +00:00
Edwin Groothuis
c1ca882a0a 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
2008-08-08 03:35:34 +00:00
Edwin Groothuis
9116c0d4e2 Revert the change in leapseconds for 31 december 2008, so I can
properly bootstrap the merge history on this module.

Approved by:	bde (implicit)
2008-08-08 03:18:30 +00:00
Edwin Groothuis
4920bffd86 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
2008-08-08 02:55:34 +00:00
Andrey A. Chernov
2c38883d2a 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.
2008-08-08 02:46:47 +00:00
Edwin Groothuis
7d150a8685 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)
2008-08-08 02:44:04 +00:00
Andrey A. Chernov
67cc8dbb1a 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)
2008-08-08 01:42:17 +00:00
Andrey A. Chernov
5b6bf07632 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]
2008-08-08 01:02:30 +00:00
David Schultz
941ab616c7 Remove some unused variables.
Reported by:	Intel C Compiler
2008-08-08 00:21:27 +00:00
Edwin Groothuis
3ab696ac5b remove the empty "datfiles" directory.
Approved by:	bde (mentor, implicit), des
2008-08-08 00:18:22 +00:00
Edwin Groothuis
a8c72aebc8 Remove the "datfiles" directory 2008-08-08 00:16:08 +00:00
David Schultz
65faab72b3 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.
2008-08-08 00:15:16 +00:00
Edwin Groothuis
af252fa7e6 Flatting the vendor dist tree of tzdata.
Approved by:	bde (mentor, implicit), des
2008-08-07 23:59:20 +00:00
Marius Strobl
a91a964c74 Allow 53C1010 without NVRAM to negotiate Ultra-3.
MFC after:	3 days
2008-08-07 23:41:17 +00:00
Marius Strobl
0b1bfc4986 - 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.
2008-08-07 22:46:25 +00:00
Andrey A. Chernov
68910e7a67 Use arc4random_uniform(3) 2008-08-07 22:22:41 +00:00
Andrey A. Chernov
921651bdd3 Use __FreeBSD_version check since it is bootstrap tool 2008-08-07 21:36:09 +00:00
Warner Losh
0e66b169d6 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.
2008-08-07 21:16:14 +00:00
John Baldwin
414e7679cb 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
2008-08-07 21:00:13 +00:00
Warner Losh
95469daac8 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.
2008-08-07 20:55:20 +00:00
Warner Losh
431b127e40 Add NEC PC-9802N-J02 (confirmed) and NEC PC-9202N-J02R (speculative)
to the list of devices.
2008-08-07 20:52:54 +00:00
Warner Losh
25c3d78377 Add card_if.h and pccarddevs.h 2008-08-07 20:51:51 +00:00
John Baldwin
2cdcea5ed8 Document the new return values for sleepq_abort(), sleepq_broadcast(), and
sleepq_signal().

Prodded by:	attilio
2008-08-07 20:47:01 +00:00
Andrey A. Chernov
b3dfe39b3a Add reference to arc4random_uniform(3) 2008-08-07 20:07:30 +00:00