Commit Graph

151887 Commits

Author SHA1 Message Date
David Xu
79aaab046d Remove unused macros. 2010-01-05 05:44:52 +00:00
David Xu
d802aa25d2 Don't check has_waiters twice, inline some small functions.
performance result on my machine:
	mutex     Elapsed: 902115 us; per iteration: 90 ns.
	semaphore Elapsed: 958780 us; per iteration: 95 ns.
2010-01-05 03:39:31 +00:00
David Xu
9b0f1823b5 Use umtx to implement process sharable semaphore, to make this work,
now type sema_t is a structure which can be put in a shared memory area,
and multiple processes can operate it concurrently.
User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open()
to initialize a shared semaphore.
Named semaphore uses file system and is located in /tmp directory, and its
file name is prefixed with 'SEMD', so now it is chroot or jail friendly.
In simplist cases, both for named and un-named semaphore, userland code
does not have to enter kernel to reduce/increase semaphore's count.
The semaphore is designed to be crash-safe, it means even if an application
is crashed in the middle of operating semaphore, the semaphore state is
still safely recovered by later use, there is no waiter counter maintained
by userland code.
The main semaphore code is in libc and libthr only has some necessary stubs,
this makes it possible that a non-threaded application can use semaphore
without linking to thread library.
Old semaphore implementation is kept libc to maintain binary compatibility.
The kernel ksem API is no longer used in the new implemenation.

Discussed on: threads@
2010-01-05 02:37:59 +00:00
Alexander Motin
06b215fd3a Slightly optimize XOR calculation. 2010-01-05 02:06:05 +00:00
Qing Li
ee8a75d320 An existing incomplete ARP entry would expire a subsequent
statically configured entry of the same host. This bug was
due to the expiration timer was not cancelled when installing
the static entry. Since there exist a potential race condition
with respect to timer cancellation, simply check for the
LLE_STATIC bit inside the expiration function instead of
cancelling the active timer.

MFC after:	5 days
2010-01-05 00:35:46 +00:00
Qing Li
6f1828763e The IFA_RTSELF address flag marks a loopback route has been installed
for the interface address. This marker is necessary to properly support
PPP types of links where multiple links can have the same local end
IP address. The IFA_RTSELF flag bit maps to the RTF_HOST value, which
was combined into the route flag bits during prefix installation in
IPv6. This inclusion causing the prefix route to be unusable. This
patch fixes this bug by excluding the IFA_RTSELF flag during route
installation.

MFC after:	5 days
2010-01-04 23:39:53 +00:00
Christian Brueffer
6b05959af0 Add a missing word.
PR:		140989
Submitted by:	Lachlan Kang
MFC after:	1 week
2010-01-04 22:23:09 +00:00
Christian Brueffer
37d3a10d84 Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
almost three years ago in r166794.

PR:		140989
Submitted by:	Lachlan Kang
MFC after:	1 week
2010-01-04 22:22:00 +00:00
Warner Losh
56eff2143f Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
Ed Schouten
328d9d2c96 Make TIOCSTI work again.
It looks like I didn't implement this when I imported MPSAFE TTY.
Applications like mail(1) still use this. I think it's conceptually bad.

Tested by:	Pete French <petefrench ticketswitch com>
MFC after:	2 weeks
2010-01-04 20:59:52 +00:00
Luigi Rizzo
7173b6e554 Various cleanup done in ipfw3-head branch including:
- use a uniform mtag format for all packets that exit and re-enter
  the firewall in the middle of a rulechain. On reentry, all tags
  containing reinject info are renamed to MTAG_IPFW_RULE so the
  processing is simpler.

- make ipfw and dummynet use ip_len and ip_off in network format
  everywhere. Conversion is done only once instead of tracking
  the format in every place.

- use a macro FREE_PKT to dispose of mbufs. This eases portability.

On passing i also removed a few typos, staticise or localise variables,
remove useless declarations and other minor things.

Overall the code shrinks a bit and is hopefully more readable.

