Commit Graph

151005 Commits

Author SHA1 Message Date
Jaakko Heinonen
8d6956fb6b Clarify that the value of the fts_info field is different in post-order.
Discussed with:	das
Approved by:	trasz (mentor)
MFC after:	1 week
2009-11-26 19:09:10 +00:00
Tony Finch
84a3c48bb4 unifdefall: optimise the loop that builds the unifdef command.
The old code used a shell loop to convert each controlling macro
definition into a command-line argument, reading the macro definitions
file each time. The new code converts the list of controlling macros
into a sed script which can run through the list of macro definitions
in one go.

Add some explanatory comments, since the code is quite meta.

Use {} instead of () for redirecting a group of commands.

Submitted by: Jonathan Nieder <jrnieder@gmail.com>
2009-11-26 19:08:33 +00:00
Konstantin Belousov
86665365a8 Libthr cannot be dynamically loaded into the running process.
Mark it with -z nodlopen for now.

Discussed with:	jhb, kan
MFC after:	3 weeks
2009-11-26 14:01:14 +00:00
Konstantin Belousov
0d3bc8a930 Implement rtld part of the support for -z nodlopen (see ld(1)).
Reviewed by:	kan
MFC after:	3 weeks
2009-11-26 13:57:20 +00:00
Konstantin Belousov
45d276ce3c Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN.
Reviewed by:	kan
MFC after:	3 days
2009-11-26 13:55:49 +00:00
Konstantin Belousov
9a6ceacede Implement sighold, sigignore, sigpause, sigrelse, sigset functions
from SUSv4 XSI. Note that the functions are obsoleted, and only
provided to ease porting from System V-like systems. Since sigpause
already exists in compat with different interface, XSI sigpause is
named xsi_sigpause.

Reviewed by:	davidxu
MFC after:	3 weeks
2009-11-26 13:49:37 +00:00
Konstantin Belousov
5dc1529c34 sigset() is the name of function specified by SUSv4.
Replace it to avoid conflict.

MFC after:	3 weeks
2009-11-26 13:41:15 +00:00
Christian Brueffer
a3786ac52e Add IBM ServeRAID-MR10i to the hardware list.
Submitted by:	pluknet <pluknet@gmail.com>
MFC after:	3 days
2009-11-26 13:25:07 +00:00
Alexander Motin
bcbe578a6a Drop USB mass storage devices support from ata(4). It is out of the build as
long as I remember, and completely superseded by better maintained umass(4).
It's main idea was to optionally avoid CAM dependency for such devices, but
with move ATA to CAM, it is not actual any more.

No objections:	hselasky@, thompsa@, arch@
2009-11-26 12:41:43 +00:00
Alexander Motin
b447e682d6 MFp4:
Improve ATA mode/SATA revision control.
2009-11-26 08:49:46 +00:00
Alan Cox
a6d42a0d62 Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE has
represented a write access that is allowed to override write protection.
Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into
text pages.  Text pages are not just write protected but they are also
copy-on-write.  VM_PROT_OVERRIDE_WRITE overrides the write protection on the
text page and triggers the replication of the page so that the breakpoint
will be written to a private copy.  However, here is where things become
confused.  It is the debugger, not the process being debugged that requires
write access to the copied page.  Nonetheless, the copied page is being
mapped into the process with write access enabled.  In other words, once the
debugger sets a breakpoint within a text page, the program can write to its
private copy of that text page.  Whereas prior to setting the breakpoint, a
SIGSEGV would have occurred upon a write access.  VM_PROT_COPY addresses
this problem.  The combination of VM_PROT_READ and VM_PROT_COPY forces the
replication of a copy-on-write page even though the access is only for read.
Moreover, the replicated page is only mapped into the process with read
access, and not write access.

Reviewed by:	kib
MFC after:	4 weeks
2009-11-26 05:16:07 +00:00
Jun Kuriyama
ce8ad96abe - New style of jail(8) usage requires "-c" argument to create a jail.
Reviewed by:	jamie
2009-11-26 03:26:59 +00:00
Tony Finch
8af26c5e86 Remove debugging remnants from unifdefall.
Submitted by:	Jonathan Nieder <jrnieder@gmail.com>
2009-11-26 02:14:08 +00:00
Andrew Thompson
767cb2e29d Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.
2009-11-26 00:43:17 +00:00
Tony Finch
38281fea3e Fix a performance bug in factor(6).
Check if large factor is prime before applying Pollard's algorithm;
fixes "factor 2147483647111311".  Increase base if p-1 algorithm
reaches 1; fixes "factor 99999999999991".

Testcases from David A Bagley <bagleyd@tux.org>.
Fixes from Joseph Myers <jsm@NetBSD.org>.
Problem rediscovered by an attempt to factor my phone number.

A few other incidental fixes: correct a couple of factually incorrect
comments; use ident string macros; move from 4-clause to 3-clause
BSD licence (University of California copyright).

Obtained from:	NetBSD
2009-11-26 00:38:13 +00:00
Andrew Thompson
e6af527c11 Disable interrupts after doing early takeover of the usb controller in case usb
isnt actually compiled in (or kldloaded) as the controller could cause spurious
interrupts.

