Commit Graph

171172 Commits

Author SHA1 Message Date
Alan Cox
90407113a7 Update a couple comments to reflect r235598.
X-MFC after:	r235598
2012-06-14 17:47:54 +00:00
Alan Cox
62657c50df Correctly identify the function in a KASSERT().
MFC after:	3 days
2012-06-14 17:40:49 +00:00
Pawel Jakub Dawidek
a79de683f5 Update comment.
MFC after:	1 month
2012-06-14 17:32:58 +00:00
Pawel Jakub Dawidek
19a8f6748e Remove fdtofp() function and use fget_locked(), which works exactly the same.
MFC after:	1 month
2012-06-14 16:25:10 +00:00
Pawel Jakub Dawidek
7a4981c1f6 Explicitly assert that the filedesc lock is held when the fget_locked()
function is called.

MFC after:	1 month
2012-06-14 16:24:03 +00:00
Pawel Jakub Dawidek
b7fc69ca89 Assert that the filedesc lock is being held when the fdunwrap() function
is called.

MFC after:	1 month
2012-06-14 16:23:16 +00:00
Hans Petter Selasky
271e5fb00d Add more quirks for USB MIDI adapters.
Obtained from:	Clemens Ladisch
MFC after:	1 week
2012-06-14 16:20:19 +00:00
Pawel Jakub Dawidek
1a94dc8581 Simplify the code by making more use of the fdtofp() function.
MFC after:	1 month
2012-06-14 15:37:15 +00:00
Pawel Jakub Dawidek
215aeba939 - Assert that the filedesc lock is being held when fdisused() is called.
- Fix white spaces.

MFC after:	1 month
2012-06-14 15:35:14 +00:00
Pawel Jakub Dawidek
7aef754274 Style fixes and assertions improvements.
MFC after:	1 month
2012-06-14 15:34:10 +00:00
Pawel Jakub Dawidek
8d169d9ff0 Assert that the filedesc lock is not held when closef() is called.
MFC after:	1 month
2012-06-14 15:26:23 +00:00
Pawel Jakub Dawidek
d4cede6e98 Add FILEDESC_UNLOCK_ASSERT() macro which asserts that the filedesc is not
being held by the current thread (at least exclusively).

MFC after:	1 month
2012-06-14 15:24:45 +00:00
Pawel Jakub Dawidek
ee142bc754 Explicitly check if 'fd' is less than 0 instead of using cast-to-unsinged hack.
MFC after:	1 month
2012-06-14 15:23:51 +00:00
Pawel Jakub Dawidek
eb273c01f3 Style fixes.
Reported by:	bde
MFC after:	1 month
2012-06-14 15:21:57 +00:00
Warner Losh
a6c5f82686 Defines for parsing linux ATAGs lists. 2012-06-14 14:38:55 +00:00
Pawel Jakub Dawidek
c7e9a659ca Remove code duplication from fdclosexec(), which was the reason of the bug
fixed in r237065.

MFC after:	1 month
2012-06-14 12:43:37 +00:00
Pawel Jakub Dawidek
8f59e9fddc When we are closing capabilities during exec, we want to call mq_fdclose()
on the underlying object and not on the capability itself.

Similar bug was fixed in r236853.

MFC after:	1 month
2012-06-14 12:41:21 +00:00
Pawel Jakub Dawidek
5570ae7d87 Style.
MFC after:	1 month
2012-06-14 12:37:41 +00:00
Konstantin Belousov
61235d9e01 Make sure that fstab fd is not leaked on exec.
PR:  kern/169023
Submitted by:	Jukka Ukkonen <jau iki fi>
MFC after:	1 week
2012-06-14 12:28:43 +00:00
Konstantin Belousov
e474e51e07 Eliminate the static buffer used to read the first page of the mapped
object, and eliminate the pread(2) call as well [1]. Mmap the first
page of the object temporaly, and unmap it on error or last use.
Potentially, this leaves one-page gap between succeeding dlopen(3),
but there are other mmap(2) consumers as well.

Fix several cases were the whole mapping of the object leaked on error.

Use MAP_PREFAULT_READ for mmap(2) calls which map real object pages [2].

Insipired by the patch by:	Ian Lepore <freebsd damnhippie dyndns org> [1]
Suggested by:	alc [2]
MFC after:	2 weeks
2012-06-14 11:20:22 +00:00
Andrey V. Elsukov
d4746e107f Always reconstruct partition entries in the PMBR when Boot Camp is
disabled. This helps to easily recover from situations when PMBR is
damaged and contains no entries.

