Tim J. Robbins [Sun, 23 Jun 2002 11:21:20 +0000 (11:21 +0000)]
Make the Examples section consistent with the rest of the system manual
pages: description of command first, then command as typed (no shell prompt)
using Dl macro.
Warner Losh [Sun, 23 Jun 2002 07:27:24 +0000 (07:27 +0000)]
As disclosed to arch@, make more interfaces standard. This allows for
easier loading of modules that might refer to these interfaces. None
of the code that implements them is standard, just the glue. This
bloats the kernel a whopping 8k.
Warner Losh [Sun, 23 Jun 2002 01:55:10 +0000 (01:55 +0000)]
What:
o ToPIC is happy with two cards now, even when the two cards are
modems.
o Fix (all?) hangs on boot when power is applied to the card. I
suspect that this will make the Ricoh bridges happier and also
make a lot of VAIO owners happy (confirm to me in private email
please :-).
o All Cardbus bridges should now support 3.3V, X.XV and Y.YV cards,
to the extent that the underlying hardware supports such cards.
(X.X and Y.Y haven't been assigned values yet :-).
o Better 3.3V support for Ricoh ISA bridges.
How:
o Don't mess with the power register when scanning the cards. It
is unnecessary and causes BADVcc conditions on many chipsets. These
in turn can cause an interrupt storm.
o Make pcic_disable reset the slot's voltage.
o Move initializing voltage for the slot until after it has been
disabled.
o Fix a lot of issues with the pcic_cardbus_power routine. We
now properly enable the card and take it out of reset after
a power change.
o When detecting the card's voltage, if we're in a BadVcc state,
direct the bridge to rescan the card for what it supports.
(we might need to in the future set the power register to 0
before doing this).
o Don't preserve CLKSTOP. need to revisit this.
o Better support for Ricoh ISA bridges for 3.3V cards.
o Don't write to PCIC_POWER directly as offten, but instead go
through the pcic_power interface.
o All cardbus bridges now default to use cardbus power control.
o Add misc register definitions.
o remove some (now) bogus comments.
Extra Special Thanks To: Scott Lamber for his kind and generous loan
of a Toshiba laptop with a ToPIC 100 in it for my use.
Jake Burkholder [Sat, 22 Jun 2002 23:55:15 +0000 (23:55 +0000)]
Fix a bug related to marking pages virtually uncacheable due to illegal
dcache aliasing. A page that already had more than 1 mapping of the
same virtual colour would not be correctly uncached.
John Polstra [Sat, 22 Jun 2002 22:35:53 +0000 (22:35 +0000)]
Fix several bugs in the i386 asm statements used to speed up Internet
checksumming. These bugs could possibly cause bad code to be
generated at elevated optimization levels.
First, eliminate the use of preprocessor magic to form the address
fields of asm instructions. It hid the actual addresses being
referenced from the compiler. Without knowledge of all the data
dependencies, the compiler might possibly use optimizations which
would result in incorrect code.
Use "__asm __volatile" rather than "__asm" for instruction sequences
that pass information through the condition codes (the carry bit, in
this case). Without __volatile, the compiler might add unrelated
code between consecutive __asm instructions, modifying the condition
codes. I have seen GCC insert stack pointer adjustments in this
way, for example. Unfortunately, GCC doesn't provide a way to
specify dependencies on the condition codes. You can specify that
they are clobbered, but not that you are going to use them as input.
Finally, simplify the LOAD macro. This macro is used as a poor
man's prefetch. The simpler version gives the compiler more leeway
about just how it performs the prefetch.
Kirk McKusick [Sat, 22 Jun 2002 22:01:13 +0000 (22:01 +0000)]
This patch fixes a size problem with the stat structure for
64-bit architectures that was introduced in the UFS2 code
merge two days ago. The stat structure change that caused
the problem was the addition of the file create time.
Submitted by: Bruce Evans <bde@zeta.org.au>
Sponsored by: DARPA & NAI Labs.
Kirk McKusick [Sat, 22 Jun 2002 21:24:58 +0000 (21:24 +0000)]
This patch fixes a problem whereby filesystems that ran
out of inodes in a cylinder group would fail to check for
free inodes in other cylinder groups. This bug was introduced
in the UFS2 code merge two days ago.
An inode is allocated by calling ffs_valloc which calls
ffs_hashalloc to do the filesystem scan. Ffs_hashalloc
walks around the cylinder groups calling its passed allocator
(ffs_nodealloccg in this case) until the allocator returns a
non-zero result. The bug is that ffs_hashalloc expects the
passed allocator function to return a 64-bit ufs2_daddr_t.
When allocating inodes, it calls ffs_nodealloccg which was
returning a 32-bit ino_t. The ffs_hashalloc code checked
a 64-bit return value and usually found random non-zero bits in
the high 32-bits so decided that the allocation had succeeded
(in this case in the only cylinder group that it checked).
When the result was passed back to ffs_valloc it looked at
only the bottom 32-bits, saw zero and declared the system
out of inodes. But ffs_hashalloc had really only checked
one cylinder group.
The fix is to change ffs_nodealloccg to return 64-bit results.
Sponsored by: DARPA & NAI Labs.
Submitted by: Poul-Henning Kamp <phk@critter.freebsd.dk>
Reviewed by: Maxime Henrion <mux@freebsd.org>
Matthew Dillon [Sat, 22 Jun 2002 19:09:35 +0000 (19:09 +0000)]
Fix a bug in vfs_bio_clrbuf(). The single-page-clrbuf optimization was
improperly clearing more then just the invalid portions of the page. (This
bug is not known to have been triggered by anything).
Alan Cox [Sat, 22 Jun 2002 18:36:51 +0000 (18:36 +0000)]
o Replace mtx_assert(&Giant, MA_OWNED) in dev_pager_alloc()
with the acquisition and release of Giant. (Annotate as MPSAFE.)
o Reorder the sanity checks in dev_pager_alloc() to reduce
the time that Giant is held.
Matthew Dillon [Sat, 22 Jun 2002 18:36:21 +0000 (18:36 +0000)]
The last bits of the alloca -> mmap fix. IA64 and SPARC64 (current only).
Untested (testing request went unanswered), but sparc64 is not expected to
cause problems. IA64 is not expected to cause problems but the patch was
slightly more complex so the possibility exists.
Maxime Henrion [Sat, 22 Jun 2002 18:07:05 +0000 (18:07 +0000)]
o Remove the initialization of unused fields in the struct
uio now that we don't use uiomove() anymore.
o Enforce stricter checks on the length of the iov's in
nmount(2) since we now malloc() them individually and
corrupted iov's could make the kernel crash in malloc()
with "kmem_map too small".
Alan Cox [Sat, 22 Jun 2002 17:47:12 +0000 (17:47 +0000)]
o In vm_map_insert(), replace GIANT_REQUIRED by the acquisition and
release of Giant around the direct manipulation of the vm_object and
the optional call to pmap_object_init_pt().
o In vm_map_findspace(), remove GIANT_REQUIRED. Instead, acquire and
release Giant around the occasional call to pmap_growkernel().
o In vm_map_find(), remove GIANT_REQUIRED.
Luigi Rizzo [Sat, 22 Jun 2002 11:51:02 +0000 (11:51 +0000)]
Remove (almost all) global variables that were used to hold
packet forwarding state ("annotations") during ip processing.
The code is considerably cleaner now.
The variables removed by this change are:
ip_divert_cookie used by divert sockets
ip_fw_fwd_addr used for transparent ip redirection
last_pkt used by dynamic pipes in dummynet
Removal of the first two has been done by carrying the annotations
into volatile structs prepended to the mbuf chains, and adding
appropriate code to add/remove annotations in the routines which
make use of them, i.e. ip_input(), ip_output(), tcp_input(),
bdg_forward(), ether_demux(), ether_output_frame(), div_output().
On passing, remove a bug in divert handling of fragmented packet.
Now it is the fragment at offset 0 which sets the divert status of
the whole packet, whereas formerly it was the last incoming fragment
to decide.
Removal of last_pkt required a change in the interface of ip_fw_chk()
and dummynet_io(). On passing, use the same mechanism for dummynet
annotations and for divert/forward annotations.
option IPFIREWALL_FORWARD is effectively useless, the code to
implement it is very small and is now in by default to avoid the
obfuscation of conditionally compiled code.
NOTES:
* there is at least one global variable left, sro_fwd, in ip_output().
I am not sure if/how this can be removed.
* I have deliberately avoided gratuitous style changes in this commit
to avoid cluttering the diffs. Minor stule cleanup will likely be
necessary
* this commit only focused on the IP layer. I am sure there is a
number of global variables used in the TCP and maybe UDP stack.
* despite the number of files touched, there are absolutely no API's
or data structures changed by this commit (except the interfaces of
ip_fw_chk() and dummynet_io(), which are internal anyways), so
an MFC is quite safe and unintrusive (and desirable, given the
improved readability of the code).
Luigi Rizzo [Sat, 22 Jun 2002 11:29:08 +0000 (11:29 +0000)]
Define an mbuf type, MT_TAG, used for volatile annotations
prepended to mbuf chains in the network stack.
Reuse a previoulsy unused value to avoid changes in other
data structures.
Juli Mallett [Sat, 22 Jun 2002 10:44:47 +0000 (10:44 +0000)]
Replace the SWAP(var0,var1) macro with SWAP(type,var0,var1) and use it as
is appropriate to avoid using typeof/__typeof__. It is worth noting that
SWAP() is only ever used to swap pointer values so 'void *' assumptions would
have been acceptable, but I'd gladly pay you tuesday for a cheeseburger^W
cleaner interface today.
Alan Cox [Sat, 22 Jun 2002 07:54:42 +0000 (07:54 +0000)]
o Remove GIANT_REQUIRED from phys_pager_alloc(). If handle isn't NULL,
acquire and release Giant. If handle is NULL, Giant isn't needed.
o Annotate phys_pager_alloc() and phys_pager_dealloc() as MPSAFE.
Alan Cox [Sat, 22 Jun 2002 07:28:06 +0000 (07:28 +0000)]
o Replace GIANT_REQUIRED in vnode_pager_alloc() by the acquisition and
release of Giant. (Annotate as MPSAFE.)
o Also, in vnode_pager_alloc(), remove an unnecessary re-initialization
of struct vm_object::flags and move a statement that is duplicated
in both branches of an if-else.
Robert Watson [Sat, 22 Jun 2002 01:49:03 +0000 (01:49 +0000)]
Make it clear that this applies only to UFS1 file systems, as UFS2 will
have native extended attributes rather than stacked extended attributes.
While I'm at it, make sure UFS_EXTATTR is not spelt FFS_EXTATTR.
Sponsored by: DARPA, NAI Labs
Obtained from: TrustedBSD Project
Tim J. Robbins [Sat, 22 Jun 2002 01:42:26 +0000 (01:42 +0000)]
Don't store newlines at the end of each line in the hold/pattern spaces,
instead add the newline when the pattern space is printed. Make the `G' and
`H' commands add a newline to the space before the data, remove bogus
addition of newline from `x' command.
David E. O'Brien [Fri, 21 Jun 2002 19:24:12 +0000 (19:24 +0000)]
Clarify revision 1.14:
Gcc 3.1's -O0 and -O1 actually optimized alignment for space, but we feel
it should optimize alignment for time like Gcc 2.95 used to. Optimization
for space should give 1-byte alignment on i386's, but doesn't quite.
David E. O'Brien [Fri, 21 Jun 2002 19:05:20 +0000 (19:05 +0000)]
We need to link with libiberty.a before libreadline.so. Both supply
xmalloc() and xrealloc() and the mixed usage of xmalloc in some .c's from
libiberty.a and other .c's from libreadline.so produces an unusable binary
on the Alpha.
While I am here, preventatively move other libs in the link order.
David E. O'Brien [Fri, 21 Jun 2002 18:21:30 +0000 (18:21 +0000)]
cc -O0 and -O1 didn't do the easy optimization of alignment for space.
Instead it attempted to do the easy optimization of alignment for time,
which should be to 1-byte alignment on i386's.
Also do some markup fixes to recently-added items so that they don't
try to use entities for manpages that have been removed, in the spirit
of rev. 1.359.