Commit graph

33102 commits

Author SHA1 Message Date
Benno Rice 71cf3a3574 Add an inline to call eieio.
("Enforce In-order Execution of I/O".  I am not making this up.)
2002-06-29 10:00:07 +00:00
Benno Rice bfcf2ca287 We don't need to clear RI in the MSR when entering a critical section. 2002-06-29 09:55:57 +00:00
Benno Rice 825467cae1 Add in_cksum.c 2002-06-29 09:50:20 +00:00
Benno Rice 14d617bf1f in_cksum et al.
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:49:26 +00:00
Benno Rice a088981493 Implement vtophys() 2002-06-29 09:47:06 +00:00
Benno Rice 8bbfa33a79 Add pmap_mapdev and pmap_unmapdev. 2002-06-29 09:45:59 +00:00
Benno Rice 0d29067503 - Initialise battable to cover I/O spaces.
- Statically size the bpvo entries to avoid conflicts between bpvo allocation
  and the vm allocator.
- Shift pmap_init2 code into pmap_init.
- Add UMA_ZONE_VM flag to uma_zcreate.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:43:59 +00:00
Benno Rice 8b8aa9c1e6 To quote Peter:
The case in cpu_switch() where there isn't a higher priority thread
(choosethread() == curthread) uses r4 as the PCB context pointer. However, the
use of r4 after the label L2 is incorrect, since it was probably trashed by
the call to choosethread, and in any case was set up to curthread at the start
of the routine.

This condition will occur when an interrupt thread schedules a netisr, which
is a lower priority thread.

Another (probably unnecessary) difference is that I was paranoid about
register trashing, so I decided to save r2 and r13 as well.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:39:44 +00:00
Benno Rice a5f44e04e2 mempcy/bcopy handles overlapping copies so make ovbcopy call it. 2002-06-29 09:34:54 +00:00
Benno Rice cd0386a052 Add BOOTP_NFSROOT support code. 2002-06-29 09:33:18 +00:00
Benno Rice 637dd1a0b3 - Use tmpstk exclusively in the init path.
- Remove redundant code.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:31:27 +00:00
Benno Rice 6c2a062580 Many fixes to low-level trap and interrupt handling:
- Tidy up clock code.  Don't repeatedly call hardclock().
- Remove intrnames, decrnest and intrcnt from locore.s
- Coalesce all trap handling into a single stub that then calls a dispatch
  function.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:28:21 +00:00
Benno Rice 3f57c11ec5 Convert this from mostly inline assembler to mostly C.
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:16:30 +00:00
Julian Elischer f04af82768 Don't use the static thread.. it is going away. 2002-06-29 07:47:20 +00:00
Julian Elischer 1f1bebd1b4 remove cruft 2002-06-29 07:16:24 +00:00
Julian Elischer 44990b8cb8 Add files that are new for KSE. 2002-06-29 07:04:59 +00:00
Jake Burkholder eecc66a7d2 Fix a deletion during traversal tailq bug. 2002-06-29 06:37:24 +00:00
David E. O'Brien 87e1503e2c Rename the db command lockedvnodes to lockedvnods so that it fits on the
help screen and one doens't think we have a lockedvnodesmap command.
2002-06-29 04:45:09 +00:00
David E. O'Brien 4f1daba8df Do NOT enable ATA_STATIC_ID -- cmd646 controller will be !ata2!,
and you will not mount an ATA /:
	mountroot> ufs:/ad0a
	Mounting root from ufs:/ad0a
	setrootbyname failed
	ffs_mountroot: can't find rootvp
