Commit Graph

155887 Commits

Author SHA1 Message Date
John Baldwin
3aa6d94e0c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
Rebecca Cran
cefac273a4 sctp_recvmsg returns the number of bytes received, not sent.
Approved by:	rrs (mentor)
MFC after:	1 month
2010-06-11 18:43:55 +00:00
Andriy Gapon
d89c217f30 ffs_softdep: change K&R in function defintions to ANSI prototypes
Apparently it's bad when we first have an ANSI prototype in function
declaration, but then use K&R in its defintion.

Complaint from:	clang
MFC after:	2 weeks
2010-06-11 18:26:53 +00:00
Andriy Gapon
df17ff6130 vnode.h: expand debug macros to non-empty void statements when
DEBUG_VFS_LOCKS is disabled

MFC after:	2 weeks
2010-06-11 18:20:56 +00:00
Jung-uk Kim
80fba82198 Fix a possible dereference of null pointer.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 3423)
2010-06-11 18:19:23 +00:00
Matthew D Fleming
d19511c357 Add INVARIANTS checking that numfreebufs values are sane. Also add a
per-buf flag to catch if a buf is double-counted in the free count.
This code was useful to debug an instance where a local patch at Isilon
was incorrectly managing numfreebufs for a new buf state.

Reviewed by:	jeff
Approved by:	zml (mentor)
2010-06-11 17:03:26 +00:00
Ulrich Spörlein
3ba5db25bb Remove dead variable assignments
Found by:	clang static analyzer
Verified by:	md5(1)
2010-06-11 17:03:04 +00:00
Ulrich Spörlein
ee4912eb07 Initialize variables before usage.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 7736, 7760)
2010-06-11 17:02:57 +00:00
John Baldwin
e762f66672 Add helper macros to iterate over available CPUs in the system.
CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs.  The
CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over
available CPU IDs.  CPU_NEXT(i) wraps around to CPU_FIRST() rather than
returning some sort of terminator.

Requested by:	rwatson
Reviewed by:	attilio
2010-06-11 15:56:18 +00:00
Alan Cox
9124d0d6a3 Relax one of the new assertions in pmap_enter() a little. Specifically,
allow pmap_enter() to be performed on an unmanaged page that doesn't have
VPO_BUSY set.  Having VPO_BUSY set really only matters for managed pages.
(See, for example, pmap_remove_write().)
2010-06-11 15:49:39 +00:00
Ashish SHUKLA
953282002f Add myself to the committers graph.
Approved by:	pgj (mentor)
2010-06-11 12:58:29 +00:00
Ivan Voras
c1e34abff8 In another move to join with the age of the Fruitbat, increase SYSV
shared resources defaults beyond absolute minimums.

The new values are chosen mostly by magic. They are still fairly
small and will need increasing for large installations (especially
SHMMAX). However, they are now enough to e.g. start PostgreSQL
installations with ~~300 users and nearly 512 MB of shared buffers.

Reviewed by:	A short discussion on hackers@
2010-06-11 09:27:33 +00:00
Ulrich Spörlein
72f27fcbb1 Use same table markup as in hexdump.1 2010-06-11 06:04:14 +00:00
Ulrich Spörlein
a90fbe1dbb More mdoc nitpicking to improve compatibility to mdocml
- .Nd in section NAME is not optional
- .Ed was missing
- "indent" is not a flag, but a literal argument for -offset
- stop switching font sizes for acronyms
- use .Brq instead of rolling our own
2010-06-11 06:04:07 +00:00
Ulrich Spörlein
9dc9ab104c Remove Xo/Xc in It, which is not yet supported by mdocml but
can be worked around trivially in this case.
2010-06-11 06:04:00 +00:00
Ulrich Spörlein
a6dcdf3b5f mdoc: stop abusing -column lists and use .Bl -tag instead 2010-06-11 06:03:54 +00:00
Ulrich Spörlein
134d45e8c6 mdoc nitpicking: the title argument shall be uppercase 2010-06-11 06:03:47 +00:00
Alexander Kabaev
e9bc68ba9c In dtrace lexer, do not unput token if it is EOF.
This is harmless with OpenSolaris fex and yacc, but with FreeBSD
causes '\xff' symbol to be physically put into input buffer, causing
subsequent syntax error.

MFC after: 1 week
2010-06-11 04:38:14 +00:00
Randall Stewart
ec4c19fcf0 3 Fixes -
a) There was a case where a ICMP message could cause
   us to return leaving a stuck lock on an stcb.
b) The iterator needed some tweaks to fix its lock
   ordering.
