Commit Graph

145693 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
a71f46d368 Oops. Correct comment in the LICENSE file. 2009-03-14 21:59:12 +00:00
Pawel Jakub Dawidek
2f9e552de1 Regression tests for mac_portacl(4). 2009-03-14 21:54:19 +00:00
Pawel Jakub Dawidek
a3ce3b6d35 - 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
David Schultz
b3c11b5b91 Namespace: Defining htonl() and friends here instead of arpa/inet.h is
a BSD extension.
2009-03-14 20:16:54 +00:00
David Schultz
48a3f7d9ae 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
David Schultz
ea3186bda4 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
David Schultz
1a4cc57833 Hide numerous BSD extensions in the POSIX namespace. 2009-03-14 20:04:28 +00:00
David Schultz
fb3fd8c6e9 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
David Schultz
d5ed956300 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
David Schultz
34d3ac5921 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
David Schultz
df41066d71 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
David Schultz
b38a55d49d Namespace: abort2() is a BSD extension. 2009-03-14 19:13:30 +00:00
David Schultz
32f1a59174 Namespace: endpwent, getpwent, and setpwent are XSI extensions. 2009-03-14 19:13:01 +00:00
David Schultz
44bf9512a8 Namespace: dprintf() and getline() are in P1003.1-2008. 2009-03-14 19:12:11 +00:00
David Schultz
cc4603df21 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
David Schultz
f4ab27b927 Namespace: preadv() and pwritev() are extensions. 2009-03-14 19:07:58 +00:00
David Schultz
ce76f2cfa7 Namespace: vsyslog() is a BSD extension. 2009-03-14 19:07:25 +00:00
David Schultz
7e005f0136 Namespace: semsys() and shmsys() aren't standard. 2009-03-14 19:06:52 +00:00
David Schultz
472f7812a2 Use namespace visibility macros instead of checking for _POSIX_SOURCE. 2009-03-14 19:06:07 +00:00
David Schultz
6fb888fc07 Namespace: setgrent() is an XSI extension. 2009-03-14 19:05:18 +00:00
David Schultz
c6bd0d5621 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
David Schultz
dd5185d15f Namespace: memccpy() and memchr() are XSI, and memrchr() is a BSD extension. 2009-03-14 19:03:34 +00:00
David Schultz
0338164915 Namespace: dbm_forder() and dbm_dirfno() are BSD extensions. 2009-03-14 19:02:28 +00:00
David Schultz
41f6e3e11c Namespace: _setjmp() and _longjmp() are XSI extensions. 2009-03-14 19:01:26 +00:00
David Schultz
c0f43bd241 Namespace: inet_ntoa_r() is a BSD extension. 2009-03-14 19:00:16 +00:00
David Schultz
fbaabc11ae Namespace: scalb() is withdrawn from POSIX. 2009-03-14 18:58:53 +00:00
David Schultz
4646cea766 Multibyte character support for cal(1).
PR:		131578
2009-03-14 18:55:51 +00:00
David Schultz
24863729f9 Eliminate __real__ and __imag__ gccisms. 2009-03-14 18:24:15 +00:00
Roman Divacky
300d03a832 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 Leffler
c0c9ea90a8 remove stray ; 2009-03-14 17:54:58 +00:00
Robert Watson
4020272933 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
Alan Cox
e34a906f74 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
Warner Losh
795dceffa2 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
Randall Stewart
0c0982b80c 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 Roberson
d3df4af368 - 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 Roberson
04a2868980 - 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 Roberson
53a6c8b3ac - 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
Alan Cox
3b2dc2ac52 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
Alan Cox
957939b503 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
David Schultz
d9c4315930 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
Robert Watson
49dd3b8df9 Don't suggest mounting procfs in diskless configurations.
MFC after:	3 days
2009-03-13 23:42:34 +00:00
Gabor Kovesdan
49a33c0b43 - Fix object directory creation when running threaded buildworld 2009-03-13 22:41:30 +00:00
Andrew Thompson
3f67dc0f46 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
Sam Leffler
470736a061 fix portability; linux does not have sa_len/sun_len 2009-03-13 19:05:34 +00:00
Rui Paulo
869041cd77 Fix comment explaining where this driver came from.
MFC after:	2 weeks
2009-03-13 16:43:31 +00:00
Rui Paulo
569c3c7dcd Rename the k8temp(4) man page to amdtemp(4) and update its contents for
the new families.

MFC after:	2 weeks
2009-03-13 16:42:24 +00:00
Gabor Kovesdan
7e06afcad3 - Add an entry about enabling libc NLS support 2009-03-13 16:40:56 +00:00
Dmitry Chagin
32c01de21c Implement new way of branding ELF binaries by looking to a
".note.ABI-tag" section.

The search order of a brand is changed, now first of all the
".note.ABI-tag" is looked through.

Move code which fetch osreldate for ELF binary to check_note() handler.

PR:		118473
Approved by:	kib (mentor)
2009-03-13 16:40:51 +00:00
Rui Paulo
e667034d80 Mention k8temp -> amdtemp rename.
MFC after:	2 weeks
2009-03-13 16:30:33 +00:00
Rui Paulo
454e82d77e Rename all the variables/function names/structs/etc. to reflect the
driver name change.
While there, update copyright.

MFC after:	2 weeks
2009-03-13 16:28:25 +00:00