Commit Graph

151380 Commits

Author SHA1 Message Date
Pyun YongHyeon
481402e197 Prefer device_printf(9) to printf(9). 2009-12-14 18:00:08 +00:00
Pyun YongHyeon
b534dcd5c0 Remove register keyword. 2009-12-14 17:53:10 +00:00
Xin LI
b0ffbd685c Add an option to specify that the received ZFS should not be automatically
mounted (receive -u).

Obtained from:	OpenSolaris (onnv revision 8584:327a1b6dd944)
Approved by:	pjd
2009-12-14 17:04:44 +00:00
Xin LI
49ecc22cc7 Style improvements:
- Sort function prototypes;
 - Apply static on all function bodies.  To quote bde@:

> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.

Reviewed by:	bde
2009-12-14 16:54:39 +00:00
John Baldwin
36f1a2c073 Remove comment claiming that building acpi into the kernel is deprecated.
PR:		docs/141353
Submitted by:	Bruce Cran
MFC after:	1 week
2009-12-14 15:32:32 +00:00
Luigi Rizzo
20c510f826 Properly fix callout handling by putting all the per-cpu info in
struct callout_cpu. From the comment in the file:

+ * There is one struct callout_cpu per cpu, holding all relevant
+ * state for the callout processing thread on the individual CPU.
+ * In particular:
+ *     cc_ticks is incremented once per tick in callout_cpu().
+ *     It tracks the global 'ticks' but in a way that the individual
+ *     threads should not worry about races in the order in which
+ *     hardclock() and hardclock_cpu() run on the various CPUs.
+ *     cc_softclock is advanced in callout_cpu() to point to the
+ *     first entry in cc_callwheel that may need handling. In turn,
+ *     a softclock() is scheduled so it can serve the various entries i
+ *     such that cc_softclock <= i <= cc_ticks .

Together with a smaller patch committed in september, this fixes a
bug that affects 8.0 with apps that rely on callouts to fire exactly
in the number of ticks specified (qemu among them).
Right now, callouts in 8.0 fire one tick late.

This was discussed in september with JeffR and jhb

MFC after:	3 days
2009-12-14 12:23:46 +00:00
Doug Barton
9190ba057c Revert the xterm terminal behavior to NOT clear the screen after
exiting a pager, vi, etc.

Add some example xterm*-clear entries to the termcap files to make
it easier for people to enable that behavior.

Document the examples in the man page to make them easier to find.
2009-12-14 07:18:31 +00:00
Alexander Kabaev
9fa014a263 Fix one spelling and one copy&paste error in comments. 2009-12-14 01:51:23 +00:00
Marcel Moolenaar
e4f141b546 Work-around a race condition on ia64 while unlocking a contested lock.
The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64,
we simply go to the kernel to unlock.
The big question is why this is only a race condition on ia64...

MFC after:	3 days
2009-12-14 01:26:01 +00:00
Marius Strobl
74f5b28a4d Only set ATA_CHECKS_CABLE for chip versions that actually support
cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions
>= 0xc7.

MFC after:	1 week
2009-12-13 20:36:42 +00:00
Bjoern A. Zeeb
07f5a2c997 Make admsw(4) compile again fixing typos and adding the missing variable
after r199762.
2009-12-13 20:27:59 +00:00
Robert Watson
60a396a4f7 Add Mark Heily's libkqueue test suite as a general kqueue test suite to
tools/regression.  It tests a number of aspects of kqueue behavior,
although not all currently pass (possibly bugs in the test suite?).

Submitted by:	Mark Heily <mark at heily.com>
Obtained from:	svn://mark.heily.com/libkqueue/trunk/test (r114)
2009-12-13 20:27:46 +00:00
Marius Strobl
affcd29e6a Properly support M5229 revision 0xc7 and 0xc8:
- These revisions no longer have cable detection capability.
- The UDMA support bit of register 0x4b has been dropped without an
  replacement.
- According to Linux it's crucial for working ATAPI DMA support to
  also set the reserved bit 1 of regsiter 0x53 with these revisions.

MFC after:	1 week
2009-12-13 18:42:06 +00:00
Marius Strobl
4640fdb5b6 Specify the capability and media bits of the capabilities page in
native, i.e. big-endian, format and convert as appropriate like we
also do with the multibyte fields of the other pages. This fixes
the output of acd_describe() to match reality on big-endian machines
without breaking it on little-endian ones. While at it, also convert
the remaining multibyte fields of the pages read although they are
currently unused for consistency and in order to prevent possible
similar bugs in the future.

MFC after:	1 week
2009-12-13 18:26:19 +00:00
Hiroki Sato
f96264e375 - Fix main() to use two separated sockets for the two transports
when "-P port" is specified.  It invoked svc{tcp,udp}_create()
  for only one of the two allocated sockets, and prevented the
  TCP socket from binding to as the result.

- Use TI-RPC functions and handle sockets in a
  transport-independent way.  At this moment only AF_INET ("udp"
  and "tcp") is supported because others need rewrites of ACL
  handling and yp clients.

- Add '-h addr' to specify addresses to bind to.

