Commit Graph

103262 Commits

Author SHA1 Message Date
phk
a9af1dba3e Ditch K&R function style 2004-06-09 10:16:14 +00:00
phk
3692195f5a Reference count struct tty.
Add two new functions: ttyref() and ttyrel().  ttymalloc() creates a struct
tty with a reference count of one.  when ttyrel sees the count go to zero,
struct tty is freed.

Hold references for open ttys and for ttys which are controlling terminal
for sessions.

Until drivers start using ttyrel(), this commit will make no difference.
2004-06-09 09:41:30 +00:00
phk
1777f5359e Fix a race in destruction of sessions. 2004-06-09 09:29:08 +00:00
phk
5989134159 Move PTY private defines into PTY private files. 2004-06-09 09:09:54 +00:00
obrien
2ad1b2602b style.Makefile(5) 2004-06-09 08:27:05 +00:00
imp
5e2e0b3618 Only match cards that claim to be network cards. I've had two
different cards that matched vendor/id, but weren't wi cards.  This is
because the vendor foolishly didn't have unique product ids.  Symbol
has a serial card that would otherwise match the wi driver, for
example...

Taken from a patch for xe posted by: Carlos Velasco
2004-06-09 06:31:40 +00:00
rwatson
7e4c9eb30f Introduce a netisr to deliver kernel-generated routing, avoiding
recursive entering of the socket code from the routing code:

- Modify rt_dispatch() to bundle up the sockaddr family, if any,
  associated with a pending mbuf to dispatch to routing sockets, in
  an m_tag on the mbuf.

- Allocate NETISR_ROUTE for use by routing sockets.

- Introduce rtsintrq, an ifqueue to be used by the netisr, and
  introduce rts_input(), a function to unbundle the tagged sockaddr
  and inject the mbuf and address into raw_input(), which previously
  occurred in rt_dispatch().

- Introduce rts_init() to initialize rtsintrq, its mutex, and
  register the netisr.  Perform this at the same point in system
  initialization as setup of the domains.

This change introduces asynchrony between the generation of a
pending routing socket message and delivery to sockets for use
by userspace.  It avoids socket->routing->rtsock->socket use and
helps to avoid lock order reversals between the routing code and
socket code (in particular, raw socket control blocks), as route
locks are held over calls to rt_dispatch().

Reviewed by:		"George V.Neville-Neil" <gnn@neville-neil.com>
Conceptual head nod by:	sam
2004-06-09 02:48:23 +00:00
naddy
d9a8ed2dbc Replace convoluted and broken CRC calcuation with ether_crc32_le().
This should fix multicast reception.
2004-06-09 00:30:11 +00:00
naddy
e0b9dbe1ef * Fix multicast reception.
* Replace handrolled crc calculation with ether_crc32_le().

Based on:

PR:		67544
Submitted by:	HASHI Hiroaki <hashiz@tomba.cskk-sv.co.jp>
2004-06-09 00:25:44 +00:00
darrenr
48a1651c6d Recognise NOINET6 as an indication to not build IPv6 enabled source even
if FreeBSD header files, etc, support it.

Submitted by:	Sergey Mokryshev <mokr@mokr.net>
2004-06-08 23:52:22 +00:00
obrien
7a1212a9ab Back out rev 1.3.
This is one of the few RC scripts that doesn't use rc.subr, and thus
doesn't source rc.conf. :-(
2004-06-08 19:53:25 +00:00
brueffer
8ae1718f93 Fix typo
Obtained from:	DragonFly BSD
MFC after:	3 days
2004-06-08 17:36:17 +00:00
csjp
a8bd7fdeab Add note that rmuser will clean up any IPC mechanisms owned by the user.
Approved by:	bmilekic (mentor)
2004-06-08 14:52:55 +00:00
stefanf
1d1f53a52d Remove an #if section originally written for Sun compilers. 2004-06-08 13:46:31 +00:00
stefanf
ce8e58fb1a Avoid assignments to cast expressions.
Reviewed by:	md5
Approved by:	das (mentor)
2004-06-08 13:08:19 +00:00
stefanf
484004ba16 Signal handlers are supposed to take an int parameter.
Approved by:	das (mentor)
2004-06-08 12:24:47 +00:00
stefanf
b9b627bcfb Remove a couple of casts added for an ancient Sun compiler.
Approved by:	das (mentor)
2004-06-08 12:20:40 +00:00
stefanf
289dfdc6d7 - Don't use argv[i] when i is uninitialised.
- Cast isdigit's argument to unsigned char.
- Remove the now unused variable i.