Tested by:	Florian Smeets
2009-11-25 20:50:43 +00:00
Tony Finch
f6f85e213e Update unifdef to my upstream version 1.188
Main highlights:

(A) The new -B option compresses blank lines around a deleted section
    so that blank lines around "paragraphs" of code don't get doubled.

(B) Lenient evaluation of && and || so that #if expressions can be
    evaluated even when some of their sub-expressions cannot be.

(C) The evaluator can now handle macros with arguments.

(D) Portability fixes, especially for unifdefall.

Contributions from:
Ben Hutchings at Solarflare Communications (A and B)
Anders H Kaseorg <andersk@mit.edu> (A and C)
Jonathan Nieder <jrnieder@gmail.com> (D)

Obtained from:  http://dotat.at/prog/unifdef/
2009-11-25 20:23:18 +00:00
Julian Elischer
5c2d577a21 exit if "make distribition" fails
Submitted by:	patrick tracanelli
MFC after:	1 week
2009-11-25 19:00:30 +00:00
Pyun YongHyeon
6a15578d8a Fix typo which inversed the logic which in turn disabled MSI.
Pointy hat to:  yongari
2009-11-25 17:51:14 +00:00
Pyun YongHyeon
7e6acdf12b Make sure one shot MSI is enabled.
Submitted by:	marius
2009-11-25 17:30:38 +00:00
Edward Tomasz Napierala
27565a4094 Be nice, don't use the f-word. 2009-11-25 16:36:07 +00:00
Attilio Rao
2e7ecbfbc8 Change gcore in order to get rid of the procfs accesses and use FreeBSD's
specific sysctls and ptrace interfaces.
This change switches a bit gcore POLA that is summarized here:
- now gcore can recognize threads within the process and handle dumps
  on thread-scope
- the process to be analyzed will be stopped during its gcore run
- gcore may not work with processes which are actively being analyzed
  by gdb or truss
- the ptrace interface may cause syscalls to return EINTR, thus
  interferring with signals handling within the process

Side note: <janitor task> the interface can be further lifted in order to
get rid of the very last procfs interfaces remnants and made more
suitable for copying with sysctl/ptrace interface </janitor task>.

Obtained from:	Sandvine Incorporated
Reviewed by:	emaste, rwatson
Sponsored by:	Sandvine Incorporated
MFC:		1 month
2009-11-25 15:23:14 +00:00
Attilio Rao
7a7043c787 Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swap
environments.
Please note that this can't be done while such processes run in jails.

Note: in future it would be interesting to find a way to do that
selectively for any desired proccess (choosen by user himself), probabilly
via a ptrace interface or whatever.

Obtained from:	Sandvine Incorporated
Reviewed by:	emaste, arch@
Sponsored by:	Sandvine Incorporated
MFC:		1 month
2009-11-25 15:12:24 +00:00
Attilio Rao
d72dc9a7eb Add the possibility to show informations about dropped packets on the
input path when showing informations about the interfaces.

Obtained from:	Sandvine Incorporated
Reviewed by:	emaste
Sponsored by:	Sandvine Incorporated
MFC:		2 weeks
2009-11-25 15:02:32 +00:00
Attilio Rao
5e3d7b099a In tac_get_av_value() empty attributes should be handled like 0-length
strings rather than unset strings.
Fix the present wrong behaviour.

Obtained from:	Sandvine Incorporated
Reviewed by:	emaste
Sponsored by:	Sandvine Incorporated
MFC:		1 week
2009-11-25 14:59:28 +00:00
Attilio Rao
f413289ee0 Fix a socket leak in ftp_request() after that a connection is established.
Submitted by:	Sandvine Incorporated
Reviewed by:	des, emaste
Sponsored by:	Sandvine Incorporated
MFC:		1 week
2009-11-25 14:57:07 +00:00
Alexander Motin
1a6f09b826 Fix small copu-paste bug. 2009-11-25 14:24:14 +00:00
Robert Watson
efffdeda35 Fix comment typo.
Submitted by:	Marc Balmer <marc at msys.ch>
MFC after:	3 days
2009-11-25 13:31:17 +00:00
Garrett Wollman
87541d3110 Style: use structure assignment rather than memcpy() to copy a
structure.
2009-11-25 04:53:38 +00:00
Garrett Wollman
bedffadccc In clnt_raw_create(), avoid minor race condition initializing the
file-scope variable clntraw_private.

Found by:	Clang static analyzer
MFC after:	7 days
2009-11-25 04:52:12 +00:00
Garrett Wollman
fcbfc882d6 In svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED
&& SUCCESS case succeeds.  The stack garbage might be zero.