- Convert _msgout() to use variable argument lists and remove
  asprintf() for error strings.

- Remove register storage class specifier.

Discussed with:	kuriyama
MFC after:	1 week
2009-12-13 15:19:01 +00:00
Bjoern A. Zeeb
de0bd6f76b Throughout the network stack we have a few places of
if (jailed(cred))
left.  If you are running with a vnet (virtual network stack) those will
return true and defer you to classic IP-jails handling and thus things
will be "denied" or returned with an error.

Work around this problem by introducing another "jailed()" function,
jailed_without_vnet(), that also takes vnets into account, and permits
the calls, should the jail from the given cred have its own virtual
network stack.

We cannot change the classic jailed() call to do that,  as it is used
outside the network stack as well.

Discussed with:	julian, zec, jamie, rwatson (back in Sept)
MFC after:	5 days
2009-12-13 13:57:32 +00:00
Bjoern A. Zeeb
e65a4ba18b Add a few more V_hacks to nfsclient to allow machines with a VIMAGE
kernel to boot from NFS. [1]

Note: this is not a full virtualization of nfsclient. It is only does
what advertised above and nothing more.

Requested by:	public demand [1]
Tested by:	kris, ..
MFC after:	5 days
2009-12-13 11:06:39 +00:00
Xin LI
d993d09a6c - Remove times.h from C programs that does not manipulate with time at
all.
 - Remove pathnames.h from all but io.c since it's the only module that
   used these definations.
2009-12-13 04:50:11 +00:00
Xin LI
3cd983c5b9 egetopt.c does not use any stdlib.h definations, nor it referenced any
symbol from other module, so remove reference of stdlib.h and extern.h.

Verified with:	md5(1)
2009-12-13 04:34:51 +00:00
Xin LI
f449446e45 Use ANSI prototype for foldit(). 2009-12-13 04:14:55 +00:00
Xin LI
105215075a We use gmt2local code from tcpdump and gnuc.h is no longer being used
there, so remove this dummy header.
2009-12-13 04:08:04 +00:00
Xin LI
b4d09565cf xinstall.c does not require ctype functions, so ctype.h is not
necessary here.

Note: this would change the md5 checksum due to change caused
by different register layout.
2009-12-13 03:53:15 +00:00
Xin LI
820aa90f57 Staticify internal functions and make usage() a prototype. 2009-12-13 03:34:19 +00:00
Xin LI
965e331f6a Explicitly say that this is an internal library which is intended to be
used within FreeBSD base system only, and discourage user applications
from using it.  User applications should use the expat version from the
ports/package collection.

Reviewed by:	simon (earlier version)
MFC after:	2 weeks
2009-12-13 03:29:05 +00:00
Xin LI
7d0d4ebc83 Use prototype for usage(). 2009-12-13 03:18:37 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Marcel Moolenaar
066b1a5c7b Add support for memory disk (md). The size of the memory disk
is determined by MD_IMAGE_SIZE. A file system can be embedded
into the loader with /sys/tools/embed_mfs.sh.
Note that md.c is not included when MD_IMAGE_SIZE is not set.
2009-12-13 01:20:32 +00:00
Marius Strobl
0966baf709 Unbreak the ata_atapi() usage. Since r200171 the mode setting functions
get a ata_device type device passed instead of a ata_channel one, thus
ata_atapi() has to be adjusted accordingly.

Reviewed by:	mav
MFC after:	3 days
2009-12-13 00:13:21 +00:00
Ollivier Robert
7e3cc4cfce Update ntp vendor code to 4.2.4p8.
This is mainly to fix CVE-2009-3563, a remote DOS.

MFC after:	3 days
Security:	CVE-2009-3563
2009-12-12 22:29:30 +00:00
Konstantin Belousov
ec897c886d Document PBDRY and SLEEPQ_STOP_ON_BDRY.
Requested and reviewed by:	attilio
MFC after:	3 days
2009-12-12 22:08:37 +00:00
Jamie Gritton
4576bbe233 Don't free jail parameter values after printing them - jail_param_get
expects them to be there for the next jail in the list.

PR:		bin/141359
MFC after:	1 week
2009-12-12 21:59:30 +00:00
Doug Barton
f25291f3a1 Since the change to rc.subr in r198162 it's not necessary to specify
command in the rc.d script if we have a corresponding ${name}_program
entry, which we do for named.

Rename named_precmd to named_prestart to make it more clear and match
convention.

Move the command_args definition related to -u up into _prestart().
It (and the associated $named_uid value) are only used there, and
unlike required_* and pidfile don't need to be used until this stage.

Fix a silly bug that would only have affected people who were using
the new named_wait or named_auto_forward features, AND had set up an
rndc.conf file instead of using the automatically generated rndc.key.

For named_conf:
	Add "-c $named_conf" to command_args if it's not set to the
	default. If it is set to the default and we're using the base
	BIND it's not necessary. If we're using BIND from the ports
	the user is likely to have included it in _flags (due to long
	necessity for doing so) so don't duplicate that if it's set.

	Add $named_conf to required_files