I have tested functionality for all but ng_ipfw and if_bridge/if_ethersubr.
For ng_ipfw i am actually waiting for feedback from glebius@ because
we might have some small changes to make.
For if_bridge and if_ethersubr feedback would be welcome
(there are still some redundant parts in these two modules that
I would like to remove, but first i need to check functionality).
2010-01-04 19:01:22 +00:00
David E. O'Brien
290dac20e6 Add ability to search up the directory hierarchy for the system directory.
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable.

Reviewed by:	<sjg@NetBSD.org>
Obtained from:	NetBSD (+ embellishment by me, sent back to NetBSD)
2010-01-04 18:57:22 +00:00
Ed Schouten
f40ea8b948 This should read #if __BSD_VISIBLE instead of #ifdef __BSD_VISIBLE. 2010-01-04 18:46:54 +00:00
Michael Tuexen
f5366806c6 Correct usage of parenthesis.
PR:	kern/142066
Approved by: rrs (mentor)
Obtained from: Henning Petersen, Bruce Cran.
MFC after: 2 weeks
2010-01-04 18:25:38 +00:00
John Baldwin
fe0a838459 Expose the upper 256 ptys in the default devfs rules. I should have updated
this when expanding the old pty(4) driver to use 512 ptys by default.  This
is more important for 7.x.

MFC after:	1 week
2010-01-04 18:21:27 +00:00
Ed Schouten
24cb3af593 Unbreak bootparamd when setting WITHOUT_NIS.
Submitted by:	bf1783 googlemail com
2010-01-04 18:08:16 +00:00
Xin LI
f3f0a6c957 Test index value is within the range before using it to reference
array member.

PR:		bin/141838
Submitted by:	Henning Petersen <henning.petersen@t-online.de>
MFC after:	2 weeks
2010-01-04 18:04:36 +00:00
Benedict Reuschling
ed08572c09 Now that I'm free from mentorship, it's only fair to document who
my mentor was.
2010-01-04 15:50:41 +00:00
Konstantin Belousov
181d0b5dab Bump __FreeBSD_version for scandir(3) and alphasort(3) prototype changes. 2010-01-04 15:41:16 +00:00
Konstantin Belousov
4176dd5267 Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions,
so we better follow too (older glibc used old BSDish alphasort prototype
and corresponding type of the comparision function for scandir). While
there, change the definitions of the functions to ANSI C and fix several
style issues nearby.

Remove requirement for "sys/types.h" include for functions from manpage.

POSIX also requires that alphasort(3) sorts as if strcoll(3) was used,
but leave the strcmp(3) call in the function for now.

Adapt in-tree callers of scandir(3) to new declaration. The fact that
select_sections() from catman(1) could modify supplied struct dirent is
a bug.

PR:	standards/142255
MFC after:	2 weeks
2010-01-04 15:40:17 +00:00
Konstantin Belousov
ed12757873 PG_NOSYNC is called VPO_NOSYNC for long time.
MFC after:	3 days
2010-01-04 14:58:41 +00:00
Edward Tomasz Napierala
922ec47140 Fix comments. 2010-01-04 12:39:42 +00:00
David E. O'Brien
19d43a4c5f Fix formatting. 2010-01-04 11:11:37 +00:00
David E. O'Brien
107994f781 There are actually 129 tests here. 2010-01-04 11:00:12 +00:00
David E. O'Brien
adcda09cbc Catch up with UNIX98-style PTY's. 2010-01-04 10:59:14 +00:00
David E. O'Brien
41f83263a5 'prove -r' isn't as smart as grog thought. 2010-01-04 10:58:08 +00:00
David E. O'Brien
2a546db853 Committed the wrong version in r201484. This time really fix the "-t"
functionality.  Per the regression tests (pgrep-t.t & pkill-t.t), "-t"
should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.
2010-01-04 10:50:17 +00:00
David E. O'Brien
39a60cbcab Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t),
"-t" should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.
2010-01-04 10:37:07 +00:00
David E. O'Brien
72cef5b74f You need to be root to run this test. 2010-01-04 09:59:18 +00:00
David E. O'Brien
cd8b25c92c Also cleanup after the test run. 2010-01-04 09:57:00 +00:00
David E. O'Brien
01d217bcc1 Don't process 'lastcomm' if "AUTOMATED" is defined.
The tests for it require manual setup.
2010-01-04 09:54:24 +00:00
David E. O'Brien
8dcfd5d1d6 It is expected these are chmod +x. 2010-01-04 09:50:30 +00:00
David E. O'Brien
faddcb5783 Regression test for r201456. 2010-01-04 09:49:23 +00:00
Stanislav Sedov
8d7446f925 - Add two particulary interesting quotes from the past decade. 2010-01-04 09:16:35 +00:00
David Xu
79f8b61995 Add user-level semaphore synchronous type, this change allows multiple
processes to share semaphore by using shared memory area, in simplest case,
only one atomic operation is needed in userland, waiter flag is maintained by
kernel and userland only checks the flag, if the flag is set, user code enters
kernel and does a wakeup() call.
Move type definitions into file _umtx.h to minimize compiling time.
Also type names need to be prefixed with underline character, this would reduce
name conflict (still in progress).
2010-01-04 05:27:49 +00:00
Rui Paulo
16ffe04c2f Remove CNS11XXNAS.hints. 2010-01-04 03:40:46 +00:00
Rui Paulo
381a19cce0 Add support for Cavium Econa CNS11XX ARM boards. These boards were
previously know by StarSemi STR9104.