c) The ITERATOR_LOCK is no longer needed in the freeing
   of a stcb. Now that the timer based one is gone we don't
   have a multiple resume situation. Add to that that there
   was somewhere a path out of the freeing of an assoc that
   did NOT release the iterator_lock.. it was time to clean
   this old code up and in the process fix the lock bug.

MFC after:	1 week
2010-06-11 03:54:00 +00:00
Marcel Moolenaar
f635c047c5 Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4)
in particular, do not handle deferred DMA map load operations at all.
Any error, and especially EINPROGRESS, is treated as a hard error and
typically abort the current operation. The fact that the busdma code
queues the load operation for when resources (i.e. bounce buffers in
this particular case) are available makes this especially problematic.
Bounce buffering, unlike what the PR synopsis would suggest, works
fine.

While on the subject, properly implement swi_vm().

PR:		147502
MFC after:	1 week
2010-06-11 03:00:32 +00:00
Warner Losh
aef87548f3 Merge from tbemd
Enhance Makefile.inc processing, when asked for, to include the most
specific (MACHINE specific) to least specific (MACHINE_CPUARCH).

Reviewed by:	arch@ (mostly silence though)
2010-06-11 02:50:53 +00:00
Warner Losh
6fc3ead135 Merge from tbemd branch:
Introduce MACHINE_CPUARCH.  Many different MACHINE_ARCHs will be built
from one MACHINE_CPUARCH.  This will allow us to move to a more
standard MACHINE_ARCH for mips and arm which exist in many different
endian variants, and for powerpc where both 32 and 64 bit binaries are
generated from the same sources.

Reviewed by:	arch@ (mostly silence though)
2010-06-11 02:43:36 +00:00
Tai-hwa Liang
ca765120a8 Fixing compilation bustage by adding the missing && back. 2010-06-11 01:32:42 +00:00
Xin LI
08b300a1b7 Several style fixes as prompted by bde@.
While I'm there, loosen the st_nlink check and fix grammar for 1 extra
links.
2010-06-10 20:59:28 +00:00
Rui Paulo
2bc3bd71de Some odd APs send beacons on the same TX queue as non-beacons. This breaks
802.11 duplicate detection. Upon looking at the standard, we discover
that 802.11-2007 says:
"A receiving QoS STA is also required to keep only the most recent
cache entry per<Address 2, TID, sequence-number>  triple, storing only
the most recently received fragment number for that triple. A receiving
STA may omit tuples obtained from broadcast/multicast or ATIM frames
from the cache."

To fix this, we just disable duplicate detection for multicast/broadcast
frames.

Reviewed by:	sam
MFC after:	4 weeks
Obtained from:	DragonFly
2010-06-10 20:58:34 +00:00
Rui Paulo
dd7fc6998b Add missing braces.
Submitted by:	sam
MFC after:	3 days
2010-06-10 20:40:38 +00:00
Randi Harper
2333387e05 Fix uninitialized variables that cause a crash when the network is
initialized and sysinstall is not running as init.

Submitted by: Nick Mills
Approved by: cperciva (mentor)
MFC after: 3 days
2010-06-10 20:13:10 +00:00
Roman Divacky
1fbefe1829 Remove Xcode cmake win32 projects unittests from LLVM and
clang.xcodeproj INPUTS win32 from clang.

Requested by:	jkim
Approved by:	ed (mentor)
2010-06-10 19:59:23 +00:00
Matt Jacob
8340692f44 Don't pass a buffer directly as a printflike format string.
Found by: clang
MFC after:	1 month
2010-06-10 19:38:07 +00:00
Alexander Kabaev
60743cbd22 Do not require pos parameter to be zero in MAP_ANONYMOUS mmap requests
in Linux emulation layer. Linux seems to only require that pos is
page-aligned, but otherwise ignores it. Default FreeBSD mmap parameter
checking is too strict to allow some Linux binaries to run. tsMuxeR is
one example of such a binary.

Discussed with:	jhb
MFC after:	1 week
2010-06-10 17:59:47 +00:00
Edward Tomasz Napierala
7ce513a52a Untangle g_print_bio(), silencing Coverity.
Found with:	Coverity Prevent
CID:		3566, 3567
2010-06-10 17:49:36 +00:00
Alexander Motin
ae834fc9ba Do not disable edge-triggered interrupts before migration. DELAY() with
interrupt disabled highly probable causes interrupt loss.
2010-06-10 17:04:01 +00:00
Alan Cox
ce18658792 Reduce the scope of the page queues lock and the number of
PG_REFERENCED changes in vm_pageout_object_deactivate_pages().
Simplify this function's inner loop using TAILQ_FOREACH(), and shorten
some of its overly long lines.  Update a stale comment.

Assert that PG_REFERENCED may be cleared only if the object containing
the page is locked.  Add a comment documenting this.