2002-06-29 04:42:03 +00:00
Peter Wemm 160554fbf4 Remove a couple of __P() stragglers. 2002-06-29 02:32:34 +00:00
Alfred Perlstein 016091145e more caddr_t removal. 2002-06-29 02:00:02 +00:00
Mike Silbersack f32932bc1b Add another Intel chipset (i82562).
PR:		39974
Submitted by:	Morten Aaboe Jensen <morten@codemonkey.dk>
MFC after:	1 day
2002-06-29 01:56:14 +00:00
Alfred Perlstein 7f05b0353a More caddr_t removal, make fo_ioctl take a void * instead of a caddr_t. 2002-06-29 01:50:25 +00:00
Alfred Perlstein 69a3693f3e catch up with mextadd callback taking a void argument instead of a caddr_t. 2002-06-29 01:49:22 +00:00
Alfred Perlstein 914596ab53 catch up with ext_free prototype change. 2002-06-29 01:36:59 +00:00
Alfred Perlstein 802082390b More caddr_t removal.
Change struct knote's kn_hook from caddr_t to void *.
2002-06-29 00:29:12 +00:00
Alfred Perlstein a551e20e27 nuke more instances of caddr_t 2002-06-29 00:02:01 +00:00
Alfred Perlstein 337f75e11c m_extadd takes a void (*freef)(void *, void *) now, not a
void (*freef)(caddr_t, void *).
2002-06-29 00:01:46 +00:00
Alfred Perlstein 64f0b9d749 remove or replace caddr_t with void.
make the mbuf external free function take a void * rather than caddr_t.
2002-06-28 23:48:23 +00:00
Alfred Perlstein 210a5a7169 nuke caddr_t. 2002-06-28 23:17:36 +00:00
Alfred Perlstein 02a32cd207 change struct socket -> so_pcb from caddr_t to void *. 2002-06-28 23:17:08 +00:00
Alfred Perlstein a788442584 Remove unneeded casts to caddr_t. 2002-06-28 23:02:38 +00:00
Alfred Perlstein b555662c63 change f_data field in struct file from caddr_t to void *. 2002-06-28 23:00:32 +00:00
Alfred Perlstein 52545a237b document that the pipe fo_stat routine doesn't need locks because it's
a read operation.

Requested by: rwatson
2002-06-28 22:35:12 +00:00
John Baldwin 56e9ce41a5 In namei(), we use a NULL thread for uio_td when doing a VOP_READLINK().
nfs_readlink() calls nfs_bioread() which passes in uio_td as the thread
argument to nfs_getcacheblk().  In nfs_getcacheblk() we dereference the
thread pointer to get a process pointer to pass to nfs_sigintr().  This
obviously results in a panic. :)

Rather than change nfs_getcacheblk() to check if the thread pointer is
NULL when calling nfs_sigintr() like other callers do, change
nfs_sigintr() to take a thread as the last argument instead of a
process so none of the callers have to care if the thread is NULL or not.
2002-06-28 21:53:08 +00:00
Poul-Henning Kamp 77f6a083fc Add two new submodes to the AES encryption method.
This method is now suitable for encrypting swap spaces.

Sponsored by:	DARPA & NAI Labs.
2002-06-28 21:25:15 +00:00
Jeff Roberson 90769c9ed0 Improve the VOP locking asserts
- Add vfs_badlock_print to control whether or not we print lock violations
 - Add vfs_badlock_panic to control whether we panic on lock violations

Both default to on to mimic the original behavior if DEBUG_VFS_LOCKS is on.
2002-06-28 20:58:14 +00:00
Ian Dowse 84b2995b2f In vn_mkdir(), use vrele() instead of vput() on the parent directory
vnode in the case that the target exists and is the same vnode as
the parent (i.e. "mkdir ."). The namei() call does not leave the
vnode locked in this case even though you might expect it to.

This bug was mostly harmless in practice because unlocking an already
unlocked vnode currently does not trigger any panics or warnings.

Reviewed by:	jeff
2002-06-28 20:06:47 +00:00
Jonathan Lemon 0080a004d7 One possible code path for syncache_respond() is:
syncache_respond(A), ip_output(), ip_input(), tcp_input(), syncache_badack(B)

Which winds up deleting a different entry from the syncache.  Handle
this by not utilizing the next entry in the timer chain until after
syncache_respond() completes.  The case of A == B should not be possible.

Problem found by: Don Bowman <don@sandvine.com>
2002-06-28 19:12:38 +00:00
Jeff Roberson 5c71bc6cf2 Clean up vn_rdwr locking.
- Do shared locks on read.
 - Only do vn_{start,finished}_write when writing.
2002-06-28 17:51:11 +00:00
Brian Feldman aac12bcfbc Fix a case where a vnode got explicitly unlocked after the pointer to it
got set to NULL.

