Commit Graph

154963 Commits

Author SHA1 Message Date
jeff
ee1ec823f6 - Implement a new mechanism for resetting lock profiling. We now
guarantee that all cpus have acknowledged the cleared enable int by
   scheduling the resetting thread on each cpu in succession.  Since all
   lock profiling happens within a critical section this guarantees that
   all cpus have left lock profiling before we clear the datastructures.
 - Assert that the per-thread queue of locks lock profiling is aware of
   is clear on thread exit.  There were several cases where this was not
   true that slows lock profiling and leaks information.
 - Remove all objects from all lists before clearing any per-cpu
   information in reset.  Lock profiling objects can migrate between
   per-cpu caches and previously these migrated objects could be zero'd
   before they'd been removed

Discussed with:	attilio
Sponsored by:	Nokia
2009-03-15 06:41:47 +00:00
imp
1799153106 Don't adjust ranges at all for subtractive bridges. The simple-minded
stuff we're doing is too simple-minded, so back it out for now.
2009-03-15 06:40:57 +00:00
imp
f178c1baa6 Generalize the workaround for the Hitachi HT-4840-11. The Contec
C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it
matches pc98 machines, so maybe it was a flag for pc98 operation) as
well as a memory map.  Since this driver doesn't know how to cope, we
start with cfe2, which is purely an I/O space mapped and that seems to
make it work.  I say 'seems' here, because the card I have doesn't
seem to have the right dongle for full testing...
2009-03-15 02:31:34 +00:00
sam
68e7f74c45 no need to for gnu89 any more 2009-03-15 01:39:16 +00:00
sam
05a3fc25cf remove gcc-ism; tsinfo isn't used anyway 2009-03-15 01:38:37 +00:00
rrs
723e44888d Opps.. I missed a file on the commit :-) 2009-03-14 23:13:16 +00:00
das
6335284962 Fix build breakage due to the interplay between r189801 and r189824.
In particular, vendor sources that aren't ready for gnu99 should
still be compiled with gnu89. (Before r189824, these would have
generated warnings if you tried to compile them in gnu99 mode,
but the warnings went unheeded due to -Wno-error.)
2009-03-14 22:50:03 +00:00
pjd
8e6c20cc53 Oops. Correct comment in the LICENSE file. 2009-03-14 21:59:12 +00:00
pjd
7b829d245e Regression tests for mac_portacl(4). 2009-03-14 21:54:19 +00:00
pjd
b67aabcdf8 - Correct logic in if statement - we want to allocate temporary buffer
when someone is passing new rules, not when he only want to read them.
  Because of this bug, even if the given rules were incorrect, they
  ended up in rule_string.
- Add missing protection for rule_string when coping it.

Reviewed by:	rwatson
MFC after:	1 week
2009-03-14 20:40:06 +00:00
das
58fce43140 Namespace: Defining htonl() and friends here instead of arpa/inet.h is
a BSD extension.
2009-03-14 20:16:54 +00:00
das
964bf49d5b Fix the visibility of several prototypes. Also move pthread_kill() and
pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
since they're already in signal.h on other systems, and the FreeBSD
manpage says that both pthread.h and signal.h need to be included to
get these functions.

Add a hack to declare pthread_t in the P1003.1-2008 namespace
in signal.h.
2009-03-14 20:10:14 +00:00
das
cb6ddc029f Hide dbopen() in the POSIX namespace, and use standard type names
throughout so that this compiles in strict POSIX mode.
2009-03-14 20:05:27 +00:00
das
835b4065de Hide numerous BSD extensions in the POSIX namespace. 2009-03-14 20:04:28 +00:00
das
8283ef5f39 Bump __FreeBSD_version to 800071 for gcc patch to add support for C99
inline functions in c99 and gnu99 mode.
2009-03-14 19:44:13 +00:00
das
c7efb5498d Make gcc use C99 inline semantics in c99 and gnu99 mode. This was the
original intent, but the functionality wasn't implemented until after
gcc 4.2 was released. However, if you compiled a program that would
behave differently before and after this change, gcc 4.2 would have
warned you; hence, everything currently in the base system is
unaffected by this change.  This patch also adds additional warnings
about certain inline function-related bogosity, e.g., using a
static non-const local variable in an inline function.

