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.
Ed Schouten [Fri, 26 Sep 2008 18:17:04 +0000 (18:17 +0000)]
Don't forget to initialize `int error' in ttydev_open().
I've had some reports in the past that opening an already opened TTY
through, for example, /dev/tty can fail with random error codes. Looking
at ttydev_open(), I can see there is a way `error' is returned without
initialising it. Even though I haven't had any confirmation this fixes
the bug, I'll fix it anyway.
Add -D_OSRELDATE_H to CFLAGS to prevent the declaration of
getosreldate() in assembler source files. We still get the
definition of __FreeBSD_version this way, because it's
outside the standard multiple-inclusion protection trick.
Save previous content of the td_fpop before storing the current
filedescriptor into it. Make sure that td_fpop is NULL when calling
d_mmap from dev_pager_getpages().
Change guards against td_fpop field being non-NULL with private state
for another device, and against sudden clearing the td_fpop. This
could occur when either a driver method calls another driver through
the filedescriptor operation, or a page fault happen while driver is
writing to a memory backed by another driver.
Noted by: rwatson
Tested by: rnoland
MFC after: 3 days
Ed Schouten [Fri, 26 Sep 2008 14:31:24 +0000 (14:31 +0000)]
Rename the `minor' argument of make_dev(9) to `unit'.
To prevent any further confusion about device minor and unit numbers,
we'd better just refer to device unit numbers. Many people still think
the numbers we show inside devfs have any relation to the numbers passed
to make_dev(9), which is not the case.
Ed Schouten [Fri, 26 Sep 2008 14:19:52 +0000 (14:19 +0000)]
Remove unit2minor() use from kernel code.
When I changed kern_conf.c three months ago I made device unit numbers
equal to (unneeded) device minor numbers. We used to require
bitshifting, because there were eight bits in the middle that were
reserved for a device major number. Not very long after I turned
dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
The unit2minor() and minor2unit() macro's were no-ops.
We'd better not remove these four macro's from the kernel, because there
is a lot of (external) code that may still depend on them. For now it's
harmless to remove all invocations of unit2minor() and minor2unit().
Peter Wemm [Fri, 26 Sep 2008 05:50:08 +0000 (05:50 +0000)]
Re-add getosreldate(3) function prototype in the form that I've been using
for quite some time now. While I'm not sure if it'll break IA64 again,
this way doesn't cause problems with my builds of XFree86/Xorg and the way
they #include <osreldate.h> via cpp in the imake system.
Warner Losh [Fri, 26 Sep 2008 05:37:54 +0000 (05:37 +0000)]
Catch up to latest tty, kdb and SYSINIT changes. Modeled after the
dev/ofw changes, since this driver appears to have used that as a
start years ago...
John Baldwin [Thu, 25 Sep 2008 20:50:21 +0000 (20:50 +0000)]
Add support for installing 32-bit system calls from kernel modules. This
includes syscall32_{de,}register() routines as well as a module handler
and wrapper macros similar to the support for native syscalls in
<sys/sysent.h>.
John Baldwin [Thu, 25 Sep 2008 20:07:42 +0000 (20:07 +0000)]
Tidy up a few things with syscall generation:
- Instead of using a syscall slot (370) just to get a function prototype
for lkmressys(), add an explicit function prototype to <sys/sysent.h>.
This also removes unused special case checks for 'lkmressys' from
makesyscalls.sh.
- Instead of having magic logic in makesyscalls.sh to only generate a
function prototype the first time 'lkmnosys' is seen, make 'NODEF'
always not generate a function prototype and include an explicit
prototype for 'lkmnosys' in <sys/sysent.h>.
- As a result of the fix in (2), update the LKM syscall entries in
the freebsd32 syscall table to use 'lkmnosys' rather than 'nosys'.
- Use NOPROTO for the __syscall() entry (198) in the native ABI. This
avoids the need for magic logic in makesyscalls.h to only generate
a function prototype the first time 'nosys' is encountered.
Robert Watson [Thu, 25 Sep 2008 17:26:54 +0000 (17:26 +0000)]
As a follow-on to r183323, correct another case where ip_output() was
called without an inpcb pointer despite holding the tcbinfo global
lock, which lead to a deadlock or panic when ipfw tried to further
acquire it recursively.
Reported by: Stefan Ehmann <shoesoft at gmx dot net>
MFC after: 3 days
John Baldwin [Thu, 25 Sep 2008 13:42:19 +0000 (13:42 +0000)]
- Don't do a WITNESS_SAVE() on the interlock if it is Giant in the condition
variable wait routines. DROP_GIANT() already manages that state in the
Giant interlock case.
- Assert that Giant is held when it is passed as a sleep interlock.
David Malone [Thu, 25 Sep 2008 12:35:01 +0000 (12:35 +0000)]
Some people's 6to4 routers seem to have been blowing up because of
the unlocked route caching in if_stf. Add a mutex that protects
access to cached route. This seemed to fix problems for Pekka Savola.
Nick Sayer had similar problems, and in his case completly disabling
the route cache seemed to help. Add a sysctl net.link.stf.route_cache
that can be used to turn off route caching in if_stf.
PR: 122283
MFC after: 2 weeks
Tested by: Pekka Savola, Nick Sayer.
David Malone [Thu, 25 Sep 2008 09:28:18 +0000 (09:28 +0000)]
Add a flag, -T, that tells syslogd to always replace the timestamp on
messages from the network. We already replace malformatted timestamps
and this option lets us replace timestamps that are correctly formatted
but wrong.
Add another hardware bug workaround for Yukon II controllers that
have hardware ram buffer. The silicon bug seem to be triggered by
pause frames if receive buffer is not aligned on FIFO word(8 bytes).
To workaround the issue, make sure to align Rx buffers on 8 bytes.
Unfortunately this workaround requires yet another Rx fixup for
strict alignment architecture machines to align IP header.
For newer hardwares that lacks ram buffer may not have this bug so
check number of available ram buffer size to see the existence of
ram buffer.
Reported by: Ian Freislich (ianf <at> clue dot co dot za), das
Tested by: Ian Freislich (ianf <at> clue dot co dot za)