Tested by the submitter on an Emprex NSD-100 board.

Submitted by:	Yohanes Nugroho <yohanes at gmail.com>
Reviewed by:	freebsd-arm, stas
Obtained from:	//depot/projects/str91xx/...
2010-01-04 03:35:45 +00:00
David E. O'Brien
bfc4c0cf08 Report lines that ought to contain a ':' operator but start with a '.'
as "Unknown directive" sinze they are more likely to be .elseif (etc).
(NetBSD PR 37222).

Obtained from:	NetBSD
2010-01-04 00:49:04 +00:00
David E. O'Brien
6100e6c2c9 Add check for subversion "original" marker. 2010-01-04 00:32:22 +00:00
Warner Losh
f29b8b7f41 cardbus -> CardBus 2010-01-03 23:31:58 +00:00
Warner Losh
f33a1c1621 cardbus -> CardBus 2010-01-03 23:29:49 +00:00
Warner Losh
afa45c0763 cardbus -> CardBus 2010-01-03 23:28:32 +00:00
Warner Losh
cba55405e1 CardBus instead of cardbus. 2010-01-03 23:26:29 +00:00
Warner Losh
a2d61e43c2 Fix CardBus spelling.
MFC after:	1 month
2010-01-03 23:15:14 +00:00
Antoine Brodin
b8cf11192e Complete ntptrace(8) removal:
- do not install man page
- update ObsoleteFiles.inc

Approved by:	roberto@
2010-01-03 22:29:06 +00:00
Pyun YongHyeon
4f4a16e152 Fix regression introduced in r198318. BCM5754/BCM5754M uses the
same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
firmware to enable TSO and bge(4) does not support firmware based
TSO.

Reported by:	ed
Tested by:	ed
2010-01-03 21:49:24 +00:00
Gavin Atkinson
4c40efa74a Forced commit, to provide correct commit message for r201440:
Don't complain when we encounter the "cache" source, it's valid.  Also fix
the error message to include a line feed and not include a stray comma.

PR:		bin/121671
Submitted by:	Artis Caune  artis.caune gmail.com
Approved by:	ed (mentor)
MFC after:	2 weeks

While here, change "> /dev/stderr" for more usual ">&2"

Submitted by:	jilles
2010-01-03 21:27:10 +00:00
Brooks Davis
2f70892f19 The size of credential messages is limited by CMGROUP_MAX rather than
NGROUPS.

MFC after:	1 week
2010-01-03 20:45:49 +00:00
Brooks Davis
9efde58392 Add vlan(4) to all GENERIC kernels.
MFC after:	1 week
2010-01-03 20:40:54 +00:00
Rick Macklem
3968293472 The test for "same client" for the experimental nfs server over NFSv4
was broken w.r.t. byte range lock conflicts when it was the same client
and the request used the open_to_lock_owner4 case, since lckstp->ls_clp
was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp".

MFC after:	2 weeks
2010-01-03 20:08:10 +00:00