]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoRather than calling mircotime() in catchpacket(), make catchpacket()
dwmalone [Mon, 24 Jul 2006 15:42:04 +0000 (15:42 +0000)]
Rather than calling mircotime() in catchpacket(), make catchpacket()
take a timeval indicating when the packet was captured. Move
microtime() to the calling functions and grab the timestamp as soon
as we know that we're going to call catchpacket at least once.

This means that we call microtime() once per matched packet, as
opposed to once per matched packet per bpf listener. It also means
that we return the same timestamp to all bpf listeners, rather than
slightly different ones.

It would be more accurate to call microtime() even earlier for all
packets, as you have to grab (1+#listener) locks before you can
determine if the packet will be logged. You could always grab a
timestamp before the locks, but microtime() can be costly, so this
didn't seem like a good idea.

(I guess most ethernet interfaces will have a bpf listener these
days because of dhclient. That means that we could be doing two bpf
locks on most packets going through the interface.)

PR: 71711

17 years agosoreceive_generic(), and sopoll_generic(). Add new functions sosend(),
rwatson [Mon, 24 Jul 2006 15:20:08 +0000 (15:20 +0000)]
soreceive_generic(), and sopoll_generic().  Add new functions sosend(),
soreceive(), and sopoll(), which are wrappers for pru_sosend,
pru_soreceive, and pru_sopoll, and are now used univerally by socket
consumers rather than either directly invoking the old so*() functions
or directly invoking the protocol switch method (about an even split
prior to this commit).

This completes an architectural change that was begun in 1996 to permit
protocols to provide substitute implementations, as now used by UDP.
Consumers now uniformly invoke sosend(), soreceive(), and sopoll() to
perform these operations on sockets -- in particular, distributed file
systems and socket system calls.

Architectural head nod: sam, gnn, wollman

17 years agoForced commit to recognize repo-copy of uipc_socket2.c to uipc_sockbuf.c,
rwatson [Mon, 24 Jul 2006 14:34:04 +0000 (14:34 +0000)]
Forced commit to recognize repo-copy of uipc_socket2.c to uipc_sockbuf.c,
which will hold socket buffer specific routines.

Thanks to: simon

17 years agoRemove a duplicated line.
davidxu [Mon, 24 Jul 2006 12:24:56 +0000 (12:24 +0000)]
Remove a duplicated line.

17 years agoFinally fix support for the newer MCP51/MCP55 nVidia chipsets.
sos [Mon, 24 Jul 2006 10:44:50 +0000 (10:44 +0000)]
Finally fix support for the newer MCP51/MCP55 nVidia chipsets.
The register layout has changed since the original NV4 - sigh.
Hotplug support has been fixed for all nVidia chipsets that supports it
(including the MCP51/55).

HW donated by: Kingsley College

17 years agoImprove mark-up: References to "start" as an rc.d method
yar [Mon, 24 Jul 2006 10:07:27 +0000 (10:07 +0000)]
Improve mark-up:  References to "start" as an rc.d method
should be tagged with ".Cm".  (Refs to "stop" are OK already.)

MFC after: 3 days

17 years agoo GC MT_FTABLE removed in rev. 1.192 mbuf.h.
maxim [Mon, 24 Jul 2006 07:32:23 +0000 (07:32 +0000)]
o GC MT_FTABLE removed in rev. 1.192 mbuf.h.
o Correct MT_HEADER define.

17 years agoNew release notes: iwi(4) update (+MFC), jexec(8) -u/-U (+MFC),
bmah [Mon, 24 Jul 2006 03:58:53 +0000 (03:58 +0000)]
New release notes:  iwi(4) update (+MFC), jexec(8) -u/-U (+MFC),
extensible printf(3) (+MFC), tail(1) -q (+MFC)

Updated release notes:  ath(4) HAL 0.9.17.2 (+MFC).

MFCs noted:  ath(4) et al. in GENERIC, resolver update, /media.

17 years agoRemove MT_FTABLE, as it's no longer used.
rwatson [Mon, 24 Jul 2006 01:49:57 +0000 (01:49 +0000)]
Remove MT_FTABLE, as it's no longer used.

Comment that many stats in mbstat are now not used, as libmemstat and
UMA stats are used.

17 years agoRemove MT_FTABLE printout in systat, as MT_FTABLE mbufs are no longer
rwatson [Mon, 24 Jul 2006 01:49:24 +0000 (01:49 +0000)]
Remove MT_FTABLE printout in systat, as MT_FTABLE mbufs are no longer
used in the kernel.

17 years agoGarbage collect #if 0'd MT_ mbuf types, as they are no longer used, and
rwatson [Mon, 24 Jul 2006 01:14:05 +0000 (01:14 +0000)]
Garbage collect #if 0'd MT_ mbuf types, as they are no longer used, and
there are no plans to re-introduce them.

17 years agoTweak so_gencnt comment: it was once last, but that is no longer the
rwatson [Mon, 24 Jul 2006 01:05:36 +0000 (01:05 +0000)]
Tweak so_gencnt comment: it was once last, but that is no longer the
case.

17 years agoTweak comment for so_head: it is a pointer to the listen socket, rather
rwatson [Mon, 24 Jul 2006 01:02:07 +0000 (01:02 +0000)]
Tweak comment for so_head: it is a pointer to the listen socket, rather
than the accept socket.

17 years agoFix a spelling error in a comment.
rwatson [Mon, 24 Jul 2006 00:33:24 +0000 (00:33 +0000)]
Fix a spelling error in a comment.

Found with: mckusick's code walkthrough DVDs

17 years agoRemove duplicate 'or'.
rwatson [Sun, 23 Jul 2006 21:01:09 +0000 (21:01 +0000)]
Remove duplicate 'or'.

Submitted by: ru

17 years agoUpdate various uipc_socket.c comments, and reformat others.
rwatson [Sun, 23 Jul 2006 20:36:04 +0000 (20:36 +0000)]
Update various uipc_socket.c comments, and reformat others.

17 years agoAdd additional comments to the top of the UNIX domain socket implementation
rwatson [Sun, 23 Jul 2006 20:06:45 +0000 (20:06 +0000)]
Add additional comments to the top of the UNIX domain socket implementation
providing some high level pointers regarding the implementation.

17 years agoRemove old kern.malloc sysctl, which generated a text representation of
rwatson [Sun, 23 Jul 2006 19:55:41 +0000 (19:55 +0000)]
Remove old kern.malloc sysctl, which generated a text representation of
the kernel malloc(9) state for vmstat -m.  libmemstat is now used to
generate a machine-readable version which is converged by vmstat -m
into a human-readable version.

Not for MFC.

17 years agoExpand comments for malloc(9) to better describe the design and
rwatson [Sun, 23 Jul 2006 19:51:39 +0000 (19:51 +0000)]
Expand comments for malloc(9) to better describe the design and
statistics / memory types model.

17 years agoUpdate and reformat comments for POSIX.1e ACL utility routines.
rwatson [Sun, 23 Jul 2006 19:35:10 +0000 (19:35 +0000)]
Update and reformat comments for POSIX.1e ACL utility routines.

17 years agoComment extended attribute name space constants.
rwatson [Sun, 23 Jul 2006 19:26:54 +0000 (19:26 +0000)]
Comment extended attribute name space constants.

17 years agoImprove comments for label data structure.
rwatson [Sun, 23 Jul 2006 19:26:32 +0000 (19:26 +0000)]
Improve comments for label data structure.

17 years agoAdd missing ;.
nork [Sun, 23 Jul 2006 15:53:12 +0000 (15:53 +0000)]
Add missing ;.

Pointy hat to: myself
Approved by: deischen (implicitly)

17 years agodo not overload the port number on to the return value of
ume [Sun, 23 Jul 2006 15:31:03 +0000 (15:31 +0000)]
do not overload the port number on to the return value of
str2number().  this could result in an unexpected code path.

Obtained from: KAME
MFC after: 1 week

17 years agoAdd missing syscalls.
nork [Sun, 23 Jul 2006 13:08:54 +0000 (13:08 +0000)]
Add missing syscalls.

Reviewed by: deischen
Approved by: deischen

17 years agoAlign IPv6 socket locking with IPv4 locking: lock socket buffer explicitly
rwatson [Sun, 23 Jul 2006 12:24:22 +0000 (12:24 +0000)]
Align IPv6 socket locking with IPv4 locking: lock socket buffer explicitly
and use _locked variants to avoid extra lock and unlock operations.

Reviewed by: gnn
MFC after: 1 week

17 years agoAdd two new unpcb flags, UNP_BINDING and UNP_CONNECTING, which will be
rwatson [Sun, 23 Jul 2006 12:01:14 +0000 (12:01 +0000)]
Add two new unpcb flags, UNP_BINDING and UNP_CONNECTING, which will be
used to mark UNIX domain sockets as being in the process of binding or
connecting.  Use these to prevent simultaneous bind or connect
operations by multiple threads or processes on the same socket at the
same time, which closes race conditions present in the UNIX domain
socket implementation since inception.

17 years agoMerge unp_bind() into uipc_bind(), as it is called only from uipc_bind().
rwatson [Sun, 23 Jul 2006 11:02:12 +0000 (11:02 +0000)]
Merge unp_bind() into uipc_bind(), as it is called only from uipc_bind().

17 years agoSince unp_attach() and unp_detach() are now called only from uipc_attach()
rwatson [Sun, 23 Jul 2006 10:25:28 +0000 (10:25 +0000)]
Since unp_attach() and unp_detach() are now called only from uipc_attach()
and uipc_detach(), merge them into their calling functions.

17 years agoMove various UNIX socket global variables and sysctls from the middle of
rwatson [Sun, 23 Jul 2006 10:19:04 +0000 (10:19 +0000)]
Move various UNIX socket global variables and sysctls from the middle of
the file to the top.

17 years agostop use of mutex lock in ICMP lookup.
ume [Sun, 23 Jul 2006 07:07:49 +0000 (07:07 +0000)]
stop use of mutex lock in ICMP lookup.

MFC after: 1 week

17 years agoExport the number of object bypasses and collapses through sysctl.
alc [Sat, 22 Jul 2006 22:31:57 +0000 (22:31 +0000)]
Export the number of object bypasses and collapses through sysctl.

17 years agoIn uipc_send() and uipc_rcvd(), store unp->unp_conn pointer in unp2
rwatson [Sat, 22 Jul 2006 18:41:42 +0000 (18:41 +0000)]
In uipc_send() and uipc_rcvd(), store unp->unp_conn pointer in unp2
while working with the second unpcb to make the code more clear.

17 years agoRe-wrap and other minor formatting and punctuation fixes for UNIX domain
rwatson [Sat, 22 Jul 2006 17:24:55 +0000 (17:24 +0000)]
Re-wrap and other minor formatting and punctuation fixes for UNIX domain
socket comments.

17 years agoImplement support for HMAC/SHA1 and HMAC/SHA256 acceleration found in
pjd [Sat, 22 Jul 2006 16:18:47 +0000 (16:18 +0000)]
Implement support for HMAC/SHA1 and HMAC/SHA256 acceleration found in
new VIA CPUs.
For older CPUs HMAC/SHA1 and HMAC/SHA256 (and others) will still be done
in software.

Move symmetric cryptography (currently only AES-CBC 128/192/256) to
padlock_cipher.c file. Move HMAC cryptography to padlock_hash.c file.

Hardware from: Centaur Technologies

17 years agoAdd initial platform support.
obrien [Sat, 22 Jul 2006 15:27:18 +0000 (15:27 +0000)]
Add initial platform support.

Submitted by: cognet

17 years agoAdd ARM platform Makefile for building disassembler.
obrien [Sat, 22 Jul 2006 14:59:50 +0000 (14:59 +0000)]
Add ARM platform Makefile for building disassembler.
(rev 1.1 was an accidental commit)

17 years agoAdd ARM platform Makefile for building BFD. We include the New ARM ABI only.
obrien [Sat, 22 Jul 2006 14:55:55 +0000 (14:55 +0000)]
Add ARM platform Makefile for building BFD.  We include the New ARM ABI only.
(rev 1.1 was an accidental commit)

17 years agoBe consistent in quoting.
obrien [Sat, 22 Jul 2006 14:37:17 +0000 (14:37 +0000)]
Be consistent in quoting.

17 years agoremove obsolete comments.
ume [Sat, 22 Jul 2006 14:36:56 +0000 (14:36 +0000)]
remove obsolete comments.

MFC after: 3 days

17 years agoCreate a genscripts driver based on the PowerPC one.
obrien [Sat, 22 Jul 2006 14:36:15 +0000 (14:36 +0000)]
Create a genscripts driver based on the PowerPC one.

17 years agoThe platform name is ARM not StrongARM.
obrien [Sat, 22 Jul 2006 14:12:02 +0000 (14:12 +0000)]
The platform name is ARM not StrongARM.

Submitted by: cognet

17 years agoTell when a .include is processed with '-dd'.
obrien [Sat, 22 Jul 2006 14:00:31 +0000 (14:00 +0000)]
Tell when a .include is processed with '-dd'.

17 years agoCorrect few bzero()s.
pjd [Sat, 22 Jul 2006 13:14:11 +0000 (13:14 +0000)]
Correct few bzero()s.

MFC after: 3 days

17 years agoNote the overhaul of asf(8).
yar [Sat, 22 Jul 2006 12:52:51 +0000 (12:52 +0000)]
Note the overhaul of asf(8).

17 years agoDon't forget to initialize crp_olen field, which is used to calculate
pjd [Sat, 22 Jul 2006 10:05:55 +0000 (10:05 +0000)]
Don't forget to initialize crp_olen field, which is used to calculate
bio_completed value.

17 years agoSet ses_ictx and ses_octx to NULL after freeing them, so we won't free
pjd [Sat, 22 Jul 2006 10:04:47 +0000 (10:04 +0000)]
Set ses_ictx and ses_octx to NULL after freeing them, so we won't free
them twice.
This is possible for example in situation when session is used in
authentication context, then freed and then used in encryption context
and freed - in encryption context ses_ictx and ses_octx are not touched
at newsession time, but padlock_freesession could still try to free them
when they are not NULL.

17 years agoFix build breakage from previous commit which confused key_abort and key_close.
gnn [Sat, 22 Jul 2006 09:18:02 +0000 (09:18 +0000)]
Fix build breakage from previous commit which confused key_abort and key_close.

17 years agoThe month name in .Dd should be spelled in full.
yar [Sat, 22 Jul 2006 07:23:46 +0000 (07:23 +0000)]
The month name in .Dd should be spelled in full.

Pointed out by: ru

17 years agoThe KAME project ceased work on IPv6 and IPSec in March of 2006.
gnn [Sat, 22 Jul 2006 02:32:32 +0000 (02:32 +0000)]
The KAME project ceased work on IPv6 and IPSec in March of 2006.
Remove the README file which warns against cosmetic or local only
changes.  FreeBSD committers should now feel free to work on the
IPv6 and IPSec code without fetters.  The KAME mailing lists still
exist and it is always a good idea to ask questions about this code
on the snap-users@kame.net mailing list.

Reviewed by: rwatson, brooks

17 years agoRetire debug.mpsafevm. None of the architectures supported in CVS require
alc [Fri, 21 Jul 2006 23:22:49 +0000 (23:22 +0000)]
Retire debug.mpsafevm.  None of the architectures supported in CVS require
it any longer.

17 years agoRemove mention of the `W' flag, which has been turned to no-op by the
sobomax [Fri, 21 Jul 2006 22:13:06 +0000 (22:13 +0000)]
Remove mention of the `W' flag, which has been turned to no-op by the
neworder change. Keep the option in a config file parser, to not
violate POLA.

MFC after: 2 weeks

17 years agoRegen.
jhb [Fri, 21 Jul 2006 20:41:33 +0000 (20:41 +0000)]
Regen.

17 years agoClean up the svr4 socket cache and streams code some to make it more easily
jhb [Fri, 21 Jul 2006 20:40:13 +0000 (20:40 +0000)]
Clean up the svr4 socket cache and streams code some to make it more easily
locked.
- Move all the svr4 socket cache code into svr4_socket.c, specifically
  move svr4_delete_socket() over from streams.c.  Make the socket cache
  entry structure and svr4_head private to svr4_socket.c as a result.
- Add a mutex to protect the svr4 socket cache.
- Change svr4_find_socket() to copy the sockaddr_un struct into a
  caller-supplied sockaddr_un rather than giving the caller a pointer to
  our internal one.  This removes the one case where code outside of
  svr4_socket.c could access data in the cache.
- Add an eventhandler for process_exit and process_exec to purge the cache
  of any entries for the exiting or execing process.
- Add methods to init and destroy the socket cache and call them from the
  svr4 ABI module's event handler.
- Conditionally grab Giant around socreate() in streamsopen().
- Use fdclose() instead of inlining it in streamsopen() when handling
  socreate() failure.
- Only allocate a stream structure and attach it to a socket in
  streamsopen().  Previously, if a svr4 program performed a stream
  operation on an arbitrary socket not opened via the streams device,
  we would attach streams state data to it and change f_ops of the
  associated struct file while it was in use.  The latter was especially
  not safe, and if a program wants a stream object it should open it via
  the streams device anyway.
- Don't bother locking so_emuldata in the streams code now that we only
  touch it right after creating a socket (in streamsopen()) or when
  tearing it down when the file is closed.
- Remove D_NEEDGIANT from the streams device as it is no longer needed.

17 years agoAdd conditional VFS Giant locking to svr4_sys_fchroot() and mark it MPSAFE.
jhb [Fri, 21 Jul 2006 20:28:56 +0000 (20:28 +0000)]
Add conditional VFS Giant locking to svr4_sys_fchroot() and mark it MPSAFE.
Also, call change_dir() instead of doing part of it inline (this now adds
a mac_check_vnode_chdir() call) to match fchdir() and call
mac_check_vnode_chroot() to match chroot().  Also, use the change_root()
function to do the actual change root to match chroot().

Reviewed by: rwatson

17 years agoAdd a comment to explain what fdclose() does and what it's purpose is
jhb [Fri, 21 Jul 2006 20:24:00 +0000 (20:24 +0000)]
Add a comment to explain what fdclose() does and what it's purpose is
since the subtlety eluded me when I looked at it last week.

17 years ago- Pass the MPSAFE flag to namei() in linux_uselib() and handle conditional
jhb [Fri, 21 Jul 2006 20:22:13 +0000 (20:22 +0000)]
- Pass the MPSAFE flag to namei() in linux_uselib() and handle conditional
  Giant VFS locking in that function.
- Remove bogus code to handle the case where namei() returns success but a
  NULL vnode pointer.
- Note that this code duplicates exec_check_permissions() and annotate
  where it differs.
- Hold the vnode lock longer to protect the write to set VV_TEXT in
  v_vflag.
- Mark linux_uselib() MPSAFE.

Reviewed by: rwatson

17 years agoIf we get an error w/o atapi sense information, just print a newline
imp [Fri, 21 Jul 2006 19:13:05 +0000 (19:13 +0000)]
If we get an error w/o atapi sense information, just print a newline
to terminate the message we started.  I get non-terminated messages
when reading audio tracks w/o this patch.

17 years agosimplification in explore_numeric: unified the post-process with
ume [Fri, 21 Jul 2006 19:02:28 +0000 (19:02 +0000)]
simplification in explore_numeric: unified the post-process with
GET_AI and GET_PORT.  Commented on an impossible case.

Obtained from: KAME
MFC after: 1 week

17 years agoRFC3493 requires use of inet_aton for AF_INET.
ume [Fri, 21 Jul 2006 19:00:22 +0000 (19:00 +0000)]
RFC3493 requires use of inet_aton for AF_INET.

Obtained from: KAME
MFC after: 1 week

17 years agoclean-up: rewrote explore_null and explore_numeric without using sentinel.
ume [Fri, 21 Jul 2006 18:57:44 +0000 (18:57 +0000)]
clean-up: rewrote explore_null and explore_numeric without using sentinel.
we do not need it since we make (at most) a single addrinfo entry in these
cases.

Obtained from: KAME
MFC after: 1 week

17 years ago- draft-ietf-ipngwg-icmp-namelookups-09
ume [Fri, 21 Jul 2006 18:55:51 +0000 (18:55 +0000)]
- draft-ietf-ipngwg-icmp-namelookups-09
- make it compilable

It still requires root privilege and is experimental.

Obtained from: KAME
MFC after: 1 week

17 years agoChange semantics of socket close and detach. Add a new protocol switch
rwatson [Fri, 21 Jul 2006 17:11:15 +0000 (17:11 +0000)]
Change semantics of socket close and detach.  Add a new protocol switch
function, pru_close, to notify protocols that the file descriptor or
other consumer of a socket is closing the socket.  pru_abort is now a
notification of close also, and no longer detaches.  pru_detach is no
longer used to notify of close, and will be called during socket
tear-down by sofree() when all references to a socket evaporate after
an earlier call to abort or close the socket.  This means detach is now
an unconditional teardown of a socket, whereas previously sockets could
persist after detach of the protocol retained a reference.

This faciliates sharing mutexes between layers of the network stack as
the mutex is required during the checking and removal of references at
the head of sofree().  With this change, pru_detach can now assume that
the mutex will no longer be required by the socket layer after
completion, whereas before this was not necessarily true.

Reviewed by: gnn

17 years agoTouch document date (Dd).
yar [Fri, 21 Jul 2006 15:57:12 +0000 (15:57 +0000)]
Touch document date (Dd).

17 years agoSince Alpha support isn't in HEAD anymore, remove Alpha-specific
yar [Fri, 21 Jul 2006 15:55:18 +0000 (15:55 +0000)]
Since Alpha support isn't in HEAD anymore, remove Alpha-specific
rc.conf(5) knobs, too: osf1_enable, unaligned_print.

17 years agoGrr we also need to set -mbig-endian to LDFLAGS. Now I can build a
cognet [Fri, 21 Jul 2006 14:07:48 +0000 (14:07 +0000)]
Grr we also need to set -mbig-endian to LDFLAGS. Now I can build a
big-endian arm world.

17 years agoImport from OpenBSD 1.168, dhartmei:
mlaier [Fri, 21 Jul 2006 09:48:13 +0000 (09:48 +0000)]
Import from OpenBSD 1.168, dhartmei:
  fix a bug in the input sanity check of DIOCCHANGERULE (not used by pfctl,
  but third-party tools). a rule must have a non-empty replacement address
  list when it's a translation rule but not an anchor call (i.e. "nat ...
  ->" needs a replacement address, but "nat-anchor ..." doesn't). the check
  confused "rule is an anchor call" with "rule is defined within an anchor".
  report from Michal Mertl, Max Laier.

Obtained from: OpenBSD
MFC after: 2 weeks

17 years agoThe contents pointed by ssi_cables[] is never changed so explicitly
delphij [Fri, 21 Jul 2006 08:45:00 +0000 (08:45 +0000)]
The contents pointed by ssi_cables[] is never changed so explicitly
declare it as const char * instead of char *.

This change have no side impact to the code itself, and is a step
forward to WARNS=6 truss(1).

17 years agoEliminate OBJ_WRITEABLE. It hasn't been used in a long time.
alc [Fri, 21 Jul 2006 06:40:29 +0000 (06:40 +0000)]
Eliminate OBJ_WRITEABLE.  It hasn't been used in a long time.

17 years agoImplement pmap_clear_write().
alc [Thu, 20 Jul 2006 23:26:22 +0000 (23:26 +0000)]
Implement pmap_clear_write().

Discussed with: cognet@

17 years agoRemove ALPHA optimization pointer for gcc flags.
imp [Thu, 20 Jul 2006 22:42:48 +0000 (22:42 +0000)]
Remove ALPHA optimization pointer for gcc flags.
Add ARM optimization pointer for gcc flags.

17 years agoOops LDFLAGS can be used to invoke gcc, so directly add -EB to {LD}.
cognet [Thu, 20 Jul 2006 22:13:59 +0000 (22:13 +0000)]
Oops LDFLAGS can be used to invoke gcc, so directly add -EB to {LD}.

17 years agoHonor ARM_BIG_ENDIAN by adding -mbig-endian to CFLAGS and -EB to LDFLAGS if
cognet [Thu, 20 Jul 2006 21:28:07 +0000 (21:28 +0000)]
Honor ARM_BIG_ENDIAN by adding -mbig-endian to CFLAGS and -EB to LDFLAGS if
it is defined.

17 years agoFix ALT_BREAK_TO_DEBUGGER on the AT91 :
cognet [Thu, 20 Jul 2006 21:03:43 +0000 (21:03 +0000)]
Fix ALT_BREAK_TO_DEBUGGER on the AT91 :
The core uart code expects the receive method to actually puts the
characters read into its buffers. For AT91, it's done in the ipend routine,
so also check if we have the alternate break sequence here.

MFC after: 3 days

17 years agoExpand locking coverage slightly to cover if_drv_flags in a few places
jhb [Thu, 20 Jul 2006 18:41:00 +0000 (18:41 +0000)]
Expand locking coverage slightly to cover if_drv_flags in a few places
where it wasn't locked.

MFC after: 3 days
Reviewed by: davidch

17 years agoAdd pmap_clear_write() to the interface between the virtual memory
alc [Thu, 20 Jul 2006 17:48:41 +0000 (17:48 +0000)]
Add pmap_clear_write() to the interface between the virtual memory
system's machine-dependent and machine-independent layers.  Once
pmap_clear_write() is implemented on all of our supported
architectures, I intend to replace all calls to pmap_page_protect() by
calls to pmap_clear_write().  Why?  Both the use and implementation of
pmap_page_protect() in our virtual memory system has subtle errors,
specifically, the management of execute permission is broken on some
architectures.  The "prot" argument to pmap_page_protect() should
behave differently from the "prot" argument to other pmap functions.
Instead of meaning, "give the specified access rights to all of the
physical page's mappings," it means "don't take away the specified
access rights from all of the physical page's mappings, but do take
away the ones that aren't specified."  However, owing to our i386
legacy, i.e., no support for no-execute rights, all but one invocation
of pmap_page_protect() specifies VM_PROT_READ only, when the intent
is, in fact, to remove only write permission.  Consequently, a
faithful implementation of pmap_page_protect(), e.g., ia64, would
remove execute permission as well as write permission.  On the other
hand, some architectures that support execute permission have
basically ignored whether or not VM_PROT_EXECUTE is passed to
pmap_page_protect(), e.g., amd64 and sparc64.  This change represents
the first step in replacing pmap_page_protect() by the less subtle
pmap_clear_write() that is already implemented on amd64, i386, and
sparc64.

Discussed with: grehan@ and marcel@

17 years ago- Remove hardcoded /etc/ntp.conf configuration file from ntpdate rc.d script
flz [Thu, 20 Jul 2006 10:07:34 +0000 (10:07 +0000)]
- Remove hardcoded /etc/ntp.conf configuration file from ntpdate rc.d script
and replace it with a new ntpdate_config variable.
- Document it in defaults/rc.conf and rc.conf.5.
- Document ntpdate_hosts in defaults/rc.conf.

Requested by: Chris Timmons <cwt@networks.cwu.edu>
Approved by: cperciva (mentor, implicit)
MFC after: 1 week

17 years agoConvert macros to use C99's syntax for macros with a variable number of
stefanf [Thu, 20 Jul 2006 09:47:15 +0000 (09:47 +0000)]
Convert macros to use C99's syntax for macros with a variable number of
arguments.

17 years agoRemove unused variables.
stefanf [Thu, 20 Jul 2006 09:38:46 +0000 (09:38 +0000)]
Remove unused variables.

17 years agoDon't use "implicit int". Move the opening { of the functions to the next
stefanf [Thu, 20 Jul 2006 09:11:08 +0000 (09:11 +0000)]
Don't use "implicit int".  Move the opening { of the functions to the next
line while there.

17 years agoSince resetting hardware takes a very long time and results in link
yongari [Thu, 20 Jul 2006 04:18:45 +0000 (04:18 +0000)]
Since resetting hardware takes a very long time and results in link
renegotiation, we only initialize the hardware only when it is
absolutely required. Process SIOCGIFADDR ioctl in em(4) when we know
an IPv4 address is added. Handling SIOCGIFADDR in a driver is
layering violation but it seems that there is no easy way without
rewritting hardware initialization code to reduce settle time after
reset.

This should fix a long standing bug which didn't send ARP packet when
interface address is changed or an alias address is added. Another
effect of this fix is it doesn't need additional delays anymore when
adding an alias address to the interface.
While I'm here add a new if_flags into softc which remembers current
prgroammed interface flags and make use of it when we have to program
promiscuous mode.

Tested by: Atanas <atanas AT asd DOT aplus DOT net>
Analyzed by: rwatson
Discussed with: -stable

17 years agoProtect EEPROM access with the driver lock.
yongari [Thu, 20 Jul 2006 04:01:54 +0000 (04:01 +0000)]
Protect EEPROM access with the driver lock.

17 years agoHonor IFF_DRV_OACTIVE in em_start_locked().
yongari [Thu, 20 Jul 2006 03:57:58 +0000 (03:57 +0000)]
Honor IFF_DRV_OACTIVE in em_start_locked().

17 years agoRegen.
jhb [Wed, 19 Jul 2006 19:03:21 +0000 (19:03 +0000)]
Regen.

17 years agoAdd conditional VFS Giant locking to svr4_sys_resolvepath() and mark it
jhb [Wed, 19 Jul 2006 19:03:03 +0000 (19:03 +0000)]
Add conditional VFS Giant locking to svr4_sys_resolvepath() and mark it
MPSAFE.

17 years agoMake svr4_sys_waitsys() a lot less ugly and mark it MPSAFE.
jhb [Wed, 19 Jul 2006 19:01:10 +0000 (19:01 +0000)]
Make svr4_sys_waitsys() a lot less ugly and mark it MPSAFE.
- If the WNOWAIT flag isn't specified and either of WEXITED or WTRAPPED is
  set, then just call kern_wait() and let it do all the work.  This means
  that this function no longer has to duplicate the work to teardown
  zombies that is done in kern_wait().  Instead, if the above conditions
  aren't true, then it uses a simpler loop to implement WNOWAIT and/or
  tracing for only stopped or continued processes.  This function still
  has to duplicate code from kern_wait() for the latter two cases, but
  those are much simpler.
- Sync the code to handle the WCONTINUED and WSTOPPED cases with the
  equivalent code in kern_wait().
- Fix several places that would return with the proctree lock still held.
- Lock the current process to prevent lost wakeup races when blocking.

17 years agoAdd a mutex to protect the list of interrupt config hooks. We do assume
jhb [Wed, 19 Jul 2006 18:53:56 +0000 (18:53 +0000)]
Add a mutex to protect the list of interrupt config hooks.  We do assume
that the only remove hook operation that can occur while processing the
hooks is to remove the currently executing hook.  This should be safe as
the existing code has assumed this already for a long time now.

Reviewed by: scottl
MFC after: 1 week

17 years agoWhitespace fix after s/dev_t/struct cdev */.
jhb [Wed, 19 Jul 2006 18:52:33 +0000 (18:52 +0000)]
Whitespace fix after s/dev_t/struct cdev */.

17 years agoCall change_dir() instead of duplicating the code in fchdir().
jhb [Wed, 19 Jul 2006 18:30:33 +0000 (18:30 +0000)]
Call change_dir() instead of duplicating the code in fchdir().

17 years agoDon't free the sockaddr in kern_bind() and kern_connect() as not all
jhb [Wed, 19 Jul 2006 18:28:52 +0000 (18:28 +0000)]
Don't free the sockaddr in kern_bind() and kern_connect() as not all
callers pass a sockaddr allocated via malloc() from M_SONAME anymore.
Instead, free it in the callers when necessary.

17 years agoDisable the pager for 'panic' and 'call' to be paranoid.
jhb [Wed, 19 Jul 2006 18:26:53 +0000 (18:26 +0000)]
Disable the pager for 'panic' and 'call' to be paranoid.

17 years agoInitialize svr4_head during MOD_LOAD rather than on demand.
jhb [Wed, 19 Jul 2006 18:26:09 +0000 (18:26 +0000)]
Initialize svr4_head during MOD_LOAD rather than on demand.

17 years agoReflect the additional support of C7 CPU's in padlock(4).
mr [Wed, 19 Jul 2006 16:31:09 +0000 (16:31 +0000)]
Reflect the additional support of C7 CPU's in padlock(4).

Submitted by: brueffer
MFC after: 1 day

17 years agoAdd a test case for closing a UDPv6 socket that has been connected to
rwatson [Wed, 19 Jul 2006 12:54:14 +0000 (12:54 +0000)]
Add a test case for closing a UDPv6 socket that has been connected to
the IPv6 loopback address.

Warns ?= 2.

17 years agoAdd very basic regression test for netinet6: create and close raw,
rwatson [Wed, 19 Jul 2006 12:10:33 +0000 (12:10 +0000)]
Add very basic regression test for netinet6: create and close raw,
UDP, and TCP IPv6 sockets.

17 years agoThe pcn does not work on NEC SV-98/2-B05 and B06.
nyan [Wed, 19 Jul 2006 11:49:22 +0000 (11:49 +0000)]
The pcn does not work on NEC SV-98/2-B05 and B06.

Submitted by: Chiharu Shibata
MFC after: 3 days

17 years agoAdd CPUTYPE support for Via C3 and C3-2 processors.
des [Wed, 19 Jul 2006 11:27:19 +0000 (11:27 +0000)]
Add CPUTYPE support for Via C3 and C3-2 processors.

MFC after: 2 weeks

17 years ago- Bring kern.random output closer to reality
brueffer [Wed, 19 Jul 2006 10:49:43 +0000 (10:49 +0000)]
- Bring kern.random output closer to reality
- Remove kern.random.sys.burst, it's no longer available
- Document kern.random.sys.harvest.swi (1)

PR: 100167 (1)
MFC after: 3 days

17 years agoRemove an unused variable.
stefanf [Wed, 19 Jul 2006 10:46:38 +0000 (10:46 +0000)]
Remove an unused variable.

17 years agoConvert sk(4) to use the new bus_alloc_resources() API and
yongari [Wed, 19 Jul 2006 04:12:59 +0000 (04:12 +0000)]
Convert sk(4) to use the new bus_alloc_resources() API and
bus_{read,write}_* macros.

Submitted by: Antoine Brodin <antoine.brodin AT laposte DOT net>
Reviewed by: imp (initial version)