MFC after:	1 week
2012-06-14 11:17:54 +00:00
Michael Tuexen
f30ac43257 Pass flowid explicitly through the stack instead of taking it from
the mbuf chain at different places.
While there: Fix several bugs related to VRFs.

MFC after: 3 days
2012-06-14 06:54:48 +00:00
Adrian Chadd
956ac958bf Shrink ath_buf a little more:
* Resize some types.  In particular, bfs_seqno can be uint16_t for now.
  Previous work would assign the unassigned seqno a value of -1, which
  I obviously can't do here.

* Remove bfs_pktdur.  It was in the original code but nothing so far uses
  it.

This gets ath_buf down (on my i386 system) to 292 bytes from 300 bytes.
I'd rather it be much, much smaller.
2012-06-14 04:24:13 +00:00
Warner Losh
3590dad094 More Linux boot support. Create arm_dump_avail_init() to initialize
this array either from Linux boot data, when enabled, or in the
typical way that most ports do it.  arm_pyhs_avail_init is coming
soon since it must be a separate function.
2012-06-14 04:18:56 +00:00
Warner Losh
38ac33aa84 Add support for parsing Linux ATAGs such as you'd see from uboot or
redboot.  Support is very preiminary and likely needs some work. Also,
do some minor code shuffling of the FreeBSD /boot/loader metadata
parsing code.  This code is preliminary and should be used with
caution.
2012-06-14 04:16:16 +00:00
Adrian Chadd
3b324f5772 Disable BGSCAN for 802.11n for now. Until scanning during traffic is
fixed for 802.11n TX, this needs to be disabled or users wlil see randomly
hanging aggregation sessions.

Whilst I'm here, remove the warning about 802.11n being full of dragons.
It's nowhere near that scary now.
2012-06-14 04:14:06 +00:00
Warner Losh
0bb13a26f0 Create default_parse_boot_param which, if FreeBSD /boot/loader support
is enabled, sets values based on the metadata passed in.  Otherwise
fake_preload_metadata is called.  Change the default parse_boot_param
to default_parse_boot_param.  Enable this functionality only on the mv
platform, which is where most of the code is from.

Reviewed by:	cognet, Ian Lapore
2012-06-14 04:09:20 +00:00
Adrian Chadd
447fd44a6f Disable this warning debug for now, as I'm now aware of the particular
situation where it's occuring.

Whilst I'm here, flesh out a more descriptive description.
2012-06-14 04:01:25 +00:00
Warner Losh
d39655d7a4 Modify all the arm platform files to call parse_boot_param passing in
the boot parameters from initarm first thing.  parse_boot_param parses
the boot arguments and converts them to the /boot/loader metadata the
rest of the kernel uses.  parse_boot_param is a weak alias to
fake_preload_metadata, which all the platforms use now, but may become
more extensive in the future.

Since it is a weak symbol, specific boards may define their own
parse_boot_param to interface to custom boot loaders.

Reviewed by:	cognet@, Ian Lapore
2012-06-14 04:00:30 +00:00
Tim Kientzle
ed1589b9b7 __flt_rounds is a public symbol (expands from the FLT_ROUNDS macro),
so include it in the public namespace on arm just as with
other architectures.

This corrects r236816.

Submitted by:	Jan Sieka
MFC after:	1 week
2012-06-14 03:27:01 +00:00
Adrian Chadd
23ced6c117 Implement a global (all non-mgmt traffic) TX ath_buf limitation when
ath_start() is called.

This (defaults to 10 frames) gives for a little headway in the TX ath_buf
allocation, so buffer cloning is still possible.

This requires a lot omre experimenting and tuning.

It also doesn't stop a node/TID from consuming all of the available
ath_buf's, especially when the node is going through high packet loss
or only talking at a low TX rate.  It also doesn't stop a paused TID
from taking all of the ath_bufs.  I'll look at fixing that up in subsequent
commits.

PR:	kern/168170
2012-06-14 00:51:53 +00:00
Jung-uk Kim
6ad799103d - Remove unused code for CR3 and CR4.
- Fix few style(9) nits while I am here.
2012-06-13 22:53:56 +00:00
Pawel Jakub Dawidek
620216725a When checking if file descriptor number is valid, explicitely check for 'fd'
being less than 0 instead of using cast-to-unsigned hack.

Today's commit was brought to you by the letters 'B', 'D' and 'E' :)
2012-06-13 22:12:10 +00:00
Jilles Tjoelker
eb55578582 find(1): Move description of -d option to -depth primary.
The nullary -depth primary is standard and the -d option provides little
advantage.