Approved by:	das (mentor)
2004-06-08 12:11:19 +00:00
stefanf
ff9fc1604c The third operand of the conditional operator should have type void too.
Approved by:	das (mentor)
2004-06-08 12:03:48 +00:00
joerg
19b03b5b57 Implement the BREAK_TO_DEBUGGER option for sab(4). 2004-06-08 11:58:34 +00:00
rik
3e982e3588 1. struct tty => struct tty *tty.
Requested by:	phk
2004-06-08 10:38:20 +00:00
tjr
687eba3097 Remove remnants of PGINPROF. 2004-06-08 10:37:30 +00:00
yar
2043932b5a Touch .Dd (date) since new functionality has been documented.
Reminded by:	ru
2004-06-08 09:54:53 +00:00
das
7a9a1abd40 If we are asked to print the total number of blocks, do so even if we
have no entries to print (either due to an empty directory or an
error).  This makes the -l and -s options more consistent, like
Solaris and (Debian) Linux.  To make this happen, tweak two
optimizations on the second call to display():

- Don't skip display() altogether, even if list == NULL.
- Don't skip the call to the printfn in display() if we
  need to print the total.

PR:	45723
2004-06-08 09:30:10 +00:00
das
e79220be15 Remove from the printfns the assumption that dp->list != NULL. Even
if there are no entries, these functions may be called to print the
total number of blocks (0) for consistency's sake.
2004-06-08 09:27:42 +00:00
yar
9db7d2a055 Make the legend to the table of interface flags compact
for the reader's convenience.

Suggested by:	ru
2004-06-08 09:01:37 +00:00
yar
296cb81853 Describe how polling(4) applies to network interfaces.
Reviewed by:	ru
2004-06-08 08:48:49 +00:00
das
d6567c3dfa In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode.  Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

	das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
	das@VARK:~> oldls t
	a       b       c
	das@VARK:~> oldls -l t
	das@VARK:~> \ls t
	a       b       c
	das@VARK:~> \ls -l t
	ls: a: Permission denied
	ls: b: Permission denied
	ls: c: Permission denied

I had forgotten about this patch until bde reminded me.  He reports
using it without problems for over a year.

PR:	45723
2004-06-08 06:23:23 +00:00
das
ad77780229 Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
Also, don't set errno if prepwrite() fails, since this is done in
prepwrite() now.
2004-06-08 05:45:48 +00:00
das
6b17d45905 Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
2004-06-08 05:45:32 +00:00
das
e3d5e6f3ff Set errno to EBADF on attempts to write to a stream that is not
writable.  Affected callers include fwrite(), put?(), and *printf().
The issue of whether this is the right errno for funopened streams is
unresolved, but that's an obscure case, and some errno is better than
no errno.

Discussed with:	bde, jkh
2004-06-08 05:44:52 +00:00
peter
92508cd80c In pmap_extract_and_hold(), there is no need to mask off PG_FRAME because
pmap_extract() already does it.
In pmap_enter(), opa has already been masked so don't do it again.
Wrap a long line (recent transgression).
Use trunc_page() in pmap_mapdev() instead of anding with PG_FRAME, since
that is what we really meant.