These changes were merged from a snapshot of gcc mainline from March
2007, prior to the GPLv3 switch. I then ran the regression test suite
from a more recent gcc snapshot and fixed the important bugs it found.
I also squelched the following warning unless -pedantic is specified:

    foo is static but used in inline function bar which is not static

This is consistent with LLVM's behavior, but not consistent with gcc 4.3.

Reviewed by:	arch@
2009-03-14 19:36:13 +00:00
das
32a758b569 Namespace: aio_waitcomplete() is a BSD extension.
Also, don't pollute the namespace by including <sys/time.h>.
2009-03-14 19:17:00 +00:00
das
688bdd6550 Namespace: adjtime(), futimes(), futimesat(), lutimes(), and settimeofday()
are BSD extensions.

Also include <sys/select.h> in user code, since this header is
also supposed to define most of the symbols there.
2009-03-14 19:15:13 +00:00
das
f29890082d Namespace: abort2() is a BSD extension. 2009-03-14 19:13:30 +00:00
das
3dd54fea1a Namespace: endpwent, getpwent, and setpwent are XSI extensions. 2009-03-14 19:13:01 +00:00
das
bd350bd650 Namespace: dprintf() and getline() are in P1003.1-2008. 2009-03-14 19:12:11 +00:00
das
123dfb8ef4 Various namespace cleanups, including exposing fchmod() and fchmodat()
in the POSIX namespace, and hiding eaccess() and setproctitle().
Also move mknodat() from unistd.h to sys/stat.h where it belongs.
The *at() syscalls are only in CURRENT, so this shouldn't cause
problems.
2009-03-14 19:11:08 +00:00
das
3565cac408 Namespace: preadv() and pwritev() are extensions. 2009-03-14 19:07:58 +00:00
das
f377e31275 Namespace: vsyslog() is a BSD extension. 2009-03-14 19:07:25 +00:00
das
4c7ce11b87 Namespace: semsys() and shmsys() aren't standard. 2009-03-14 19:06:52 +00:00
das
e63fa4cfab Use namespace visibility macros instead of checking for _POSIX_SOURCE. 2009-03-14 19:06:07 +00:00
das
f960eed87b Namespace: setgrent() is an XSI extension. 2009-03-14 19:05:18 +00:00
das
c3f4135f0e Don't prototype _tolower() and _toupper(). They're not supposed to be
functions, and there's no implementation of them in any case.
2009-03-14 19:04:24 +00:00
das
fc0485a9c4 Namespace: memccpy() and memchr() are XSI, and memrchr() is a BSD extension. 2009-03-14 19:03:34 +00:00
das
247bcb9be4 Namespace: dbm_forder() and dbm_dirfno() are BSD extensions. 2009-03-14 19:02:28 +00:00
das
6c8e20c204 Namespace: _setjmp() and _longjmp() are XSI extensions. 2009-03-14 19:01:26 +00:00
das
3e837f82b3 Namespace: inet_ntoa_r() is a BSD extension. 2009-03-14 19:00:16 +00:00
das
78607e9faf Namespace: scalb() is withdrawn from POSIX. 2009-03-14 18:58:53 +00:00
das
fbe19d09d8 Multibyte character support for cal(1).
PR:		131578
2009-03-14 18:55:51 +00:00
das
fa12b26b66 Eliminate __real__ and __imag__ gccisms. 2009-03-14 18:24:15 +00:00
rdivacky
4cd01fc223 Switch over to gnu99 compilation on default for userland.
Tested by:	make universe
Tested by:	ports exp build (done by pav)
Reviewed by:	ru
Reviewed by:	silence on arch
Approved by:	ed (mentor)
2009-03-14 17:55:16 +00:00
sam
9dac23d7ae remove stray ; 2009-03-14 17:54:58 +00:00
rwatson
874a1578bb Rework MAC Framework synchronization in a number of ways in order to
improve performance:

- Eliminate custom reference count and condition variable to monitor
  threads entering the framework, as this had both significant overhead
  and behaved badly in the face of contention.

- Replace reference count with two locks: an rwlock and an sx lock,
  which will be read-acquired by threads entering the framework
  depending on whether a give policy entry point is permitted to sleep
  or not.

- Replace previous mutex locking of the reference count for exclusive
  access with write acquiring of both the policy list sx and rw locks,
  which occurs only when policies are attached or detached.