Assert that a caller to vm_page_requeue() holds the page queues lock,
and assert that the page is on a page queue.

Push down the page queues lock into pmap_ts_referenced() and
pmap_page_exists_quick().  (As of now, there are no longer any pmap
functions that expect to be called with the page queues lock held.)

Neither pmap_ts_referenced() nor pmap_page_exists_quick() should ever
be passed an unmanaged page.  Assert this rather than returning "0"
and "FALSE" respectively.

ARM:

Simplify pmap_page_exists_quick() by switching to TAILQ_FOREACH().

Push down the page queues lock inside of pmap_clearbit(), simplifying
pmap_clear_modify(), pmap_clear_reference(), and pmap_remove_write().
Additionally, this allows for avoiding the acquisition of the page
queues lock in some cases.

PowerPC/AIM:

moea*_page_exits_quick() and moea*_page_wired_mappings() will never be
called before pmap initialization is complete.  Therefore, the check
for moea_initialized can be eliminated.

Push down the page queues lock inside of moea*_clear_bit(),
simplifying moea*_clear_modify() and moea*_clear_reference().

The last parameter to moea*_clear_bit() is never used.  Eliminate it.

PowerPC/BookE:

Simplify mmu_booke_page_exists_quick()'s control flow.

Reviewed by:	kib@
2010-06-10 16:56:35 +00:00
Andrey V. Elsukov
6c0a2eb136 Style(9) fixes:
* Sort includes
* Replace #define<SPACE> to #define<TAB>
* Split declarations and initializations
* Split long lines

Requested by:	kib
Approved by:	kib (mentor)
MFC after:	1 month
2010-06-10 16:45:30 +00:00
Alexander Motin
1f255bd340 Store interrupt trap frame into struct thread. It allows interrupt handler
to obtain both trap frame and opaque argument submitted on registrction.
After kernel and all drivers get used to it, legacy hack can be removed.

Reviewed by:	jhb@
2010-06-10 16:14:05 +00:00
Roman Divacky
a08050302b Introduce -fformat-extensions. A local FreeBSD extension used
for additional printf modifiers in kernel.

Approved by:	ed (mentor)
2010-06-10 16:13:32 +00:00
Bjoern A. Zeeb
54e57c8145 Make the char *n_name member of struct nlist 'const'.
This avoids errors or __DECONST() from places with higher WARNS levels.

Adjust a local cache variable in ipcs to const as well
to compile in the new world order.

Suggested by:	jhb
Reviewed by:	jhb, kib, brueffer (man)
2010-06-10 14:19:51 +00:00
Ed Schouten
3e241e2e08 Disable usage of __DATE__.
This ensures that the Clang binary doesn't change checksums every time
it's built.
2010-06-10 12:15:09 +00:00
Ed Schouten
8089dccd09 Brand our Clang binary.
That way it's easier for the Clang folks to keep track of what we're
doing.
2010-06-10 12:06:35 +00:00
Ivan Voras
a401f2d098 Unconfuse THREAD and SMT flags 2010-06-10 11:48:14 +00:00
Ivan Voras
5368befb66 Cosmetic change to XML - less ugly newlines 2010-06-10 11:01:17 +00:00
Gabor Kovesdan
07f9cfc4ff - Axe out signal handling code, the shell will take care of this
Suggested by:	jilles
Approved by:	delphij (mentor)
2010-06-10 10:28:38 +00:00
Gabor Kovesdan
5349f70253 - Fix style(9)
Submitted by:	ed
Approved by:	delphij (mentor)
2010-06-10 10:17:00 +00:00
Ed Schouten
ef7186a0cf Bump __FreeBSD_version to indicate the addition of Clang to HEAD. 2010-06-10 06:48:09 +00:00
Ed Schouten
796cae776a Regenerate. 2010-06-10 06:22:10 +00:00
Ed Schouten
c58a2cf366 Fix typo.
Spotted by:	Garrett Cooper
2010-06-10 06:20:26 +00:00
Randall Stewart
41291ef07f Found by Michael. In cases where we run
out of memory (no more inp space) we don't
propely NULL the INP on return.

Obtained from:	tuexen
MFC after:	3 Days
2010-06-09 22:05:29 +00:00
Xin LI
ddaa454e6a Apply driver update from LSI. Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by:	Tom Couch <tom.couch lsi.com>
PR:		kern/147695
MFC after:	3 days
2010-06-09 21:40:38 +00:00
Ed Schouten
c3cdab8d14 Regenerate. 2010-06-09 20:20:24 +00:00
Ed Schouten
9e303702a0 This should be commented out. 2010-06-09 20:18:18 +00:00