PR:		docs/168885
MFC after:	1 week
2012-06-13 21:53:40 +00:00
Pawel Jakub Dawidek
7080f124d2 Now that dupfdopen() doesn't depend on finstall() being called earlier,
indx will never be -1 on error, as none of dupfdopen(), finstall() and
kern_capwrap() modifies it on error, but what is more important none of
those functions install and leave file at indx descriptor on error.

Leave an assert to prove my words.

MFC after:	1 month
2012-06-13 21:38:07 +00:00
Pawel Jakub Dawidek
3812dcd3de Allocate descriptor number in dupfdopen() itself instead of depending on
the caller using finstall().
This saves us the filedesc lock/unlock cycle, fhold()/fdrop() cycle and closes
a race between finstall() and dupfdopen().

MFC after:	1 month
2012-06-13 21:32:35 +00:00
Pawel Jakub Dawidek
7f35af0110 - Remove nfp variable that is not really needed.
- Update comment.
- Style nits.

MFC after:	1 month
2012-06-13 21:22:35 +00:00
Pawel Jakub Dawidek
c64dd3bae1 Remove duplicated code.
MFC after:	1 month
2012-06-13 21:15:01 +00:00
Pawel Jakub Dawidek
81424ab705 Add missing {.
MFC after:	1 month
2012-06-13 21:13:18 +00:00
Pawel Jakub Dawidek
85c1550d63 Style.
MFC after:	1 month
2012-06-13 21:11:58 +00:00
Pawel Jakub Dawidek
baf946221d There is no need to set td->td_retval[0] to -1 on error.
Confirmed by:	jhb
MFC after:	1 month
2012-06-13 21:10:00 +00:00
Jung-uk Kim
acd7df97cc - Fix resumectx() prototypes to reflect reality.
- For i386, simply jump to resumectx() with PCB in %ecx.
- Fix a style(9) nit while I am here.
2012-06-13 21:03:01 +00:00
Jung-uk Kim
455b486e6b Add a convenience macro for the fastcall attribute.
MFC after:	2 weeks
2012-06-13 20:41:45 +00:00
Pedro F. Giffuni
a6c34d9e26 Revert r236962 - Experimental amdfam10/barcelona support.
The patches are unexpectedly causing gcc to fail while
building ports/graphics/ImageMagick even when the cpu
flags are not used.

Reported by:	Andreas Tobler
2012-06-13 20:21:08 +00:00
Joel Dahl
ea1dbd78a3 Sync example file with mdoc changes made in rev 235450. 2012-06-13 19:08:00 +00:00
Pawel Jakub Dawidek
6195bfebcc There is only one caller of the dupfdopen() function, so we can simplify
it a bit:
- We can assert that only ENODEV and ENXIO errors are passed instead of
  handling other errors.
- The caller always call finstall() for indx descriptor, so we can assume
  it is set. Actually the filedesc lock is dropped between finstall() and
  dupfdopen(), so there is a window there for another thread to close the
  indx descriptor, but it will be closed in next commit.

Reviewed by:	mjg
MFC after:	1 month
2012-06-13 19:00:29 +00:00
Joel Dahl
6ae742a549 mdoc: avoid nested displays. Fixes mandoc warnings. 2012-06-13 18:57:27 +00:00
Mateusz Guzik
2ca63f0a90 Remove 'low' argument from fd_last_used().
This function is static and the only caller always passes 0 as low.

While here update note about return values in comment.

Reviewed by:	pjd
Approved by:	trasz (mentor)
MFC after:	1 month
2012-06-13 17:18:16 +00:00
Mateusz Guzik
02efb9a8b1 Re-apply reverted parts of r236935 by pjd with some changes.
If fdalloc() decides to grow fdtable it does it once and at most doubles
the size. This still may be not enough for sufficiently large fd. Use fd
in calculations of new size in order to fix this.

When growing the table, fd is already equal to first free descriptor >= minfd,
also fdgrowtable() no longer drops the filedesc lock. As a result of this there
is no need to retry allocation nor lookup.

Fix description of fd_first_free to note all return values.

In co-operation with:	pjd
Approved by:	trasz (mentor)
MFC after:	1 month
2012-06-13 17:12:53 +00:00
Dag-Erling Smørgrav
da9c39045a Also remove /usr/share/examples/etc/auth.conf, which I didn't even
realize existed.

Noticed by:	Andrey Zonov <andrey@zonov.org>
MFC after:	3 weeks
2012-06-13 16:40:47 +00:00