- Do a lockless read of the dynamic policy list head before acquiring
  any locks in order to reduce overhead when no dynamic policies are
  loaded; this a race we can afford to lose.

- For every policy entry point invocation, decide whether sleeping is
  permitted, and if not, use a _NOSLEEP() variant of the composition
  macros, which will use the rwlock instead of the sxlock.  In some
  cases, we decide which to use based on allocation flags passed to the
  MAC Framework entry point.

As with the move to rwlocks/rmlocks in pfil, this may trigger witness
warnings, but these should (generally) be false positives as all
acquisition of the locks is for read with two very narrow exceptions
for policy load/unload, and those code blocks should never acquire
other locks.

Sponsored by:	Google, Inc.
Obtained from:	TrustedBSD Project
Discussed with:	csjp (idea, not specific patch)
2009-03-14 16:06:06 +00:00
alc
7f1b26ac0c MFamd64 r189785
Update the pmap's resident page count when a page table page is freed in
  pmap_remove_pde() and pmap_remove_pages().

MFC after:	6 weeks
2009-03-14 15:37:19 +00:00
imp
7bee476191 Two fixes:
(1) Fix pcib_read/write_config prototypes.
(2) When contrainting a resource request for a 'subtractive' bridge,
    it is important to select a range outside the base/limit
    registers, since those are the only values known to not
    possibly work.  On my HP laptop, the base bridge excludes I/O
    ports 0xa000-0xafff, however that was the range we were passing
    up the tree.  Instead, when a range spans the "hole" we now
    arbitrarily pick the range just above the hole to allocate from.

All of my rl and xl cards, at a minimum, started working again on this
laptop with those fixes.
2009-03-14 14:08:53 +00:00
rrs
f25b21ac98 Fixes several PR-SCTP releated bugs.
- When sending large PR-SCTP messages over a
   lossy link we would incorrectly calculate the fwd-tsn
 - When receiving large multipart pr-sctp packets we would
   incorrectly send back a SACK that would renege improperly
   on already received packets thus causing unneeded retransmissions.
2009-03-14 13:42:13 +00:00
jeff
7cd47702cc - When a mutex is destroyed while locked we need to inform lock profiling
that it has been released.
2009-03-14 11:43:38 +00:00
jeff
4e3c0111d8 - Call lock_profile_release when we're transitioning a lock to be owned by
LK_KERNPROC.

Discussed with:		attilio
2009-03-14 11:43:02 +00:00
jeff
96eaa9ff52 - Fix an error that occurs when mp_ncpu is an odd number. steal_thresh
is calculated as 0 which causes errors elsewhere.

Submitted by:	KOIE Hidetaka <koie@suri.co.jp>

 - When sched_affinity() is called with a thread that is not curthread we
   need to handle the ON_RUNQ() case by adding the thread to the correct
   run queue.

Submitted by:	Justin Teller <justin.teller@gmail.com>

MFC after:	1 Week
2009-03-14 11:41:36 +00:00
alc
69680f169c Update the pmap's resident page count when a page table page is freed in
pmap_remove_pde() and pmap_remove_pages().

MFC after:	6 weeks
2009-03-14 08:28:02 +00:00
alc
72d28b3f41 Correct accounting errors in _pmap_allocpte(). Specifically, the pmap's
resident page count and the global wired page count were not correctly
maintained when page table page allocation failed.

MFC after:	6 weeks
2009-03-14 05:33:09 +00:00
das
08eb82238e r189349 removed mktemp() from the XSI namespace when
__XOPEN_SOURCE >= 700, since mktemp() was withdrawn
from the standard. However, __XSI_VISIBLE is set to
700 in the default BSD envrionment, where mktemp()
should still exist; hence, check for this.
2009-03-14 02:31:48 +00:00
rwatson
ec2ea05f80 Don't suggest mounting procfs in diskless configurations.
MFC after:	3 days
2009-03-13 23:42:34 +00:00
gabor
2bf7071f66 - Fix object directory creation when running threaded buildworld 2009-03-13 22:41:30 +00:00
thompsa
8a46d7d800 HID usage minimum can be equal to the maximum.
Submitted by:	Hans Petter Selasky
Tested by:	Andreas Tobler
2009-03-13 22:28:37 +00:00