2009-12-12 21:51:50 +00:00
Attilio Rao
2028867def In current code, threads performing an interruptible sleep (on both
sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will
leave the waiters flag on forcing the owner to do a wakeup even when if
the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" (based on the wakeup algorithm) queue while the other
queue has real waiters on it, because nobody is going to wakeup the 2nd
queue waiters and they will sleep indefinitively.

A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.  In this case, even if the waiters queue
is not empty, the waiters won't progress after being awake but they will
just fail, still not taking care of the 2nd queue waiters (as instead the
lock owned doing the wakeup would expect).

In order to fix this bug in a cheap way (without adding too much locking
and complicating too much the semantic) add a sleepqueue interface which
does report the actual number of waiters on a specified queue of a
waitchannel (sleepq_sleepcnt()) and use it in order to determine if the
exclusive waiters (or shared waiters) are actually present on the lockmgr
(or sx) before to give them precedence in the wakeup algorithm.
This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to
cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters
a lockmgr has and if all the waiters on the exclusive waiters queue are
LK_SLEEPFAIL just wake both queues.

The sleepq_sleepcnt() introduction and ABI breakage require
__FreeBSD_version bumping.

Reported by:	avg, kib, pho
Reviewed by:	kib
Tested by:	pho
2009-12-12 21:31:07 +00:00
Konstantin Belousov
1173b9a2d0 For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
cpu_set_syscall_retval() accordingly.

MFC after:	1 week
2009-12-12 20:11:31 +00:00
Jaakko Heinonen
d8eba599f5 Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR:		bin/140976
Submitted by:	D'Arcy Cain (original version) [1]
Approved by:	trasz (mentor)
2009-12-12 18:18:46 +00:00
Jaakko Heinonen
28c3507d53 The input line length limit mentioned on the manual page was removed by
r179374.

Approved by:	trasz (mentor)
2009-12-12 18:04:50 +00:00
Antoine Brodin
cb174b37be Install firmware(9) examples.
MFC after:	1 month
2009-12-12 17:04:36 +00:00
Luigi Rizzo
a50f6188de Make the code buildable in userland so it is easier to test it:
this requires a small reordering of headers and a few #defines to
map functions not available in userland.

Remove a useless #ifndef block at the beginning of the file.

Introduce (temporarily) rn_init2(), see the comment in the code
for the proper long term change.

No ABI or functional change.

MFC after:	7 days
2009-12-12 15:49:28 +00:00
Doug Barton
1b2aeedc64 Over time things that used to be files/directories/links can change
to something else. So add code to detect when things don't match and
give the user choices about how to fix it.

If we're using -P and something in the above check needs to be moved
we need to have the directory there for it, so create it at the
beginning and delete empty versions of it at the end.

The case where something used to be a file or link and now is supposed
to be a directory (e.g., /etc/security) is especially dangerous, so
make failure to install a necessary directory in $DESTDIR a fatal error.
2009-12-12 02:19:41 +00:00
Sean Farley
abdbb3fecd Fix libusb_open_device_with_vid_pid() to return a NULL if no device is
found instead of the last device in its search list.

Reviewed by:	thompsa
MFC after:	5 days
2009-12-12 00:24:30 +00:00
Sean Farley
0dd84a53d7 Remove a dead store.
MFC after:	5 days
2009-12-12 00:11:40 +00:00
Pyun YongHyeon
f52384d1cf Remove driver lock assertion in MII register access. This change
was made in r199543 to remove MTX_RECURSE. These routines can be
called in device attach phase(e.g. mii_phy_probe()) so checking
assertion here is not right as caller does not hold a driver lock.
2009-12-12 00:06:43 +00:00
Ed Schouten
c4cd42053e The hostname passed to ulog_login(3) may be optional.
Don't trip on a null pointer being passed to this function when
performing a local login.

Noticed by:	dougb
2009-12-11 23:52:42 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Xin LI
e87862f53a Remove unnecessary termcap.h includes inherited from extern.h and other
unneeded headers.  While I'm there, make function definations ANSI
prototypes.
2009-12-11 23:30:22 +00:00
Xin LI
3daadfc833 Move unistd.h includes to individual .c files and remove unnecessary
includes.
2009-12-11 23:23:57 +00:00
Xin LI
512be259a7 Remove unnecessary includes.
Reviewed by:	rodrigc
2009-12-11 23:20:02 +00:00
Doug Barton
044823bee6 Simplify handling of MTREEFILE relative to DESTDIR
Make the message about a missing MTREEFILE combined with -U
more informative
2009-12-11 23:03:35 +00:00
Benedict Reuschling
8031b25721 Reference the correct man page for firmware(9).
PR:             docs/140985
Submitted by:   Glen Barber (glen dot j dot barber at gmail dot com)
MFC after:      7 days
Reviewed by:    rpaulo
Approved by:    rpaulo, jkois (mentor)
2009-12-11 19:36:10 +00:00
Alexander Motin
c2023eeaad CFA support doesn't exclude FLUSH support.
Submitted by:	Grzegorz Bernacki
2009-12-11 16:32:59 +00:00