Gleb Smirnoff [Fri, 14 Jan 2005 09:00:46 +0000 (09:00 +0000)]
o Clean up interface between ip_fw_chk() and its callers:
- ip_fw_chk() returns action as function return value. Field retval is
removed from args structure. Action is not flag any more. It is one
of integer constants.
- Any action-specific cookies are returned either in new "cookie" field
in args structure (dummynet, future netgraph glue), or in mbuf tag
attached to packet (divert, tee, some future action).
o Convert parsing of return value from ip_fw_chk() in ipfw_check_{in,out}()
to a switch structure, so that the functions are more readable, and a future
actions can be added with less modifications.
David Schultz [Fri, 14 Jan 2005 07:09:23 +0000 (07:09 +0000)]
Mark all inline asms that read the floating-point control or status
registers as volatile. Instructions that *wrote* to FP state were
already marked volatile, but apparently gcc has license to move
non-volatile asms past volatile asms. This broke amd64's feupdateenv
at -O2 due to a WAR conflict between fnstsw and fldenv there.
David Schultz [Thu, 13 Jan 2005 18:58:25 +0000 (18:58 +0000)]
Import the subset of J.T. Conklin's single-precision x86-optimized
math routines that appear to be (a) correct and (b) faster than their
MI counterparts on my Pentium 4.
Get rid of the VDESC() macro while the pot is boiling anyway, it is
only used from generate files now, so we might as well generate the
right stuff from the start.
Change the generated VOP_ macro implementations to improve type checking
and KASSERT coverage.
After this check there is only one "nasty" cast in this code but there
is a KASSERT to protect against the wrong argument structure behind
that cast.
Un-inlining the meat of VOP_FOO() saves 35kB of text segment on a typical
kernel with no change in performance.
We also now run the checking and tracing on VOP's which have been layered
by nullfs, umapfs, deadfs or unionfs.
Add new (non-inline) VOP_FOO_AP() functions which take a "struct
foo_args" argument and does everything the VOP_FOO() macros
used to do with checks and debugging code.
Add KASSERT to VOP_FOO_AP() check for argument type being
correct.
Slim down VOP_FOO() inline functions to just stuff arguments
into the struct foo_args and call VOP_FOO_AP().
Put function pointer to VOP_FOO_AP() into vop_foo_desc structure
and make VCALL() use it instead of the current offsetoff() hack.
Retire vcall() which implemented the offsetoff()
Make deadfs and unionfs use VOP_FOO_AP() calls instead of
VCALL(), we know which specific call we want already.
Remove unneeded arguments to VCALL() in nullfs and umapfs bypass
functions.
Remove unused vdesc_offset and VOFFSET().
Generally improve style/readability of the generated code.
Gleb Smirnoff [Thu, 13 Jan 2005 07:43:12 +0000 (07:43 +0000)]
Locking and cleanup of tty netgraph node. Tty stack is Giant-locked,
so we need to acquire Giant in netgraph methods, so that we don't
race with line discipline methods. Remove NET_NEEDS_GIANT.
- Packets coming into node from netgraph are queued in ifqueue
attached to node private data.
- Mutex in struct ifqueue is used to lock not only the queue, but
the whole private data, and tp->t_lsc field.
- tp->t_lsc pointer is used to indicate whether line discipline is
attached to netgraph or not.
- Use FLG_DIE flag to indicate that node may be destroyed.
(This protection doesn't work, and it didn't before. Must be redesigned.)
- Increment ngt_unit atomically, removing mutex.
- Acquire Giant, when executing ngt_start() from netgraph context.
- Acquire Giant, when {,de}registering line discipline.
- Uncomment forcing queue mode on peers hook, since this is reasonable.
- Force queue mode on our hook, to avoid acquiring Giant when coming from
network stack. We may already hold some mutexes at this point.
Cleanups:
- Use callout_pending() instead of our own flag.
- Remove spl(9) calls. Now we can use return() instead of ERROUT().
style(9):
- Sort includes.
- Sparse initializer for struct linesw.
- Remove some empty lines, sort declarations.
Xin LI [Thu, 13 Jan 2005 03:59:44 +0000 (03:59 +0000)]
WANRS=6 cleanup for vidcontrol(1):
- Use foo(void) instead of foo().
- Use static where applicable.
- Apply more const's when passing parameters
- signed/unsigned madness
- Avoid namespace collision by adding underscores.
- For 64-bit architectures, use %zx instead of %x
when necessary.
- When storing constants, use const instead of
variable.
- Bump WARNS?= from 2 to 6
Paul Saab [Wed, 12 Jan 2005 21:40:51 +0000 (21:40 +0000)]
Fix a TCP SACK related crash resulting from incorrect computation
of len in tcp_output(), in the case where the FIN has already been
transmitted. The mis-computation of len is because of a gcc
optimization issue, which this change works around.
John Baldwin [Wed, 12 Jan 2005 18:24:32 +0000 (18:24 +0000)]
Try harder to work with MP table interrupt entries that claim that an
interrupt is wired up to all the I/O APICs in the system. If the system
has only one I/O APIC, then just act as if the entry specified that APIC.
We still don't try to handle global entries in a system with multiple I/O
APICs.
Tested by: Peter Trifonov pvtrifonov at mail dot ru
MFC after: 1 week
Maxim Sobolev [Wed, 12 Jan 2005 10:15:23 +0000 (10:15 +0000)]
When re-connecting already connected datagram socket ensure to clean
up its pending error state, which may be set in some rare conditions resulting
in connect() syscall returning that bogus error and making application believe
that attempt to change association has failed, while it has not in fact.
There is sockets/reconnect regression test which excersises this bug.
Maxim Sobolev [Wed, 12 Jan 2005 09:57:18 +0000 (09:57 +0000)]
Add test which excersises problem with unability to change association of
already associated datagram unix domain socket by issuing connect() system
call.
Eric Anholt [Wed, 12 Jan 2005 07:18:25 +0000 (07:18 +0000)]
Create three additional X socket directories. Using X applications when another
user owns these directories or the sticky bit is unset may open security holes,
so simply create them at startup with the correct owner/mode.
Scott Long [Wed, 12 Jan 2005 06:42:13 +0000 (06:42 +0000)]
Use off_t when passing and calculating file offsets. While a single
extent in UDF is only 32 bits, multiple extents can exist in a file.
Also clean up some minor whitespace problems.
David Xu [Wed, 12 Jan 2005 05:55:52 +0000 (05:55 +0000)]
Let _umtx_op directly return error code rather than from errno because
errno can be tampered potentially by nested signal handle.
Now all error codes are returned in negative value, positive value are
reserved for future expansion.
Nate Lawson [Wed, 12 Jan 2005 00:52:40 +0000 (00:52 +0000)]
Fix handling of the implicit return case for methods called from an
external source (i.e., _STA). The previous case only handled calls
occurring within AML. This should fix Toshibas, among others. Thanks
to Robert Moore of Intel for the fix.
David Schultz [Tue, 11 Jan 2005 22:10:43 +0000 (22:10 +0000)]
Mark inline stmxcsr instructions as volatile, since this appears to be
the only way to convince gcc that they read the MXCSR. The volatile
annotation may be needed elsewhere as well.
Suleiman Souhlal [Tue, 11 Jan 2005 18:52:12 +0000 (18:52 +0000)]
Get the vnode from file.f_vnode instead of file.f_data.
Nowadays, f_data points to the vnode only if the underlying filesystem
doesn't use it for other purposes (devfs uses it to store the cdev,
for example).
Introduce a new GEOM class - SHSEC. It provides sharing secret between
the given providers. Without even one of the configured components there
should be no way to get the secret.
Supported by: WHEEL Sp. z o.o.
http://www.wheel.pl
Peter Edwards [Tue, 11 Jan 2005 14:53:16 +0000 (14:53 +0000)]
When grabbing registers for an lwp, fake the inferior's pid using the
lwp ID before invoking the underlying target operation.
For corefiles, we rely on gdb internals to do this, and it uses the
pid as an index, rather than the lwpid, so previously, backtraces
for multithreaded core files wasn't working correctly. For processes,
we currently use ptrace directly, so fixup that code to also use
the pid directly.
Xin LI [Tue, 11 Jan 2005 14:34:29 +0000 (14:34 +0000)]
Make WARNS=6 happy with our init(8):
- Use more ``const''s where suitable.
- Define strk() as a static function in global scope.
This avoids the "nested extern declaration" warnings.
- Use static initialization of strings, rather than
referring string constants through char *.
- Bump WARNS from 0 to 6.