John Baldwin [Wed, 1 Oct 2008 19:14:05 +0000 (19:14 +0000)]
Wait until after dropping the receive socket buffer lock to allocate space
to store the socket address stored in the first mbuf in a packet chain.
This reduces contention on the lock and CPU system time in certain UDP
workloads.
Ed Schouten [Wed, 1 Oct 2008 17:41:41 +0000 (17:41 +0000)]
Remove function prototypes of nonexistent TTY functions.
It turns out I overlooked some function prototypes that were actually
TTY related, but were stored in <sys/conf.h> to implement the D_TTY
flag. Remove these prototypes now that they don't exist anymore.
Ulf Lilleengen [Wed, 1 Oct 2008 14:50:36 +0000 (14:50 +0000)]
- Make gvinum header on-disk structure consistent on all platforms by storing
the gvinum header in fields of fixed size and in a big endian byte order
rather than the size and byte order of the actual platform.
Note that the change is backwards compatible with the old gvinum configuration
format, but will save the configuration in the new format when the 'saveconfig'
command is executed.
Submitted by: Rick C. Petty <rick-freebsd -at- kiwi-computer.com>
Robert Watson [Wed, 1 Oct 2008 13:26:52 +0000 (13:26 +0000)]
Various cleanups for soreceive_dgram():
- Update or remove comments that were left over from the original
soreceive_generic() implementation. Quite a few were misleading in the
context of the new code.
- Since soreceive_dgram() has a simpler structure, replace several gotos
with a while loop making the invariants more clear.
- In the blocking while loop, don't try to handle cases incompatible with
the loop invariant (since m is always NULL, don't check for and handle
non-NULL).
- Don't drop and re-acquire the socket buffer lock unnecessarily after
sbwait() returns, which may help reduce lock contention (etc).
- Assume PR_ATOMIC since we assert it at the top of the function.
Warner Losh [Wed, 1 Oct 2008 05:47:17 +0000 (05:47 +0000)]
Remove critical_enter() and critical_exit(): pmap_growkernel is called
with kernel_map->system_mtx held so these aren't needed. Add an
assertion to make sure this is the case.
Refactor vm_fault_hold_user_pages:
- simplify page hold logic
- allow pages for processes other than that of curthread to
have pages held
- normalize the interface to more closely resemble the functions in
sys/vm
Ed Schouten [Tue, 30 Sep 2008 17:30:39 +0000 (17:30 +0000)]
Improve the `pkill -t' handling, which I changed in my previous commit.
In my previous commit I disabled pkill(1)'s automatic prepending of the
"tty" string when `pkill -t' was being used. Re-enable it and stat()
both possible device names when called.
Do not mangle if_oerrors of the underlying interface. This counter
belongs solely to the driver.
We don't lose any statistics with this change, because in a error
case the drop counter on the interface output queue is always incremented.
Add unistd.h to the getosreldate(3) manpage.
Update referenced example to include unistd.h per manpage.
Update example to be more style(9)-ish, silence warnings and add
FreeBSD id to the source file.
Save extended address register prior to switching to 1000BASE-X
only mode and restore original value of extended address register
instead of overwriting it with page 1. There are still instance
information passing issue(e.g configured media type: fiber or
copper) from driver to PHY layer but this change make the selected
PHY work with 88E1112 PHY.
Reported by: Krzysztof Jedruczyk < beaker <at> hot dot pl >
Tested by: Krzysztof Jedruczyk < beaker <at> hot dot pl >
Warner Losh [Tue, 30 Sep 2008 02:34:45 +0000 (02:34 +0000)]
Improve support for multiple block read/write. This code is currently
disabled by default because there's problems with it on AT91RM9200,
currently the only host controller in the tree. I've not had time to
track those problems to ground. I'm committing because this is
important for other host controllers that are in the pipeline.
vm_fault_hold_user_pages will not return if an address in the range passed in is mapped RO
but an RW mapping exists for the underlying page. This change fixes the bug by using the
page / NULL returned from pmap_extract_and_hold to determine whether or not vm_fault needs
to be called.
Move the code for doing out-of-memory grass from vm_pageout_scan()
into the separate function vm_pageout_oom(). Supply a parameter for
vm_pageout_oom() describing a reason for the call.
Call vm_pageout_oom() from the swp_pager_meta_build() when swap zone
is exhausted.
Warner Losh [Mon, 29 Sep 2008 18:17:23 +0000 (18:17 +0000)]
Minor style fixes from mav@ (with similar problems fixed where I noticed
them):
#define<tab>
zero memory when we allocate it
Put device name in error message.
Sam Leffler [Mon, 29 Sep 2008 16:27:32 +0000 (16:27 +0000)]
Distinguish between cmd/parameters used for clone operations and
all others. Use this to disambiguate cmd line arguments that can
be either clone params or regular parameters so, in particular,
"bssid" again works as a regular parameter.
While here leverage the above to improve the logic for flushing
clone operations on the first !clone cmd line parameter.
Since in some cases (when found obsolete) 'make' can be builded earlier
at 'upgrade_checks' target, put arc4random_uniform() into
__FreeBSD_version ifdef.
Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORM
if the probe succeeds. This guarantees that the BSD scheme
wins over the MBR scheme when MBR gets to probe first. Build-
or link-time conditions can cause schemes to end up in the
linker set in a different order. Normally BSD is before MBR
in the linker set and as such get to probe first. But typically
when the kernel gets rebuild or relinked, this can change.
Insert the null scheme at the head. This does not change any
functionality, but creates an invariant: the first element
on the list is always the null scheme.
Warner Losh [Mon, 29 Sep 2008 01:28:30 +0000 (01:28 +0000)]
The parameters to the MMCBR_ACQUIRE_HOST and MMCBR_RELEAES_HOST were
the device in question, rather than the bus doing the requesting. Fix
it so that it is the bus.
Warner Losh [Sun, 28 Sep 2008 22:40:11 +0000 (22:40 +0000)]
Propigate read-only status of cards. Right now it is read only at
device attach time. We may need to read this more often in the
future, but for now simplicity of implementation wins.
Warner Losh [Sun, 28 Sep 2008 22:27:29 +0000 (22:27 +0000)]
The OCR register defines both acceptable voltage bits, as well as bits
for other things. Mask out the voltage only bits when returning the
Vdd mask for voltage computation.
Ed Schouten [Sun, 28 Sep 2008 20:15:45 +0000 (20:15 +0000)]
Several documentation fixups related to device minor/major numbers:
- Document the minor(3), major(3) and makedev(3) macro's. They also
apply to umajor() and uminor() in the kernel, but hopefully we'll sort
that out one day.
- Briefly dev2unit() inside the make_dev(9) manual page, since this is
now the preferred macro to obtain character device unit numbers inside
the kernel.
- Remove the device_ids(9) manual page. It contains highly inaccurate
information, such as a description of the nonexistent major().
Warner Losh [Sun, 28 Sep 2008 19:44:38 +0000 (19:44 +0000)]
Catch up with svn r96606 (cvs rev 1.127 2002/05/14 20:35:29) of
sys/param.h and move the MI numbers out of here. Also move the MI
defines. Also remove a couple defines not in use (not sure if it is
age, or OpenBSD origins for thse). Note the current values that are
overrides that appear to be odd in some way.
More cleanup could be done here: NBPG appears to be spelled PAGE_SIZE
these days. There's new ways to spell PGOFSET and PGSHIFT too, I
think. These constants duplicate the MI constants and are sprinkled
into the mips code only. Further investigation is needed.
Marius Strobl [Sun, 28 Sep 2008 18:34:14 +0000 (18:34 +0000)]
Remove ipi_all() and ipi_self() as the former hasn't been used at
all to date and the latter also is only used in ia64 and powerpc
code which no longer serves a real purpose after bring-up and just
can be removed as well. Note that architectures like sun4u also
provide no means of implementing IPI'ing a CPU itself natively
in the first place.
Ed Schouten [Sun, 28 Sep 2008 16:44:15 +0000 (16:44 +0000)]
Don't automatically prepend the "tty" prefix to `pkill -t' arguments.
Because we now enforce UNIX98-style PTY's, we now use a lot of TTY's
that don't have the traditional /dev/ttyXX naming scheme. pkill(1)'s -t
flag automatically prepended the word "tty" to each TTY that was passed
on the command line. This meant that `pkill -t pts/0' was actually
converted to /dev/ttypts/0. Disable this broken behaviour for now.
Warner Losh [Sun, 28 Sep 2008 03:45:16 +0000 (03:45 +0000)]
Add stronger warning that spl is historical. I almost deleted this
man page entirely, but it is still mildly useful in understanding the
few splxxx usages we still have in the tree.
Warner Losh [Sun, 28 Sep 2008 03:33:01 +0000 (03:33 +0000)]
Change while (cond)\n\t\t; to while (cond)\n\t\tcontinue; since the
former more explicitly tells the compiler that you want an empty loop.
There are some lint programs that use this hint to avoid generating
warnings.
Marius Strobl [Sun, 28 Sep 2008 00:07:05 +0000 (00:07 +0000)]
Add a driver for `Schizo' Fireplane/Safari to PCI 2.1 and `Tomatillo'
JBus to PCI 2.2 bridges. In theory, this driver should also handle
`XMITS' Fireplane/Safari to PCI-X bridges but due to lack of access
to such hardware, support for these hasn't be fleshed out, yet.
Export the partition name in the conftxt and confxml output.
The conftxt output is used by libdisk, and the confxml
output is used by gpart itself (gpart show -l).
Hold the root mount while we're tasting. It is possible
that a nested partition (typically the BSD disklabel)
is not done tasting while the root file system is being
mounted. While this is rare, it's still possible.
Robert Watson [Sat, 27 Sep 2008 19:28:28 +0000 (19:28 +0000)]
When an inpcb doesn't have a socket but the inpcb is passed to ipfw
in the transmit path, such as TCPS_TIMEWAIT, fail the credential
extraction immediately rather than acquiring locks and looking up
the inpcb on the global lists in order to reach the conclusion that
the credential extraction has failed.
This is more efficient, but more importantly, it avoids lock
recursion on the inpcbinfo, which is no longer allowed with rwlocks.
This appears to have been responsible for at least two reported
panics.
Differentiate between interrupt frames, trap interrupt frames and timer
frame in the kgdb, to allow it to properly backtrace over the interrupt
stacks.
Frames created by the Xcpustop, Xrendezvous, Xipi_intr_bitmap_handler
and Xlazypmap differ from the frame for Xtimerint. The Xtimerint puts
pointer to the frame between return address and frame body, while rest
of the functions listed above do not. Correct offset calculation to
allow the ddb backtrace to step over such frames.
If the panic thread is preempted after setting panicstr but before
setting TDF_INPANIC then it will never be rescheduled again. Wrap
setting the panic condition with the critical section.
Allow 255 sectors/track for the BSD disklabel. The previous limit
of 63 sectors/track is too PC BIOS specific. On pc98, where the
BSD disklabel is used as well, 255 sectors/track is not uncommon.
Ed Schouten [Sat, 27 Sep 2008 13:19:09 +0000 (13:19 +0000)]
Move uminor() and umajor() to the same place as userspace minor() and major().
The uminor() and umajor() functions have the same use in kernel space as
the minor() and major() functions in userspace. If we ever get rid of
the minor() function in kernel space, we could decide to just expose
minor() and major() to kernel space, making uminor() and umajor()
redundant.
There are two reasons why we want to have uminor() and umajor() in
<sys/types.h>:
- Having them close together prevents them from diverting. Even though
it's unlikely the definitions will change, it's a good habit to have
them at the same place.
- They don't really belong in kern_conf.c. kern_conf.c has been
liberated from dealing with device major and minor number handling.
The device_ids(9) manpage now lists the wrong #include's, because it
should only list <sys/types.h> now. I'm leaving it as it is now, because
I wonder if we should document them anyway. We're probably better off
documenting minor(3) and major(3).
Robert Watson [Sat, 27 Sep 2008 10:14:02 +0000 (10:14 +0000)]
Rather than shadowing global variable 'lookup' in check_uidgid(), rename
it to ugid_lookupp. This should make debugging issues with ipfw uid
rules easier.
Ed Schouten [Sat, 27 Sep 2008 08:51:18 +0000 (08:51 +0000)]
Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.
This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.