Found by:	Clang static analyzer
MFC after:	7 days
2009-11-25 04:49:41 +00:00
Garrett Wollman
0c0349bfa4 Eliminate more dead stores.
Found by:	Clang static analyzer
MFC after:	7 days
2009-11-25 04:45:45 +00:00
Garrett Wollman
750a395ba6 Make all three if conditions look similar by always initializing nsec
and moving the default initialization of prec into the else clause.
The clang static analyzer erroneously thought that nsec can be used
uninitialized here; it was not actually possible, but better to make
the code clearer.  (Clang can't know that sprintf() won't modify *pi
behind the scenes.)
2009-11-25 04:35:54 +00:00
Garrett Wollman
ab5b2fafec In __mbsconv(), if prec was zero, nconv could have been used
uninitialized.  Initialize it to a safe value so that there's no
chance of returning an error if stack garbage happens to be equal to
(size_t)-1 or (size_t)-2.

Found by:	Clang static analyzer
MFC after:	7 days
2009-11-25 04:27:55 +00:00
Garrett Wollman
e40c32385d Eliminate dead store.
Found by:	Clang static analyzer
MFC after:	7 days
2009-11-25 04:21:42 +00:00
Will Andrews
c3582a1967 Make ``ifconfig -l ether'' only list interfaces that speak Ethernet.
PR:		118987
Approved by:	ken (mentor)
2009-11-25 00:00:57 +00:00
Ivan Voras
cbc4ea28e2 Make ULE process usage (%CPU) accounting usable again by keeping track
of the last tick we incremented on.

Submitted by:	matthew.fleming/at/isilon.com, is/at/rambler-co.ru
Reviewed by:	jeff (who thinks there should be a better way in the future)
Approved by:	gnn (mentor)
MFC after:	3 weeks
2009-11-24 19:57:41 +00:00
Fabien Thomas
5eaf27d8ff - fix a LOR between process lock and pmc thread mutex
- fix a system deadlock on process exit when the sample buffer
is full (pmclog_loop blocked in fo_write) and pmcstat exit.

Reviewed by: jkoshy
MFC after: 3 weeks
2009-11-24 19:26:53 +00:00
John Baldwin
31e119ed7d Use a single private timer to drive the transmit watchdog rather than using
if_watchdog and if_timer from the first port.

Reviewed by:	gonzo
2009-11-24 18:34:47 +00:00
Pyun YongHyeon
fd4d32feb2 BGE_FLAG_40BIT_BUG should be set before creating DMA tags.
Pointy hat to:  yongari
2009-11-24 17:46:58 +00:00
John Baldwin
6d60ecdc6c - For 350 chips, don't set various INTR bits in TX control word; turning INTR
bits on seems to confuse hardware TX engine.
- For 350 chips, set TX desc's buffer physical address before turning on the
  TX desc valid bit.

Submitted by:	Jeremy O'Brien  obrien654j | gmail, sephe
Obtained from:	DragonFly BSD
2009-11-24 16:57:35 +00:00
John Baldwin
08f85872d3 Use bus_*() rather than bus_space_*(). 2009-11-24 16:54:54 +00:00
Alexander Motin
32e7052ed0 Use only lower byte of sectors_intr IDENTIFY word as sector count.
This fixes SET_MULTI error during boot on devices supporting less then
16 sectors per interrupt.
2009-11-24 14:06:15 +00:00
Christian Brueffer
eaea833385 Grammar and mdoc improvements.
MFC after:	3 days
2009-11-24 13:44:53 +00:00
Alexander Motin
c8039fc667 MFp4:
- Extend XPT-SIM transfer settings control API. Now it allows to report to
SATA SIM number of tags supported by each device, implement ATA mode and
SATA revision negotiation for both SATA and PATA SIMs.
- Make ahci(4) and siis(4) to use submitted maximum tag number, when
scheduling requests. It allows to support NCQ on devices with lower tags
count then controller supports.
- Make PMP driver to report attached devices connection speeds.
- Implement ATA mode negotiation between user settings, device and
controller capabilities.
2009-11-24 12:47:58 +00:00
Christian Brueffer
473fbad3c9 LSI MegaRAID 9260 works, sort the hardware list while here.
Submitted by:	Jason <jhelfman@e-e.com>
MFC after:	3 days
2009-11-24 08:14:22 +00:00
Kip Macy
2036720ba9 remove annoying printf that cripples kdb on PV guests 2009-11-24 07:18:38 +00:00
Kip Macy
be7747b449 fixup kernel core dumps on paravirtual guests 2009-11-24 07:17:51 +00:00
Marcel Moolenaar
9c6a6bc422 Improve upon revision 196196 by removing the newly added comment
in the wrong place and instead add a KASSERT in the right place.
2009-11-24 01:35:21 +00:00
Marcel Moolenaar
a78fb6f93d Don't make MJUMPAGESIZE equal to PAGE_SIZE unconditionally.
When PAGE_SIZE is 16K, MJUMPAGESIZE equals MJUM16BYTES and
causes build breakages.
For PAGE_SIZE < 2K, define MJUMPAGESIZE as MCLBYTES.
For PAGE_SIZE > 8K, define MJUMPAGESIZE as 8K.
Everywhere inbetween, define MJUMPAGESIZE as PAGE_SIZE.

Thus MCLBYTES <= MJUMPAGESIZE <= 8KB.
2009-11-23 23:23:05 +00:00