Revision 1.355: in the box
2002-06-28 16:17:47 +00:00
Doug Rabson 24f8fd9fd1 Fix warning.
Reviewed by: luigi
2002-06-28 08:36:26 +00:00
Julian Elischer 3c9a1810ff bring Makefile up to date with new ipfw
Submitted by:	luigi
2002-06-28 08:10:07 +00:00
Scott Long 63393eea99 Fix a botched flag clear operation. Rumor has it that this also fixes
the funky-volume-settings-on-startup problem.

Reviewed by:	the channel that shall not be named
MFC after:	7 days
2002-06-28 06:11:26 +00:00
Luigi Rizzo d26d355f0e Remove a printf and add a comment on an assumption that could be
occasionally violated by device drivers.
2002-06-27 23:23:04 +00:00
Luigi Rizzo 9758b77ff1 The new ipfw code.
This code makes use of variable-size kernel representation of rules
(exactly the same concept of BPF instructions, as used in the BSDI's
firewall), which makes firewall operation a lot faster, and the
code more readable and easier to extend and debug.

The interface with the rest of the system is unchanged, as witnessed
by this commit. The only extra kernel files that I am touching
are if_fw.h and ip_dummynet.c, which is quite tied to ipfw. In
userland I only had to touch those programs which manipulate the
internal representation of firewall rules).

The code is almost entirely new (and I believe I have written the
vast majority of those sections which were taken from the former
ip_fw.c), so rather than modifying the old ip_fw.c I decided to
create a new file, sys/netinet/ip_fw2.c .  Same for the user
interface, which is in sbin/ipfw/ipfw2.c (it still compiles to
/sbin/ipfw).  The old files are still there, and will be removed
in due time.

I have not renamed the header file because it would have required
touching a one-line change to a number of kernel files.

In terms of user interface, the new "ipfw" is supposed to accepts
the old syntax for ipfw rules (and produce the same output with
"ipfw show". Only a couple of the old options (out of some 30 of
them) has not been implemented, but they will be soon.

On the other hand, the new code has some very powerful extensions.
First, you can put "or" connectives between match fields (and soon
also between options), and write things like

ipfw add allow ip from { 1.2.3.4/27 or 5.6.7.8/30 } 10-23,25,1024-3000 to any

This should make rulesets slightly more compact (and lines longer!),
by condensing 2 or more of the old rules into single ones.

Also, as an example of how easy the rules can be extended, I have
implemented an 'address set' match pattern, where you can specify
an IP address in a format like this:

        10.20.30.0/26{18,44,33,22,9}

which will match the set of hosts listed in braces belonging to the
subnet 10.20.30.0/26 . The match is done using a bitmap, so it is
essentially a constant time operation requiring a handful of CPU
instructions (and a very small amount of memmory -- for a full /24
subnet, the instruction only consumes 40 bytes).

Again, in this commit I have focused on functionality and tried
to minimize changes to the other parts of the system. Some performance
improvement can be achieved with minor changes to the interface of
ip_fw_chk_t. This will be done later when this code is settled.

The code is meant to compile unmodified on RELENG_4 (once the
PACKET_TAG_* changes have been merged), for this reason
you will see #ifdef __FreeBSD_version in a couple of places.
This should minimize errors when (hopefully soon) it will be time
to do the MFC.
2002-06-27 23:02:18 +00:00
Scott Long f4df40b218 Delay the AC97 calibration until after the system clock has been
calibrated.  This fixes the problem where playback and recording do
not run at the correct speed.  It probably also eliminates the
need for the hacks/workarounds/sysctl's that were previously
devised to deal with this, but I will leave that for a different
time.

Reviewed by:	orion
2002-06-27 22:36:01 +00:00
Warner Losh d65d5bbff5 Lots of people have had to hack around the fixed address for cardbus
bridges in modern hardware (that hardware w/ lots of RAM).  Raise the
address from 0x44000000 to 0x88000000 to match what we do with
NEWCARD.  However, this really should be done in the pci layer.
2002-06-27 19:56:22 +00:00
Robert Watson 600c1a5a8e Fix a bug that prevented the deletion of non-default ACLs from being
passed down the VFS stack.  While I'm here, replace a '0' with a 'NULL'
to make the code more readable.

Sponsored by:	DARPA, NAI Labs
Obtained from:	TrustedBSD Project
2002-06-27 19:31:15 +00:00
Robert Watson cbeb840245 A bit of whitespace magic. 2002-06-27 19:30:11 +00:00