Submitted by:  alc (first item)
2004-06-08 02:20:40 +00:00
peter
706753b80a Fix my silly typo in asm statement in previous commit. 2004-06-08 01:35:48 +00:00
peter
425146ee78 Argh. Remove stray number that slipped into the previous commit. 2004-06-08 01:20:37 +00:00
peter
e0e0263306 Reapply rev 1.151 after enable sse/fpuinit order fixed in mp_machdep.c
Obtained from:  das
2004-06-08 01:14:39 +00:00
peter
388d5d92b5 Set up the fpu *after* enabling SSE mode on AP's
Submitted by: (argh, I can't find the email)
2004-06-08 01:07:51 +00:00
peter
56777bd5f3 Initial PG_NX support (no-execute page bit)
- export the rest of the cpu features (and amd's features).
- turn on EFER_NXE, depending on the NX amd feature bit
- reorg the identcpu stuff a bit in order to stop treating the
  amd features as second class features (since it is now a primary feature
  bit set) and make it easier to export.
2004-06-08 01:02:52 +00:00
peter
2eebe98baa Mask pte's with PG_FRAME before passing it to PHYS_TO_VM_PAGE().. PG_NX
lives in the top 12 'available' bits.  atop() in the PHYS_TO_VM_PAGE()
macro only masks off the lower bits (by accident) and the upper bits
in the 64 bit ptes turn into "interesting" index values.
2004-06-08 00:29:42 +00:00
kientzle
6d40bbe5d3 Correct some spelling errors. 2004-06-08 00:23:27 +00:00
peter
0381d90bc7 Use trunc_page(va) when we mean it rather than anding it with PG_FRAME
(which doesn't work all that well when there are bits at the top that are
 masked by PG_FRAME)
2004-06-08 00:11:32 +00:00
peter
36f89568ed Fix a serious problem that manifested during swap, and a few other times.
pmap_remove() would be called with a huge range and we'd stride across
it in only 2MB chunks.  This would manifest as massive cpu time and a
largely unresponsive system during hard swap.  Instead, check the higher
page directories which means we can run pmap_remove() in just a few
hundred loop iterations instead of millions since we can process
address space in chunks of 512GB and 1GB as well as 2MB.

Eternal thanks to:  tmm
2004-06-07 23:51:20 +00:00
peter
e5001f283a Be a little more consistent in the naming of the PML4 defines. 2004-06-07 23:47:59 +00:00
murray
e81bccb9c6 Note that FIPS does not work on extended partitions, and that
Windows 95/98/ME FAT32 primary partition ARE supported.

Submitted by:	 "Ted Mittelstaedt" <tedm@toybox.placo.com>
MFC After:	 1 week
2004-06-07 22:57:05 +00:00
julian
1d6631d830 Now that mbufs are allocated using uma,
don't check for accidental usage of mbuf 'how' flags as
they are the same thing.
2004-06-07 22:11:12 +00:00
gad
a8521e48da Drop the include for <stdint.h>, it was only needed when this was
using __DECONST() for something, and that reference has been removed.

Noticed by:	Helge Oldach
MFC after:	13 days
2004-06-07 21:53:27 +00:00
yar
6e310cc807 Use ".In" to mark up C include file names. 2004-06-07 21:52:20 +00:00
yar
640bee0ab3 Each sentence should begin on a new line. 2004-06-07 21:48:02 +00:00
rwatson
f78dd34491 Correct a resource leak introduced in recent accept locking changes:
when I reordered events in accept1() to allocate a file descriptor
earlier, I didn't properly update use of goto on exit to unwind for
cases where the file descriptor is now held, but wasn't previously.
The result was that, in the event of accept() on a non-blocking socket,
or in the event of a socket error, a file descriptor would be leaked.

This ended up being non-fatal in many cases, as the file descriptor
would be properly GC'd on process exit, so only showed up for processes
that do a lot of non-blocking accept() calls, and also live for a long
time (such as qmail).

This change updates the use of goto targets to do additional unwinding.

Eyes provided by:	Brian Feldman <green@freebsd.org>
Feet, hands provided by:	Stefan Ehmann <shoesoft@gmx.net>,
				Dimitry Andric <dimitry@andric.com>
				Arjan van Leeuwen <avleeuwen@piwebs.com>
2004-06-07 21:45:44 +00:00
njl
d6c3608c33 Remove accidental change. 2004-06-07 21:44:01 +00:00
yar
042e9576f3 Extend and improve the mdoc(7) markup of this page.
Reviewed by:	ru
2004-06-07 21:43:14 +00:00