bde [Mon, 13 May 2002 14:34:47 +0000 (14:34 +0000)]
Fixed a semantic error. va_arg(ap, u_short) is nonsense except on i386's
with 16-bit ints, since u_short is promoted when it is passed to a
varargs function. gcc now warns about this. We always pass small
integers (this is well obuscated), so there are no conversion problems.
bde [Mon, 13 May 2002 14:11:33 +0000 (14:11 +0000)]
Don't include <stddef.h> "For offsetof". This is not even wrong in
-current, since offsetof() is defined a header under /sys so that
system sources don't need to have this wrong include.
This bug was only detected because my version of <stddef.h> has some
spelling fixes (s/field/member/g) and gcc is now sensitive to the spelling
of arg names in macros as required by standards (ISO C90 6.8.3...).
bde [Mon, 13 May 2002 12:39:46 +0000 (12:39 +0000)]
Fixed syntax errors (garbage after #endif; just editing errors in this
case). These errors and related style bugs swere cloned from ufs
shortly after they were committed to ufs. They were mostly fixed in
ufs long ago.
ru [Mon, 13 May 2002 10:53:24 +0000 (10:53 +0000)]
Major cleanup of bsd.lib.mk.
Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything. Added a NOINSTALLLIB knob for libpam/modules. To not
build any library at all, just do not set LIB.
luigi [Mon, 13 May 2002 10:37:19 +0000 (10:37 +0000)]
Add ipfw hooks to ether_demux() and ether_output_frame().
Ipfw processing of frames at layer 2 can be enabled by the sysctl variable
net.link.ether.ipfw=1
Consider this feature experimental, because right now, the firewall
is invoked in the places indicated below, and controlled by the
sysctl variables listed on the right. As a consequence, a packet
can be filtered from 1 to 4 times depending on the path it follows,
which might make a ruleset a bit hard to follow.
I will add an ipfw option to tell if we want a given rule to apply
to ether_demux() and ether_output_frame(), but we have run out of
flags in the struct ip_fw so i need to think a bit on how to implement
this.
to upper layers
| |
+----------->-----------+
^ V
[ip_input] [ip_output] net.inet.ip.fw.enable=1
| |
^ V
[ether_demux] [ether_output_frame] net.link.ether.ipfw=1
| |
+->- [bdg_forward]-->---+ net.link.ether.bridge_ipfw=1
^ V
| |
to devices
keramida [Mon, 13 May 2002 08:40:07 +0000 (08:40 +0000)]
o Uncapitalize .Nd macro arguments and remove punctuation
o Minor grammar fixes.
o Sort SEE ALSO references, and add iostat(8).
o Delete punctuation at end of AUTHORS' section only line
tjr [Mon, 13 May 2002 08:03:20 +0000 (08:03 +0000)]
If we can't change the scheduling priority, warn but still execute
the requested utility. This is how nice(1) traditionall behaved,
and the behaviour required by SUSv3 and POSIX.2 UPE.
Submitted by: Peter Avalos <pavalos@theshell.com> (partially)
Reviewed by: mike
alfred [Mon, 13 May 2002 07:58:15 +0000 (07:58 +0000)]
Don't use PAGE_SIZE in userland, instead use getpagesize(), this is to
allow running on other arches when the instructions are supported but
the page size granularity is not.
jeff [Mon, 13 May 2002 05:08:18 +0000 (05:08 +0000)]
Don't call the uz free function while the zone lock is held. This can lead
to lock order reversals. uma_reclaim now builds a list of freeable slabs and
then unlocks the zones to do all of the frees.
jeff [Mon, 13 May 2002 04:39:28 +0000 (04:39 +0000)]
Remove the hash_free() lock order reversal. This could have happened for
several reasons before. Fixing it involved restructuring the generic hash
code to require calling code to handle locking, unlocking, and freeing hashes
on error conditions.
obrien [Mon, 13 May 2002 03:27:03 +0000 (03:27 +0000)]
Restore some of the implementation from the Bmake gcc 2.95 bits.
In the end, I can do things more like the previous Bmake bits than was
apparent in the middle of the gcc31 WIP.
obrien [Mon, 13 May 2002 01:54:26 +0000 (01:54 +0000)]
I was finally able to repeat the -j breakage on one of my machines. Fix it.
I borrowed some ideas from Ruslan, and made the style match cc_tools/Makefile
tjr [Sun, 12 May 2002 22:49:48 +0000 (22:49 +0000)]
Support the SUSv3 -n option and the "--" end of options marker.
Replace "command" with "utility" in the manual page & source to be more
consistent with the terminology used in the standard, and to hint that
shell builtin commands won't work.
Submitted by: Peter Avalos <pavalos@theshell.com> (partially)
Approved by: mike
luigi [Sun, 12 May 2002 20:52:21 +0000 (20:52 +0000)]
Main functional change is the implementation of matching of MAC header
fields as discussed in the commit to ip_fw.c:1.186
On top of this, a ton of non functional changes to clean up the code,
write functions to replace sections of code that were replicated
multiple times (e.g. the printing or matching of flags and options),
splitting long sections of inlined code into separate functions,
and the like.
I have tested the code quite a bit, but some typos (using one variable
in place of another) might have escaped.
The "embedded manpage" is a bit inconsistent, but i am leaving fixing
it for later. The current format makes no sense, it is over 40 lines
long and practically unreadable. We can either split it into sections
( ipfw -h options , ipfw -h pipe , ipfw -h queue ...)
or remove it altogether and refer to the manpage.
phk [Sun, 12 May 2002 20:49:41 +0000 (20:49 +0000)]
Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.
luigi [Sun, 12 May 2002 20:43:50 +0000 (20:43 +0000)]
Add code to match MAC header fields (at the moment supported on
bridged packets only, soon to come also for packets on ordinary
ether_input() and ether_output() paths. The syntax is
ipfw add <action> MAC dst src type
where dst and src can be "any" or a MAC address optionallyfollowed
by a mask, e.g.
and type can be a single ethernet type, a range, or a type followed by
a mask (values are always in hexadecimal) e.g.
0800
0800-0806
0800/8
0800&03ff
Note, I am still uncertain on what is the best format for inputting
these values, having the values in hexadecimal is convenient in most
cases but can be confusing sometimes. Suggestions welcome.
Implement suggestion from PR 37778 to allow "not me" on destination
and source IP. The code in the PR was slightly wrong and interfered
with the normal handling of IP addresses. This version hopefully is
correct.
Minor cleanup of the code, in some places moving the indentation to 4
spaces because the code was becoming too deep. Eventually, in a
separate commit, I will move the whole file to 4 space indent.
phk [Sun, 12 May 2002 20:00:21 +0000 (20:00 +0000)]
Remove #define for BBOFF, it is assumed == 0 so many places that we might
as well forget about it. In fact the only thing which used it was the
SBOFF macro.
phk [Sun, 12 May 2002 19:24:09 +0000 (19:24 +0000)]
Remove the private code for reading UFS superblocks, this does not belong
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.
Use the .../mount/extern.h to get prototypes of the functions we
borrow from there. Constify things to match. (why aren't these
functions in a lib anyway ?)
Make everything static and set WARNS?=5.
The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.
ru [Sun, 12 May 2002 16:01:00 +0000 (16:01 +0000)]
Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.
Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):
Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.
Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.
Consistently use INCLUDEDIR instead of /usr/include.
gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.
These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
bde [Sun, 12 May 2002 15:45:28 +0000 (15:45 +0000)]
Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;". This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.
Removed -fno-align-foo since it is implied by -Os. Previous commit
messages seem to have overstated the new alignment bugs in gcc. The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken. All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY. This is caused by toplev.c setting
defaults too early.
Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed. The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects. There aren't
even any options to control alignment of data.
joerg [Sun, 12 May 2002 15:24:21 +0000 (15:24 +0000)]
Increase the PIO timeout to approximately the value it used to have
before rev 1.229 (~ 100 ms). According to bde, some (old) broken
hardware could require it. In order to make timing more accurate than
what could be achieved with a loop around DELAY(1), increase loop
timing after the initial ~ 1 ms.
Also, move the declaration of FDSTS_TIMEOUT out from fdreg.h into fd.c
where it actually belongs to.
obrien [Sun, 12 May 2002 13:54:42 +0000 (13:54 +0000)]
Back out last commit. I expect our bsd.*.mk gods to remove the need for
defining so many extra things in addition to INTERNALLIB. We don't like
repetitive C code and we shouldn't for make code either.
marcel [Sun, 12 May 2002 05:54:21 +0000 (05:54 +0000)]
o Rename ia64_count_aps to ia64_count_cpus and reimplement the
function to return the total number of CPUs and not the highest
CPU id.
o Define mp_maxid based on the minimum of the actual number of
CPUs in the system and MAXCPU.
o In cpu_mp_add, when the CPU id of the CPU we're trying to add
is larger than mp_maxid, don't add the CPU. Formerly this was
based on MAXCPU. Don't count CPUs when we add them. We already
know how many CPUs exist.
o Replace MAXCPU with mp_maxid when used in loops that iterate
over the id space. This avoids a couple of useless iterations.
o In cpu_mp_unleash, use the number of CPUs to determine if we
need to launch the CPUs.
o Remove mp_hardware as it's not used anymore.
o Move the IPI vector array from mp_machdep.c to sal.c. We use
the array as a centralized place to collect vector assignments.
Note that we still assign vectors to SMP specific IPIs in
non-SMP configurations. Rename the array from mp_ipi_vector to
ipi_vector.
o Add IPI_MCA_RENDEZ and IPI_MCA_CMCV. These are used by MCA.
Note that IPI_MCA_CMCV is not SMP specific.
o Initialize the ipi_vector array so that we place the IPIs in
sensible priority classes. The classes are relative to where
the AP wake-up vector is located to guarantee that it's the
highest priority (external) interrupt. Class assignment is
as follows:
class IPI notes
x AP wake-up (normally x=15)
x-1 MCA rendezvous
x-2 AST, Rendezvous, stop
x-3 CMCV, test
alc [Sun, 12 May 2002 05:22:56 +0000 (05:22 +0000)]
o Acquire and release Giant in vm_object_reference() and
vm_object_deallocate(), replacing the assertion GIANT_REQUIRED.
o Remove GIANT_REQUIRED from vm_map_protect() and vm_map_simplify_entry().
o Acquire and release Giant around vm_map_protect()'s call to pmap_protect().
Altogether, these changes eliminate the need for mprotect() to acquire
and release Giant.
bsd [Sun, 12 May 2002 01:47:50 +0000 (01:47 +0000)]
To perform even basic error checking, one must have an exit code that
indicates that not everything worked as expected. Exit non-zero if we
timed out while transmitting or receiving a file or if the file did
not exist, etc.