Commit graph

38741 commits

Author SHA1 Message Date
Poul-Henning Kamp 194a0abf73 PHCC[1]:
I had commented the #ifdef INVARIANTS checks out to make sure I ran this
code in all kernels and forgot to comment the #ifdefs back in before I
committed.

Spotted by:	bmilekic

[1] PHCC = Pointy Hat Correction Commit
2003-03-10 20:24:54 +00:00
Poul-Henning Kamp d3c11994e1 Make malloc and mbuf allocation mode flags nonoverlapping.
Under INVARIANTS whine if we get incompatible flags.

Submitted by:   imp
2003-03-10 19:39:53 +00:00
John Baldwin 0e8677f68b Now that we have WITNESS_WARN(), we only call witness_list() from the
ddb 'show locks' command.  Thus, move witness_list() to the #ifdef DDB
section and remove extra checks for calling this function outside of
DDB.  Also, witness_list() now returns void instead of returning an int.

Reported by:	Steve Ames <steve@energistic.com>
Prodded by:	davidxu
2003-03-10 17:03:57 +00:00
Søren Schmidt cad57b089a Remove the enclose_print() call, it is already called from ata-disk.c 2003-03-10 08:20:57 +00:00
Søren Schmidt 7b4cb338ac Dont use r_bmio on Cyrix chips if not set from BIOS. 2003-03-10 08:20:14 +00:00
Marcel Moolenaar e9523c31c5 Fix two rounds of breakages and cleanup. Remove the sccdebug sysctl
while I'm here and garbage collect dead code (ssc_clone). Define
d_maxsize as DFLTPHYS for now because that's what it will be if we
don't define it.
2003-03-10 01:58:31 +00:00
David Malone fca9a10bc1 Add a a sysctl, hw.kbd.keymap_restrict_change, which acts a bit
like secure level but which restricts changes to the keymap. Its
values impose the following restrictions:

0: No restriction - this is the default.
1: Only root can change restricted keys (like boot, panic, ...)
2: Only root can change restricted keys and regular keys.
   Other users still can change accents and function keys.
3: Only root can change restricted keys, regular keys and accents.
4: Only root can change any of the keymap (restricted keys, regular
      keys, accents and function keys).

Unfortunately, the keyboard's accent map is cleared when a new keymap
is loaded, which makes the distinction between level 3 and level 4
less useful.

The MAC guys might like to make this a policy?

No objections from: -audit about 6 moths ago
2003-03-09 22:49:48 +00:00
Poul-Henning Kamp 45901e280b Don't call make_dev() before we are ready for it. 2003-03-09 20:42:49 +00:00
Alan Cox 167b972088 Remove some unnecessary actions by the zero-copy setup and teardown code.
Remove an incorrect comment.  (Incrementing an object's reference count
does not prevent a process from exiting.  The real concern here is that the
physical page must not be deleted until transmission is complete.  That is
already handled by the VM system and sf_buf_free().)

Tested by:	ken
2003-03-09 20:38:56 +00:00
Shunsuke Akiyama 20280807ca Fix device freeze to reduce output packet size.
And make this value configurable by kernel config or sysctl.
2003-03-09 11:50:27 +00:00
Shunsuke Akiyama 4e6f1adc6b Fix page fault with FTDI's USB serial device.
Fix lost characters counting.
Move setting receiver state to proper place on ucomstopread().
2003-03-09 11:33:26 +00:00
Shunsuke Akiyama 86aa13bdbf Fix duplicate sc_dying usage.
All drivers which depend on ucom interfaces should use only one
sc_dying.
2003-03-09 11:19:18 +00:00
Shunsuke Akiyama 5ce609f75b Add missing module dependency. 2003-03-09 11:14:34 +00:00
Poul-Henning Kamp d42ee4e410 Note that MAJOR_AUTO is now the default if d_maj is not initialized. This
is more robust and prevents the hijacking of /dev/console for the typical
mistake.

Remove unneeded MAJOR_AUTO uses, it is only needed explicitly now if the
driver source has cross-branch compatibility to old releases.
2003-03-09 11:03:45 +00:00
Poul-Henning Kamp 441931b53c Define MAJOR_AUTO as zero, which means that leaving out an initialization
of d_maj means "allocate major number automatically".

Keep the definition of MAJOR_AUTO to make life easier for cross-branch
source maintainers.
2003-03-09 10:29:20 +00:00
Poul-Henning Kamp 06a8bb906c Add one little hack to allow us to make MAJOR_AUTO be zero:
Let the console driver ask for major 256 and magically change this to
mean zero.
2003-03-09 10:28:05 +00:00
Yoshihiro Takahashi e76a843b59 MFi386: revision 1.1079 2003-03-09 10:20:16 +00:00
Yoshihiro Takahashi 26db0f997b Merged from sys/dev/syscons/syscons.c revision 1.396. 2003-03-09 10:18:15 +00:00
Yoshihiro Takahashi 947878824d Merged from sys/dev/sio/sio.c revisions 1.387 and 1.388. 2003-03-09 10:15:11 +00:00
Yoshihiro Takahashi 484be8eac1 Build the drm module also on pc98. 2003-03-09 10:12:58 +00:00
Poul-Henning Kamp 564632b081 Remove unneeded #include of geom_stats.h 2003-03-09 10:04:21 +00:00
Poul-Henning Kamp f48b881942 Stamp out Danglish. 2003-03-09 10:02:31 +00:00
Poul-Henning Kamp 0e6be4723b Don't use statistics counters to detect outstanding I/O. 2003-03-09 10:01:16 +00:00
Poul-Henning Kamp c6ae9b5fd2 Don't abuse the statistics counters for detecting if we have outstanding
I/O requests, instead use the new dedicated fields in the consumer and
provider to track this.
2003-03-09 09:59:48 +00:00
Poul-Henning Kamp 0e082fcca2 Add u_int nstart, nend counters to consumer and providers so we will not
have to examine the stats structure to tell if we have outstanding I/O
requests.

Making them u_int improves the chance of atomic updates to them,
but risks roll-over.  Since the only interesting property is if
they are equal or not, this is not an issue.
2003-03-09 09:58:36 +00:00
Poul-Henning Kamp df6c9fe955 When a DEV class consumer is orphan'ed we need to wait for all the
outstanding requests to return before we unravel the mesh.

It is very important that the stuff below us plays nice and don't
overlook a couple of outstanding bio's, because until they remember
the geom event thread is blocked.  At an expense in code here this
could be made more robust, but I actually _want_ a robust failure
in this case so any offending drivers can be fixed.
2003-03-09 09:28:45 +00:00
David Xu d03c79eea1 Cosmetic change, make it QUEUE_MACRO_DEBUG friendly 2003-03-09 04:27:46 +00:00
Eric Anholt 43e2d1e384 Update the DRM to latest from DRI CVS. This is approximately the version
included in XFree86 4.3, but includes some fixes.  Notable changes include
Radeon 8500-9100 support, PCI Radeon/Rage 128 support, transform & lighting
support for Radeons, and vblank syncing support for r128, radeon, and mga.
The gamma driver was removed due to lack of any users.
2003-03-09 02:08:30 +00:00
Tim J. Robbins ef3dab76bf Hold the proc lock while accessing p_procsig in trapsignal(). 2003-03-09 01:40:55 +00:00
Jonathan Lemon fb68148f4a Discard the packet if the netisr queue is null instead of panicing, for
the benefit of modules which are compiled differently than the kernel.
2003-03-08 22:12:32 +00:00
Jonathan Lemon a3b6edc353 Remove check for t_state == TCPS_TIME_WAIT and introduce the tw structure.
Sponsored by: DARPA, NAI Labs
2003-03-08 22:07:52 +00:00
Jonathan Lemon 607b0b0cc9 Remove a panic(); if the zone allocator can't provide more timewait
structures, reuse the oldest one.  Also move the expiry timer from
a per-structure callout to the tcp slow timer.

Sponsored by: DARPA, NAI Labs
2003-03-08 22:06:20 +00:00
Jonathan Lemon 921f8bb982 Fix module build by adding options to Makefile. 2003-03-08 21:54:32 +00:00
Poul-Henning Kamp f37de12275 Retire devstat_add_entry() as a public function and bump __FreeBSD_version
to mark this act.
2003-03-08 21:46:43 +00:00
Poul-Henning Kamp a9d2245ea8 Allocate the devstat structure with devstat_new_entry(). 2003-03-08 21:44:46 +00:00
John Polstra 537b41d5ff Correct names for fxp devices. Sort data by devid in
fxp_ident_table.

PR:		kern/48699
Submitted by:	Sergey A. Osokin <osa@FreeBSD.org.ru>
Obtained from:	NetBSD (the device strings, that is)
MFC after:	4 weeks
2003-03-08 21:44:21 +00:00
Poul-Henning Kamp 8098046099 Allocate the devstat structure with devstat_new_entry(). 2003-03-08 21:32:59 +00:00
Poul-Henning Kamp 09f958046c Allocate devstat structure with devstat_new_entry(). 2003-03-08 20:00:11 +00:00
Poul-Henning Kamp c7e73d59c4 Introduce a device driver for /dev/devstat, this will allow us to mmap
the device statistics structures into userland instead of using sysctl.

Introduce new devstat_new_entry() function which allocates the devstat
structure an calls devstat_add_entry() on it.
2003-03-08 19:58:57 +00:00
Poul-Henning Kamp bfd614b8a5 Augment the devstat structure with 3 new fields and bump the DEVSTAT_VERSION.
Two fields are sequence numbers for integrity check when we switch devstat
to use mmap to export data rather than sysctl, the last field is to mark
this as an allocated devstat entry.
2003-03-08 19:55:59 +00:00
Jonathan Lemon 06acad4aa4 Revert last change and insure the driver can support other address families.
Pointed out by: ume, matusita
2003-03-08 17:32:21 +00:00
Jonathan Lemon e0e6419344 The tun driver is INET only. Don't pretend to support other address families.
Sponsored by: DARPA, NAI Labs
2003-03-08 16:26:34 +00:00
Jonathan Lemon 8c90439d70 Include correct opt_* headers for supported address families. Dike out
the unused ATM cases.

Sponsored by: DARPA, NAI Labs
2003-03-08 16:25:27 +00:00
Poul-Henning Kamp 60794e0478 Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.
2003-03-08 08:01:31 +00:00
Tim J. Robbins 74c69254e6 Remove unimplemented IP-in-IPX encapsulation support (options IPTUNNEL). 2003-03-08 06:58:22 +00:00
Kenneth D. Merry 9b80d344ec Zero copy send and receive fixes:
- On receive, vm_map_lookup() needs to trigger the creation of a shadow
  object.  To make that happen, call vm_map_lookup() with PROT_WRITE
  instead of PROT_READ in vm_pgmoveco().

- On send, a shadow object will be created by the vm_map_lookup() in
  vm_fault(), but vm_page_cowfault() will delete the original page from
  the backing object rather than simply letting the legacy COW mechanism
  take over.  In other words, the new page should be added to the shadow
  object rather than replacing the old page in the backing object.  (i.e.
  vm_page_cowfault() should not be called in this case.)  We accomplish
  this by making sure fs.object == fs.first_object before calling
  vm_page_cowfault() in vm_fault().

Submitted by:	gallatin, alc
Tested by:	ken
2003-03-08 06:58:18 +00:00
David Xu b4508d7d3f Lock sched_lock before modifying td_flags. 2003-03-08 04:09:04 +00:00
David Xu 1108975fe0 Initialize eflags in fake frame to default value rather than random one.
The random value sometimes causes macro CLKF_USERMODE to return true
because PSL_VM bit is set and really shoudn't be, this causes statclock()
to execute in wrong path, and further breaks KSE code and kernel crashes
when executing threaded program.
2003-03-08 03:58:50 +00:00
Kirk McKusick 34968037b1 Use the appropriate size when zeroing out the unused portion
of a snapshot's copy of a superblock. This patch fixes a panic
when taking a snapshot of a 4096/512 filesystem.

Reported by:	Ian Freislich <ianf@za.uu.net>
Sponsored by:   DARPA & NAI Labs.
2003-03-07 23:49:16 +00:00
Andrey A. Chernov 864b284996 Replace u_int with "unsigned int" to prevent following errors:
#include <sys/types.h>
#include <sys/stat.h>

main () {
}

cc -D_POSIX_C_SOURCE test.c
/usr/include/sys/stat.h:127: syntax error before "u_int"
/usr/include/sys/stat.h:158: syntax error before "u_int"

(u_int becomes invisible for _POSIX_C_SOURCE and some other *_SOURCE modes)
2003-03-07 23:11:37 +00:00
Rob Braun d132c84f07 Fix a spelling error.
Submitted by:	jkh
Reviewed by:	zarzycki
2003-03-07 22:47:32 +00:00
John Baldwin 9722121a3c Respect any passed in external lockmgr flags such as LK_NOWAIT in the
default implementations of VOP_LOCK() and VOP_UNLOCK().

Tested by:	jlemon, phk
Glanced at by:	jeffr
2003-03-07 20:45:07 +00:00
Poul-Henning Kamp ea6ff0649f Limit our requests to DFLTPHYS, this is generally a good idea for
memory-allocation purposes.  Right now it is also a very good idea
because we hit a Giant assertion in the free(9) processing if we
free something larger than 64k.
2003-03-07 19:09:46 +00:00
Tim J. Robbins f69d0d7067 Set f_fstypename in coda_nb_statfs(). 2003-03-07 09:18:15 +00:00
Tom Rhodes ff470880ba Fix a few spelling errors.
Submitted by:	Stefan Farfeleder <stefan@fafoe.dyndns.org> via -doc.
2003-03-07 03:24:38 +00:00
Hidetoshi Shimokawa 3b79dd164b - improve timeout handling in fwmem.c
- stop processing of TX db if we reaches the end of active db.
2003-03-07 02:51:59 +00:00
Justin T. Gibbs 2cd3cc377a aic79xx.c:
Include read streaming in the PPR flags we display in diagnostics.

	In ahd_reset(), set the known mode after our initial pause prior to
	setting the mode. We can't just set the mode directly because the
	current mode, after the pause, is most likely unknown and setting the
	mode when the saved mode is unknown will trigger an assertion in
	the mode debug code.

	Complete an audit for SCB RAM reads.  These reads must be performed
	via the special ahd_in?_scbram() methods so we can perform a
	Rev A. PCI-X workaround.

	Remove a superfluous mode save operation that was performed just
	prior to a call to ahd_clear_critical_section().  The saved mode
	was never restored and wouldn't have been valid anyway since the
	mode could change while single stepping out of a critical section.

aic79xx.h:
	Add new BUG definition AHD_PCIX_SCBRAM_RD_BUG.

aic79xx_inline.h:
	Update ahd_inb_scbram routine to check for AHD_PCIX_SCBRAM_RD_BUG
	and only apply the workaround if this bug is active.  The old code
	applied the workaround in all cases.

aic79xx_pci.c:
	Set AHD_PCIX_SCBRAM_RD_BUG for the A4.

	Remove an attempted saved_modes call in ahd_pci_test_register_access().
	Saving the modes can only occur when we are paused, but the call was
	happening before the chip was known to be paused.  Restoring the
	modes doesn't make sense either since the code makes no assumptions
	about the state of the sequencer until the first time the mode is set
	by the driver.  This happens after the registers are successfully
	mapped.
2003-03-06 23:58:34 +00:00
Kirk McKusick 9a9906281f When the system is panicing, the lock manager grants all lock
requests whether or not the lock is available. To avoid "unlocked
buffer" panics after a crash, we just claim that all buffers
are locked when cleaning up after a system panic.

Reported by:	Attila Nagy <bra@fsn.hu>
Sponsored by:   DARPA & NAI Labs.
2003-03-06 21:40:07 +00:00
John Baldwin 9da590b49b Oops, fix the double faults people were seeing with the recent changes to
witness.  Sleepable locks such as sx locks always come before all mutexes
including Giant.  However, the static lock order list placed Giant before
the proctree and allproc sx locks.  This resulted in witness creating a
cycle in its lock order "tree" (real trees don't have cycles) leading to
infinite recursion and eventually a double fault.  To fix, put Giant after
sx locks in the lock order list.
2003-03-06 17:25:06 +00:00
Takanori Watanabe b256620797 Add integer value of _CID handling.
If _CID is string, it will need more complicated
handling to distinguish bus other than ISA.

Submitted by: Paul Wankadia <junyer@gmx.net>
2003-03-06 14:40:15 +00:00
Tim J. Robbins 1303bfb807 Add a temporary workaround for a deadlock in Coda venus 5.3.19 that
occurs when mounting the filesystem. The problem is that venus issues
the mount() syscall, which calls vfs_mount(), which calls coda_root()
which attempts to communicate with venus.
2003-03-06 10:48:03 +00:00
Tim J. Robbins fe72c63e22 Remove fragments of support for the FreeBSD 3.x and 4.x branches. 2003-03-06 10:38:18 +00:00
Hidetoshi Shimokawa 2b4601d10b MFp4(simokawa_sbp)
Improve if_fwe performance.
- Simplify mbuf handling by using bulkxfer.
	Now, it uses mbuf clusters for RX buffer as usual ethernet drivers.
- Recycle struct xfer buffer and don't call malloc at runtime.
- Count input and output errors.
- Handle a mbuf chain longer than 6 correctly.
- Increase queue length.
2003-03-06 05:06:44 +00:00
Alan Cox 7c4351aabd Remove GIANT_REQUIRED from sf_buf_free(). 2003-03-06 04:48:19 +00:00
Robert Watson 9283578946 Instrument sysarch() MD privileged I/O access interfaces with a MAC
check, mac_check_sysarch_ioperm(), permitting MAC security policy
modules to control access to these interfaces.  Currently, they
protect access to IOPL on i386, and setting HAE on Alpha.
Additional checks might be required on other platforms to prevent
bypass of kernel security protections by unauthorized processes.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-06 04:47:47 +00:00
Alan Cox 09c80124a3 Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.
Discussed on:	arch@
2003-03-06 03:41:02 +00:00
Robert Watson 1b2c2ab29a Provide a mac_check_system_swapoff() entry point, which permits MAC
modules to authorize disabling of swap against a particular vnode.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-05 23:50:15 +00:00
Robert Watson a184d471e2 Move the initialization of the vattr flags field in setfflags() to
before the MAC check so that we pass the flags field into the MAC
check properly initialized.  This didn't affect any current MAC
modules since they didn't care what the flags argument was (as
they were primarily interested in the fact that it was a meta-data
write, not the contents of the write), but would be relevant to
future modules relying on that field.

Submitted by:	Mike Halderman <mrh@spawar.navy.mil>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-05 23:15:23 +00:00
Archie Cobbs 2b2a8188b1 Fix a use-after-free bug that could cause multi-link fragment reassembly to
fail for a long time (until the incoming sequence numbers wrapped around).

Reported by:	Matthew Impett <mimpett@Glue.umd.edu>
MFC after:	3 days
2003-03-05 23:12:59 +00:00
Tim J. Robbins 6a08d399b1 VOP_PATHCONF returns a register_t, not an int. Noticed by phk. 2003-03-05 22:30:02 +00:00
Peter Wemm 3c6b084e96 Finish driving a stake through the heart of netns and the associated
ifdefs scattered around the place - its dead Jim!

The SMB stuff had stolen AF_NS, make it official.
2003-03-05 19:24:24 +00:00
Duncan Barclay 4becbcddc0 Retire some misleading comments and explain why we need to keep a copy
of parameters written to the card.
2003-03-05 18:13:19 +00:00
John Baldwin 8b18ef15a4 Duplicate more of options.i386 in this file since we can't seem to settle
on a notion of having MACHINE_ARCH common files that MACHINE files include.
2003-03-05 18:12:48 +00:00
Orion Hodson a7576e2e4b Back out last commit, which is fine in theory, but ignores the fact
that a lock is held whilst the allocations are made (M_WAITOK -> M_NOWAIT).
2003-03-05 14:48:28 +00:00
Tim J. Robbins 9d3570325d Add prototype for coda_pathconf() that I missed in the previous commit. 2003-03-05 13:48:51 +00:00
Takeshi Shibagaki ca49234e7c Used correct aue_flags in ELECOM LD-USB/T and ELECOM LD-USB/TX.
Submitted by: Yasushi Oshima <oshimaya@sc.starcat.ne.jp>
              Takeshi Shibagaki <shiba@freebsd.org>
                 (refer to [bsd-usb:685],[bsd-usb:686])
2003-03-05 13:25:35 +00:00
Takeshi Shibagaki f6e333276b Fixed an issue which transfer no packets in combination with aue driver.
Submitted by Hiroyuki Aizu <eyes@navi.org>
                (refer to [FreeBSD-users-jp 65061])
Tested by    Hiroharu Tamaru <tamaru@myn.rcast.u-tokyo.ac.jp>
                (refer to [bsd-usb:689])
2003-03-05 13:17:15 +00:00
Tim J. Robbins 7054fe2735 Add a minimal implementation of VOP_PATHCONF to silence warning
messages from ls(1).
2003-03-05 10:23:51 +00:00
Tim J. Robbins 11aca4935c Handle the case where a_uio->uio_td == NULL properly in coda_readlink().
This happens when called from lookup().
2003-03-05 09:52:04 +00:00
David Schultz ee844411e9 Raise the default value of TTYHOG from 1 kB to 8 kB. Since TTYHOG is
an administrative limit on the size of tty/pty input buffers, this is
mostly an inconsequential change.  (slti(4) will allocate an 8 kB
static buffer instead of a 1 kB buffer due to a hack in the driver.)
The increase happens to kludge around a lame limitation of syscons,
which does not allow one to paste more than TTYHOG bytes.

PR:		42031
Reviewed by:	mike (mentor)
2003-03-05 08:17:10 +00:00
David Schultz 9c62b3ee7c Make TTYHOG tunable.
Reviewed by:	mike (mentor)
2003-03-05 08:16:29 +00:00
Orion Hodson 876d09d890 Attempt a hard reset if AC97 codec is not ready on attach.
Halt attach if mixer_init fails.

Prompted by: points raised by Hugo Valentim <hvalentim@gmx.net>.
2003-03-05 05:56:18 +00:00
Marcel Moolenaar cafd6dbd76 Fix threaded applications on ia64 that are linked dynamicly. We did
not save (restore) the global pointer (GP) in the jmpbuf in setjmp
(longjmp) because it's not needed in general. GP is considered a
scratch register at callsites and hence is always restored after a
call (when it's possible that the call resolves to a symbol in a
different loadmodule; otherwise GP does not have to be saved and
restored at all), including calls to setjmp/longjmp. There's just
one problem with this now that we use setjmp/longjmp for context
switching: A new context must have GP defined properly for the
thread's entry point. This means that we need to put GP in the
jmpbuf and consequently that we have to restore is in longjmp.
This automaticly requires us to save it as well.

When setjmp/longjmp isn't used for context switching, this can be
reverted again.
2003-03-05 04:39:24 +00:00
Marcel Moolenaar a402169a8e ABI breaker: Move the J_SIGMASK field in the jmpbuf before
the J_SIG0 field. While here, rename J_SIG0 to J_SIGSET and
remove J_SIG1. The main reason for this change is that the
128-bit sigset_t is now aligned on a 16-byte boundary, which
allows us to use 16-byte atomic loads and stores on CPUs that
support it. The removal of J_SIG1 is done to avoid confusion:
it is never accessed and should not be. Renaming J_SIG0 to
J_SIGSET is the icing on the cake that's better done now than
later.
2003-03-05 03:30:54 +00:00
Hidetoshi Shimokawa 9ca8add364 Set ldesc after dbch->ndesc has initialized. 2003-03-05 01:50:57 +00:00
Sean Chittenden 6087c960b5 Document the tunable kern.ipc.nsfbufs in help.common and loader.8. Small
nearby grammar fixup that saves a line of display while in the loader
(help set tunables), but reuses the line for kern.ipc.nsfbufs.

Approved by:	 roam
2003-03-04 23:46:29 +00:00
Jonathan Lemon f0757123c9 GC unused files. 2003-03-04 23:28:19 +00:00
Jonathan Lemon 1cafed3941 Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point.  Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs
2003-03-04 23:19:55 +00:00
John Baldwin c141c242ac Bah, fix a bogon in the last commit: get the sense of a compare test right
so that we allow a sleepable lock to be acquired with Giant held rather
than allowing a sleepable lock to be acquired with anything but Giant held.
2003-03-04 22:34:07 +00:00
Jeff Roberson 24deed1aaa - Hold the buf lock while manipulating and inspecting its fields.
- Use gbincore() and not incore() so that we can drop the vnode interlock
   as we acquire the buflock.
 - Use GB_LOCK_NOWAIT when getting bufs for read ahead clusters so that we
   don't block on locked bufs.
 - Convert a while loop to a howmany() that will most likely be faster on
   modern processors.  There is another while loop divide that was left
   near by because it is operating on a 64bit int and is most likely faster.
 - Cleanup the cluster_read() code a little to get rid of a goto and make
   the logic clearer.

Tested on:	x86, alpha
Tested by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
Reviewd by:	arch
2003-03-04 21:35:28 +00:00
John Baldwin 1106937d99 Remove safety belt: it is now ok to do a mtx_trylock() on a mutex you
already own.  The mtx_trylock() will fail however.  Enhance the comment
at the top of the try lock function to explain this.

Requested by:	jlemon and his evil netisr locking
2003-03-04 21:32:25 +00:00
John Baldwin 263067951a Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls
to WITNESS_WARN().
2003-03-04 21:03:05 +00:00
John Baldwin 9b4982bfed Add a WITNESS_WARN() call to verify that we hold no locks after running
a handler from an interrupt thread.
2003-03-04 21:01:42 +00:00
John Baldwin 35580ede37 A small overhaul of witness:
- Add a comment about special lock order rules and Giant near the top of
  subr_witness.c.  Specifically, this documents and explains the real lock
  order relationship between Giant and sleepable locks (i.e. lockmgr locks
  and sx locks).  Basically, Giant can be safely acquired either before or
  after sleepable locks and the case of Giant before a sleepable lock is
  exempted as a special case.
- Add a new static function 'witness_list_lock()' that displays a single
  line of information about a struct lock_instance.  This is used to
  make the output of witness messages more consistent and reduce some code
  duplication.
- Fixup a few comments in witness_lock().
- Properly handle the Giant-before-sleepable-lock lock order exception in
  a more general fashion and remove the no longer needed LI_SLEPT flag.
- Break up the last condition before assuming a reversal a bit to try
  and make the logic less confusing in witness_lock().
- Axe WITNESS_SLEEP() now that LI_SLEPT is no longer needed and replace it
  with a more general WITNESS_WARN() macro/function combination.
  WITNESS_WARN() allows you to output a customized message out to the
  console along with a list of held locks.  It will optionally drop into
  the debugger as well.  You can exempt a single lock from the check by
  passing it in as the second argument.  You can also use flags to specify
  if Giant should be exempt from the check, if all sleepable locks should
  be exempt from the check, and if witness should panic if any non-exempt
  locks are found.
- Make the witness_list() function static.  Other areas of the kernel
  should use the new WITNESS_WARN() instead.
2003-03-04 20:56:39 +00:00
John Baldwin 5fa8dd90f9 Miscellaneous cleanups to _mtx_lock_sleep():
- Declare some local variables at the top of the function instead of in a
  nested block.
- Use mtx_owned() instead of masking off bits from mtx_lock manually.
- Read the value of mtx_lock into 'v' as a separate line rather than inside
  an if statement for clarity.  This code is hairy enough as it is.
2003-03-04 20:32:41 +00:00
John Baldwin 6b869595c5 Properly assert that mtx_trylock() is not called on a mutex we already
owned.  Previously the KASSERT would only trigger if we successfully
acquired a lock that we already held.  However, _obtain_lock() fails to
acquire locks that we already hold, so the KASSERT was never checked in
the case it was supposed to fail.
2003-03-04 20:30:30 +00:00
John Baldwin d7a715dc64 Wrap the hyperthreading support code with the HTT kernel option.
Hyperthreading support is now off unless the HTT option is added.

MFC-after:	3 days
2003-03-04 20:24:53 +00:00
Bosko Milekic 544244654a Fix bug introduced in 1.130. For the < MHLEN case, we should
be doing a m_gethdr(), not an m_get().

Pointed out by: Hiten Pandya <hiten@unixdaemons.com>
Pointy hat to: Me
2003-03-04 20:19:26 +00:00
Poul-Henning Kamp d15f53f704 Bump __FreeBSD_version to mark new cdevsw initialization. 2003-03-04 12:44:48 +00:00
Poul-Henning Kamp 0238f932b8 Initialize the second buffer for mirroring to point to itself and not its
partner.
2003-03-04 10:15:19 +00:00
Hidetoshi Shimokawa 0fc9ced053 Fix printf warning on RELENG_4. 2003-03-04 06:47:17 +00:00
Jeff Roberson e1f89c222b - Create a function sched_interact_score() which decides on the
interactivity of a kseg and assigns it a value of 0 through 100.
 - Use sched_interact_score() to determine the dynamic priority.
 - Define SCHED_CURR() in terms of sched_interact_score().
 - Adjust the maximum slice back down to 100ms.
 - Remove redundant clearing of ke_runq in sched_wakeup()
 - Clean up #defines and comment them.
2003-03-04 02:45:59 +00:00
Jeff Roberson 7261f5f68e - Add a new 'flags' parameter to getblk().
- Define one flag GB_LOCK_NOWAIT that tells getblk() to pass the LK_NOWAIT
   flag to the initial BUF_LOCK().  This will eventually be used in cases
   were we want to use a buffer only if it is not currently in use.
 - Convert all consumers of the getblk() api to use this extra parameter.

Reviwed by:	arch
Not objected to by:	mckusick
2003-03-04 00:04:44 +00:00
Jeff Roberson f727171140 - Correct the wchan in vop_stdfsync()
This is almost what bde asked for.  There is some desire to have per fs wchans
still but that is difficult giving the current arrangement of the code.
2003-03-03 23:37:50 +00:00
Ruslan Ermilov 6de61153e8 FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch
up with this further by excluding /modules from the (default)
kern.module_path.
2003-03-03 22:53:35 +00:00
Ruslan Ermilov f2bffe0f7f exists() is too aggressive when searching for files without a full path.
Inspired by:	bsd.prog.mk,v 1.105
2003-03-03 22:51:22 +00:00
Nate Lawson 7dc9111650 Pick up one file missed in the previous vprint() cleanup 2003-03-03 19:50:36 +00:00
Nate Lawson 99648386d3 Finish cleanup of vprint() which was begun with changing v_tag to a string.
Remove extraneous uses of vop_null, instead defering to the default op.
Rename vnode type "vfs" to the more descriptive "syncer".
Fix formatting for various filesystems that use vop_print.
2003-03-03 19:15:40 +00:00
Poul-Henning Kamp ffaae05d02 Rearrange the members of struct cdevsw to be absolutely sure to catch
any initializations which are not done right.
2003-03-03 16:34:54 +00:00
Poul-Henning Kamp 182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
Hidetoshi Shimokawa 46ce9fefe5 Simplify ORB queue management.
Don't send doorbell and send ORB pointer only if it's necessary.
This reduces bus traffic and interrupts much.
2003-03-03 15:27:29 +00:00
Poul-Henning Kamp ebe789d61c Add a "-S sectorsize" option to enable Kirk to find a bug :-) 2003-03-03 13:05:00 +00:00
Poul-Henning Kamp a8b182112d Don't initialize d_kqfilter to 0. 2003-03-03 12:48:14 +00:00
Poul-Henning Kamp 7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Peter Grehan 03f5c00144 Simplify ofw_pci_fixup(). It doesn't need to be recursive, since the
bridge code already handles IRQ adjustment on the far side of a bridge.

Reviewed by:  benno
2003-03-03 12:05:06 +00:00
Søren Schmidt 3cb179a848 Minor cleanup of the Promise code. 2003-03-03 11:51:08 +00:00
Søren Schmidt c55607ce1f Always set the setmode funcptr. 2003-03-03 11:15:32 +00:00
Poul-Henning Kamp a9463ba804 Don't pick up a name from the dev_t if it is not there. 2003-03-03 11:14:36 +00:00
Ruslan Ermilov ab404da2f1 Leave the `clobber' target alone, it clobbers too much (including
the generated Makefile) to be useful as the cleandir replacement.

Reported by:	des
2003-03-03 09:35:44 +00:00
Dag-Erling Smørgrav 1d062e2be8 Clean up whitespace and remove register keyword. 2003-03-03 09:17:12 +00:00
Dag-Erling Smørgrav 4b7ef73d71 More caddr_t removal, in conjunction with copy{in,out}(9) this time.
Also clean up some egregious casts and incorrect use of sizeof.
2003-03-03 09:14:26 +00:00
Matthew N. Dodd ad59f9d14e Revert last commit. File tracks NetBSD.
Requested by:	 sam
2003-03-03 06:09:18 +00:00
Jeff Roberson 65c8760dbf - Shift the tick count by 10 and back around sched_pctcpu_update()
calculations.  Keep this changes local to the function so the tick count
   is in its natural form otherwise.  Previously 1000 was added each time
   a tick fired and we divided by 1000 when it was reported.  This is done
   to reduce rounding errors.
2003-03-03 05:29:09 +00:00
Matthew N. Dodd 797f247b51 sizeof(struct llc) -> LLC_SNAPFRAMELEN
sizeof(struct ether_header) -> ETHER_HDR_LEN
 sizeof(struct fddi_header) -> FDDI_HDR_LEN
2003-03-03 05:04:57 +00:00
Jeff Roberson a6ed41865b - In sched_add() special case PRI_TIMESHARE and PRI_ITHD|PRI_REALTIME. We
always place ITHD & REALTIME threads on the current queue of the current
   cpu.  Prior to this change an interrupt thread would only ever run on one
   cpu.
2003-03-03 04:28:07 +00:00
Jeff Roberson f1e8dc4a3b - Refrain from setting the td_priority in sched_wakeup(). It will be reset
before we return to user space.
2003-03-03 04:11:40 +00:00
Hidetoshi Shimokawa dcae7539cb Defer allowing async. requests after self ID's have received.
This should fix some problem of SBP2 device probing.

Prior to rev 1.41, we keep writing the register while bus reset phase.
But in rev 1.41, we ignore successive bus reset events and some chips seem to
clear the register after we write to it.

Tested by: Michael Reifenberger <root@nihil.reifenberger.com>
2003-03-03 04:10:56 +00:00
Matthew N. Dodd c6269f4b26 Use IFP2AC() rather than casting to struct arpcom * 2003-03-03 00:30:02 +00:00
Matthew N. Dodd 098a8c3b64 De-register. 2003-03-03 00:21:52 +00:00
Robert Watson 03d031626d A cute yet small MAC policy that provides a simple ACL mechanism to
permit users and groups to bind ports for TCP or UDP, and is intended
to be combined with the recently committed support for
net.inet.ip.portrange.reservedhigh.  The policy is twiddled using
sysctl(8).  To use this module, you will need to compile in MAC
support, and probably set reservedhigh to 0, then twiddle
security.mac.portacl.rules to set things as desired.  This policy
module only restricts ports explicitly bound using bind(), not
implicitly bound ports where the port number is selected by the
IP stack.  It appears to work properly in my local configuration,
but needs more broad testing.

A sample policy might be:

  # sysctl security.mac.portacl.rules="uid:425:tcp:80,uid:425:tcp:79"

This permits uid 425 to bind TCP sockets to ports 79 and 80.  Currently
no distinction is made for incoming vs. outgoing ports with TCP,
although that would probably be easy to add.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-02 23:01:42 +00:00
Dag-Erling Smørgrav 7b726be320 Get rid of caddr_t. 2003-03-02 22:23:45 +00:00
Matthew N. Dodd 7f760c4890 Reduce code duplication. This adds the function rt_check() to route.c.
Approved by:	 sam (in principle)
2003-03-02 21:34:37 +00:00
Ruslan Ermilov 04b603e5a2 Abuse cleandir' for what clobber' was supposed to do, for peter. 2003-03-02 21:25:00 +00:00
Ruslan Ermilov 73f643b411 Fixed sys/boot/pc98/boot2/Makefile to use kern.mk and
get rid of bsd.kern.mk completely.

OK'ed by:	bde
2003-03-02 21:18:40 +00:00
Poul-Henning Kamp f16304aaf0 Explicitly initialize all cdevsw methods with the relevant nofoo() function
if they are NULL.
2003-03-02 19:46:45 +00:00
Poul-Henning Kamp dd7a14618b Spell noread() and nowrite() correctly (ie: not "NULL") 2003-03-02 19:23:31 +00:00
Poul-Henning Kamp a36ef7f365 Don't use evil casts in cdevsw initialization. 2003-03-02 19:17:51 +00:00
Poul-Henning Kamp 95e4359c8e Use canonical format for cdevsw initialization. 2003-03-02 18:51:46 +00:00
Poul-Henning Kamp bbaba62872 Use canonical format for cdevsw initilization. 2003-03-02 18:50:21 +00:00
Poul-Henning Kamp 7e5b777f98 Use canonical name for cdevsw initialization. 2003-03-02 18:49:26 +00:00
Poul-Henning Kamp 6fee404efa Use canonical form for cdevsw initialization. 2003-03-02 18:47:38 +00:00
Hartmut Brandt 5dfe609dd1 Add two loader tuneables that allow one to change the maximum number of
queue items that can be allocated by netgraph and the number of free queue
items that are cached on a private list.

Netgraph places an upper limit on the number of queue items it may allocate.
When there is a large number of netgraph messages travelling through the
system (100k/sec and more) there is a high probability, that messages get
queued at the nodes and netgraph runs out of queue items. In this case the data
flow through netgraph gets blocked. The tuneable for the number of free
items lets one trade memory for performance.

The tunables are also available as read-only sysctls.

PR:		kern/47393
Reviewed by:	julian
Approved by:	jake (mentor)
2003-03-02 18:04:10 +00:00
Dag-Erling Smørgrav 521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Poul-Henning Kamp 715b1e0ab0 Put cdevsw initialization on canonical format. 2003-03-02 16:50:09 +00:00
Poul-Henning Kamp 3dc3dda55b Fix cdevsw initialization commit to follow canonical format. 2003-03-02 16:44:46 +00:00
Dag-Erling Smørgrav 8994a245e0 Clean up whitespace, s/register //, refrain from strong urge to ANSIfy. 2003-03-02 15:56:49 +00:00
Dag-Erling Smørgrav c952458814 uiomove-related caddr_t -> void * (just the low-hanging fruit) 2003-03-02 15:50:23 +00:00
Poul-Henning Kamp 78b7591cc5 Format the cdevsw like all other drivers do it for improved grepability. 2003-03-02 15:32:03 +00:00
Dag-Erling Smørgrav d5279f20c5 Convert one of our main caddr_t consumers, uiomove(9), to void *. 2003-03-02 15:29:13 +00:00
Dag-Erling Smørgrav f9be0dee1e wakeup(9) and msleep(9) take void * arguments, not caddr_t. 2003-03-02 15:13:06 +00:00
Dag-Erling Smørgrav 34ca14c687 Clean up whitespace, unregisterize, ANSIfy, remove prototypes made
superfluous by ANSIfication.
2003-03-02 15:08:33 +00:00
Poul-Henning Kamp b1a89575af NO_GEOM cleanup:
Remove (actually: Obscurely rename) cdevsw->d_psize() to prevent future use.
2003-03-02 14:45:05 +00:00
Poul-Henning Kamp 9c486c30e2 NO_GEOM cleanup:
Remove cdevsw->d_size() implementation.  No longer needed.
2003-03-02 14:43:46 +00:00
Poul-Henning Kamp e8e018a984 NO_GEOM cleanup:
Remove cdevsw->d_psize() implementation.  It is no longer needed.
2003-03-02 14:42:52 +00:00
Poul-Henning Kamp aa8918faf9 NO_GEOM cleanup:
Remove cdevsw->d_psize() implementation, we don't need it any more.
2003-03-02 14:42:01 +00:00
Poul-Henning Kamp afadcb6108 NO_GEOM cleanup:
Use VOP_IOCTL(DIOCGMEDIASIZE) to check the size of a potential swap device
instead of the cdevsw->d_psize() method.
2003-03-02 14:37:52 +00:00
Poul-Henning Kamp 9a283f91c0 NO_GEOM cleanup:
mcdsize() is not a cdevsw->d_psize function (any more ?) so rename it,
give it a better prototype to avoid misusing d_psize_t.
2003-03-02 14:30:54 +00:00
Poul-Henning Kamp 9285a87efd NODEVFS cleanup:
Replace devfs_{create,destroy} hooks with direct function calls.
2003-03-02 13:35:30 +00:00
Jeff Roberson 491081fabf - Hold the vnode interlock across calls to bgetvp instead of acquiring it
internally.  This is required to stop multiple bufs from being associated
   with a single lblkno.
2003-03-02 06:05:23 +00:00
Scott Long 1a3a935b84 Fix 'bulk in' and 'bulk out' being reversed in a couple of error messages. 2003-03-02 02:35:00 +00:00
Alan Cox 1a1e9f41e5 Teach vm_page_sleep_if_busy() to release the vm_object lock before sleeping. 2003-03-01 19:16:32 +00:00
Tor Egge c6faf3bf1d Remove unneeded code added in revision 1.188. 2003-03-01 17:18:28 +00:00
Mike Barcroft 2019acb6e0 Share ino_t and nlink_t. 2003-03-01 16:51:40 +00:00
Hidetoshi Shimokawa 37413f0a0f Don't reset agent before processing OCB has done. 2003-03-01 16:50:40 +00:00
Alan Cox 72c3aad7e8 MFi386 revision 1.88
Remove some long unused declarations.
2003-03-01 10:02:11 +00:00
Søren Schmidt 638914f17d Fix support for HPT controllers they where always left in PIO mode.
Amazing what a ';' can do :/
2003-03-01 09:33:35 +00:00
Stefan Eßer 1fa4dd2f14 Make /dev/pci use MAJOR_AUTO. 2003-03-01 08:57:16 +00:00
Jeff Roberson bff5362bf2 - gc USE_BUFHASH. The smp locking of the buf cache renders this useless. 2003-03-01 05:55:03 +00:00
Marcel Moolenaar 59c9bb54ee Speed up debugging in the context of unexpected traps by printing
the address of the image base of the loader. Given cr.iip, we can
use the symbol table to figure out what function caused the trap.
2003-03-01 05:18:28 +00:00
Marcel Moolenaar 884d549049 Paranoia: Don't use the length of the option string alone to
determine whether we have command line options. We expect a
valid string pointer as well.
2003-03-01 05:13:59 +00:00
Scott Long 9e2e96d803 The aac driver has evolved enough over the last few months that it no
longer resembles the 4.x version very much.  Garbage collect the legacy
bits.
2003-03-01 05:07:19 +00:00
Ruslan Ermilov e1ace8b4d3 Hopefully, obviate the need of ``make depend''. 2003-02-28 22:17:47 +00:00
Ruslan Ermilov ddc474a84b Initiate the de-orbit burn sequence for <bsd.kern.mk>.
Always use sys/conf/kern.mk when building kernel/modules.
<bsd.kern.mk> is only preserved for sys/boot/pc98/boot2
for now, but this will be fixed.  If there are other
users of <bsd.kern.mk>, please let me know.

Reminded by:	bde
2003-02-28 22:12:17 +00:00
Ruslan Ermilov 5d1b6a85bc Standardize handling of locore.[sS] etc. files.
Submitted by:	jake, bde, ru
2003-02-28 21:59:14 +00:00
Sam Leffler 595064e871 fix compilation w/o INET6
Noticed by:	"James E. Flemer" <jflemer@acm.jhu.edu>
2003-02-28 20:06:29 +00:00
Maxime Henrion 0bc60d9734 GC the major number for the network entries. 2003-02-28 19:56:10 +00:00
John Hay 11229bf39e Implement outgoing interrupt pipes. It is part of the USB 1.1 spec.
The Lego Infrared Tower use it.
2003-02-28 19:28:29 +00:00
Orion Hodson 19921b23b5 o Move vendor ids into separate table.
o Add assorted vendor and codec ids.
2003-02-28 18:04:52 +00:00
Maxime Henrion 7e1f8a0b2f Make the network /dev entries use MAJOR_AUTO. 2003-02-28 18:04:42 +00:00
David Xu 9948c47f0e Check kse group limit before linking new ksegrp. 2003-02-28 15:57:33 +00:00
Warner Losh f6820d8b82 86 ufm: it now uses MAJOR_AUTO. 2003-02-28 13:25:06 +00:00
Warner Losh 56dd04580a ufm doesn't care what major it uses. 2003-02-28 13:23:31 +00:00
Warner Losh cfb14e7100 These appear to work as cardbus cards too 2003-02-28 13:21:17 +00:00
Poul-Henning Kamp 98bbd7aa59 NO_GEOM cleanup:
Retire the "dev_t" centric version of the disk mini-layer.
Remove now unneeded linkage field in dev_t and struct disk.
2003-02-28 10:02:02 +00:00
Poul-Henning Kamp 3e7b60db4b NO_GEOM cleanup:
Convert to "struct disk *" centric API.

OK'ed by:	sos
2003-02-28 09:53:36 +00:00
Poul-Henning Kamp 82a5503800 Retire #3: wd. 2003-02-28 09:48:59 +00:00
Poul-Henning Kamp 8cfa9ac669 NO_GEOM cleanup:
Convert to "struct disk *" centric API.
2003-02-28 09:47:22 +00:00
Poul-Henning Kamp ad89059cbf Attempt to mark the majors which are used by drivers checked into the
CVS tree.
2003-02-28 07:49:57 +00:00
Jake Burkholder 53faa77b2f Sync with bsd.kern.mk.
Reminded by:	bde
2003-02-28 06:49:59 +00:00
Warner Losh 9cd41be1d0 pccard isn't picky about WHAT major it gets. 2003-02-28 05:56:06 +00:00
Tim J. Robbins 0e66bb97d8 Use a character device and ioctl() for communication between libncp
and the kernel instead of adding more syscalls at runtime. As a bonus,
you can now restrict access to the kernel NCP interface with chmod.
2003-02-28 04:31:29 +00:00
Jake Burkholder 3fb37429df Use MAJOR_AUTO. GC statically assigned majors. 2003-02-28 04:21:13 +00:00
Benno Rice 82b65292eb These files are no longer used. They have been replaced with similarly named
.S files.
2003-02-28 03:35:42 +00:00
Justin T. Gibbs acae33b029 aic79xx.c:
Clear the LQICRC_NLQ status should it pop up after we have
	already handled the SCSIPERR.  During some streaming operations
	this status can be delayed until the stream ends.  Without this
	change, the driver would complain about a "Missing case in
	ahd_handle_scsiint".

	In the LQOBUSFREE handler...

		Don't return the LQOMGR back to the idle state until after
		we have cleaned up ENSELO and any status related to this
		selection.  The last thing we need is the LQO manager starting
		another select-out before we have updated the execution queue.
		It is not clear whether the LQOMGR would, or would not
		start a new selection early.

		Make sure ENSELO is off prior to clearing SELDO by flushing
		device writes.

		Move assignment of the next target SCB pointer inside of
		an if to make the code clearer.  The effect is the same.

	Dump card state in both "Unexpected PKT busfree" paths.

	In ahd_reset(), set the chip to SCSI mode before reading SXFRCTL1.
	That register only exists in the SCSI mode.  Also set the mode
	explicitly to the SCSI mode after chip reset due to paranoia.
	Re-arrange code so that SXFRCTL1 is restored as quickly after the
	chip reset as possible.

	S/G structurs must be 8byte aligned.  Make this official by saying
	so in our DMA tag.

	Disable CIO bus stretch on MDFFSTAT if SHVALID is about to come
	true.  This can cause a CIO bus lockup if a PCI or PCI-X error
	occurs while the stretch is occurring - the host cannot service
	the PCI-X error since the CIO bus is locked out and SHVALID will
	never resolve.  The stretch was added in the Rev B to simplify the
	wait for SHVALID to resolve, but the code to do this in the open
	source sequencer is so simple it was never removed.

	Consistently use MAX_OFFSET for the user max syncrate set from
	non-volatile storage.  This ensures that the offset does not
	conflict with AH?_OFFSET_UNKNOWN.

	Have ahd_pause_and_flushwork set the mode to ensure that it has
	access to the registers it checks.  Also modify the checking of
	intstat so that the check against 0xFF can actually succeed if
	the INT_PEND mask is something other than 0xFF.  Although there
	are no cardbus U320 controllers, this check may be needed to
	recover from a hot-plug PCI removal that occurs without informing
	the driver.

	Fix a typo.  sg_prefetch_cnt -> sg_prefetch_align.  This fixes
	an infinite loop at card initialization if the cacheline size is 0.

aic79xx.h:
	Add AHD_EARLY_REQ_BUG bug flag.

	Fix spelling errors.

	Include the CDB's length just after the CDB pointer in the DMA'ed
	CDB case.

	Change AH?_OFFSET_UNKNOWN to 0xFF.  This is a value that the
	curr->offset can never be, unlike '0' which we previously used.
	This fixes code that only checks for a non-zero offset to
	determine if a sync negotiation is required since it will fire
	in the unknown case even if the goal is async.

aic79xx.reg:
	Add comments for LQISTAT bits indicating their names in the 7902
	data book.  We use slightly different and more descriptive names
	in the firmware.

	Fix spelling errors.

	Include the CDB's length just after the CDB pointer in the DMA'ed
	CDB case.

aic79xx.seq:
	Update comments regarding rundown of the GSFIFO to reflect reality.

	Fix spelling errors.

	Since we use an 8byte address and 1 byte length, shorten the size
	of a block move for the legacy DMA'ed CDB case from 11 to 9 bytes.

	Remove code that, assuming the abort pending feature worked, would
	set MK_MESSAGE in the SCB's control byte on completion to catch
	invalid reselections.  Since we don't see interrupts for completed
	selections, this status update could occur prior to us noticing the
	SELDO.  The "select-out" queue logic will get confused by the
	MK_MESSAGE bit being set as this is used to catch packatized
	connections where we select-out with ATN.  Since the abort pending
	feature doesn't work on any released controllers yet, this code was
	never executed.

	Add support for the AHD_EARLY_REQ_BUG.  Don't ignore persistent REQ
	assertions just because they were asserted within the bus settle delay
	window.  This allows us to tolerate devices like the GEM318 that
	violate the SCSI spec.

	Remove unintentional settnig of SG_CACHE_AVAIL.  Writing this bit
	should have no effect, but who knows...

	On the Rev A, we must wait for HDMAENACK before loading additional
	segments to avoid clobbering the address of the first segment in
	the S/G FIFO.  This resolves data-corruption issues with certain
	IBM (now Hitachi) and Fujitsu U320 drives.

	Rearrange calc_residual to avoid an extra jmp instruction.

	On RevA Silicon, if the target returns us to data-out after we
	have already trained for data-out, it is possible for us to
	transition the free running clock to data-valid before the required
	100ns P1 setup time (8 P1 assertions in fast-160 mode).  This will
	only happen if this L-Q is a continuation of a data transfer for
	which we have already prefetched data into our FIFO (LQ/Data
	followed by LQ/Data for the same write transaction).  This can
	cause some target implementations to miss the first few data
	transfers on the bus.  We detect this situation by noticing that
	this is the first data transfer after an LQ (LQIWORKONLQ true),
	that the data transfer is a continuation of a transfer already
	setup in our FIFO (SAVEPTRS interrupt), and that the transaction
	is a write (DIRECTION set in DFCNTRL). The delay is performed by
	disabling SCSIEN until we see the first REQ from the target.

	Only compile in snapshot savepointers handler for RevA silicon
	where it is enabled.

	Handle the cfg4icmd packetized interrupt.  We just need to load
	the address and count, start the DMA, and CLRCHN once the transfer
	is complete.

	Fix an oversight in the overrun handler for packetized status
	operations.  We need to wait for either CTXTDONE or an overrun
	when checking for an overrun.  The previous code did not wait
	and thus could decide that no overrun had occurred even though
	an overrun will occur on the next data-valid req.  Add some
	comment to this section for clarity.

	Use LAST_SEG_DONE instead of LASTSDONE for testing transfer
	completion in the packetized status case.  LASTSDONE may come up
	more quickly since it only records completion on the SCSI side,
	but since LAST_SEG_DONE is used everywhere else (and needs to be),
	this is less confusing.

	Add a missing invalidation of the longjmp address in the non-pack
	handler.  This code needs additional review.

aic79xx_inline.h:
	Fix spelling error.

aic79xx_osm.c:
	Set the cdb length for CDBs dma'ed from host memory.

	Add a comment indicating that, should CAM start supporting cdbs
	larger than 16bytes, the driver could store the CDB in the status
	buffer.

aic79xx_pci.c:
	Add a table entry for the 39320A.

	Added a missing comma to an error string table.

	Fix spelling errors.
2003-02-27 23:23:16 +00:00
Jake Burkholder dd606b5425 - Removed various cruft from before we had a hosted toolchain (!).
- Moved special compiler flags to bsd.kern.mk so they get used for modules
  too.
2003-02-27 23:02:22 +00:00
Poul-Henning Kamp 9fc954f139 NO_GEOM cleanup:
Move <sys/conf.h> before <sys/disk.h>.
No need for raidread()/raidwrite(), we have generic code for that.
Remove non-functional dump code.
Make raidinit() return the softc, not the dev_t.
Move to "struct disk*" centric API.
Fix printfs' to get name from struct disk instead of dev_t.

OK'ed by:	scottl
2003-02-27 22:04:08 +00:00
Poul-Henning Kamp 32f034faca Add support for the Elan CPU hardware watchdog used in "active" mode. 2003-02-27 21:13:08 +00:00
Sam Leffler e85eab7751 add 5801 and 5802 recognition (somehow lost in transition from openbsd)
Noticed by:	Larry Baird <lab@gta.com>
2003-02-27 21:10:20 +00:00
Poul-Henning Kamp e6258fb774 Add header file defining a simple, yet expressive watchdog interface
which can be implemented on all the watchdog hardware I know.
2003-02-27 21:07:36 +00:00
Nate Lawson fdb8bf0997 Zero cpi->target_sprt since atapi-cam does not support target mode. This
gets rid of annoying messages when targbh tries to attach to the ATA bus
and gets rejected.

MFC after:	1 day
2003-02-27 20:56:56 +00:00
Jake Burkholder 418306e3bf Include majors.o in SYSTEM_OBJS to make sparc64 kernels link. This is a
quick fix while I work on a better solution.
2003-02-27 20:55:09 +00:00
John Baldwin 295435632d Expand some #ifdef's to fix I386_CPU compile.
Reported by:	Andy Farkas <andyf@speednet.com.au>
2003-02-27 20:38:48 +00:00
Alan Cox 8480cd45a5 Remove some long unused declarations. (For example, the PV flags have not
been used since revision 1.8, roughly nine years ago.)
2003-02-27 20:13:20 +00:00
Bill Paul c6d8cd1e00 Remember to set if_capenable when setting up checksum offload in fxp_attach().
Pointed out by: jlemon
2003-02-27 19:41:55 +00:00
Maxime Henrion 03ab197379 When DDB is in the kernel, unlock VTY switching so that we
don't end up freezing the box.  This makes VTY locking useless
in the DDB case but a box which is supposed to be physically
secure shouldn't compile DDB anyway.

Reviewed by:	silence on -audit
2003-02-27 18:24:06 +00:00
Mark Murray c1f4590524 This is not going to win prizes for the most useful module ever,
but it is useful to me for some testing and warns-fixing.
2003-02-27 18:08:44 +00:00
Mark Murray ef8b020c73 Warns and lint fix. Nearly all trivial stuff. 2003-02-27 18:07:11 +00:00
Poul-Henning Kamp 28484399ed Update the comment to reflect new reality.
GC more entries.
2003-02-27 15:34:12 +00:00
Poul-Henning Kamp 5fc8342289 GC some more major numbers. 2003-02-27 15:18:56 +00:00
Poul-Henning Kamp 85f19dccdb Add the flip-side check: If a driver wants a particular major#, make
sure it is marked as allocated in reserved_majors[].  Whine if it wasn't.
2003-02-27 15:17:37 +00:00
Poul-Henning Kamp f85c6d3502 Use MAJOR_AUTO. 2003-02-27 15:05:28 +00:00
Ruslan Ermilov e4de92ce2b Hook up the if_my module to the build. 2003-02-27 14:49:56 +00:00
Maxime Henrion bca0668a92 We can now properly return ENODEV in nommap(), so do it.
Remove the now wrong comment which says we can't.
2003-02-27 14:48:53 +00:00
Poul-Henning Kamp beea48b254 Add support for allocating a device driver major number on demand.
To do this, initialize the d_maj member of the cdevsw to MAJOR_AUTO.
When the cdevsw is first passed to make_dev() a free major number
will be assigned.

Until we have a bit more experience with this a printf will announce
this fact.

Major numbers are not reclaimed, so loading/unloading the same
device driver which uses MAJOR_AUTO will eventually deplete the
pool of free major numbers and the system will panic when it can
not allocate one.  Still undecided who to invonvenience with the
solution to this.
2003-02-27 14:46:51 +00:00
Tim J. Robbins 39abaa5fab Use noread(), nowrite() and nopoll() instead of our own stub functions. 2003-02-27 14:35:21 +00:00
Poul-Henning Kamp c2b46fcca4 Add yet a patch for the patchwork quilt called sio(4):
Allow people set set flags on pci based SIO ports.
2003-02-27 14:09:36 +00:00
Poul-Henning Kamp 59c5c475f1 Typo, I must have hit xZZ in vi(1). 2003-02-27 12:53:21 +00:00
Hidetoshi Shimokawa 455454994f MFp4(simokawa_sbp branch)
Improve SBP device probeing:
- Wait 2 sec before issuing LOGIN ORB expecting the reconnection
	hold timer expires.
- Serialize management ORB and scanning LUN by CAM on each target.
	This should fix the problem for devices which have multiple LUNs.
	Test device is donated by: Jaye Mathisen <mrcpu@internetcds.com>
- Freeze SIM queue for 2 sec after BUS RESET.
- Retry with LOGIN rather than RECONNECT after LOGIN is not completed for
	BUS RESET.
- Use appropriate CAM status for BUS RESET and DEVICE RESET.
- Let CAM to scan targets after BUS REST.
- Implement CAM scan target function.
- Keep our own devq freeze count.
- Let CAM to know that SBP does tagged queuing.

These should be merged to RELENG_4 before 4.8-RELEASE.
2003-02-27 12:51:24 +00:00
Poul-Henning Kamp 6cec1852d4 Make flags bit 0x10000 mean that PPS timestamping should use the
CTS instead of the DCD pin.
2003-02-27 12:27:09 +00:00
Tim J. Robbins f449c0f11d Copy some VM changes from smbfs_putpages() to nwfs_putpages(): lock
page queues, use vm_page_undirty().
2003-02-27 11:35:22 +00:00
Tim J. Robbins ef9e45dd01 Build the ncp and nwfs modules again, but only on i386 for now. 2003-02-27 11:31:08 +00:00
Søren Schmidt 33c788a554 Only use function 1 not 0 on cypress chips. 2003-02-27 09:42:57 +00:00
Hartmut Brandt dce4c82d8e When we have found a chunk of memory that is large enough and have computed
a correctly aligned address in this block we really want to check, that the
part of the chunk that starts at the aligned address is large enough with
regard to the original request. Comparing it to 0 makes no sense, because this
is always true except in the rare case, that the aligned address is just at
the end of the chunk.

Approved by:	jake (mentor)
2003-02-27 08:56:41 +00:00
Poul-Henning Kamp 76d6aef572 Add necessary awk magic to create a table of major numbers allocated
in conf/majors so we can avoid autoallocating them in the kernel.
2003-02-27 08:52:11 +00:00
Hartmut Brandt b89bc9e62b When a process has been waiting on a condition variable or mutex the
td_wmesg field in the thread structure points to the description string of
the condition variable or mutex. If the condvar or the mutex had been
initialized from a loadable module that was unloaded in the meantime,
td_wmesg may now point to invalid memory. Retrieving the process table now
may panic the kernel (or access junk). Setting the td_wmesg field to NULL
after unblocking on the condvar/mutex prevents this panic.

PR:		kern/47408
Approved by:	jake (mentor)
2003-02-27 08:43:27 +00:00
Tim J. Robbins 2a42bccb40 Fix vnode corruption bug when trying to rename files across filesystems.
Similar to the bug fixed in smbfs_vnops.c rev 1.33.
2003-02-27 08:26:17 +00:00
Poul-Henning Kamp e30fb64028 Mark comments with '#' to make this machine-readable 2003-02-27 07:57:00 +00:00
Tim J. Robbins 4116d5c10f Sync nwfs_access() with smbfs_access(): use vaccess() instead of checking
permissions ourself, fixes problem with VAPPEND.
2003-02-27 07:46:01 +00:00
Poul-Henning Kamp f477b4fd53 NODEVFS cleanup:
Remove cdevsw_add() and cdevsw_remove(), they served us well for a long time.
Bump __FreeBSD_version to 500104 to mark this.
2003-02-27 07:40:44 +00:00
Poul-Henning Kamp 4c61f9036b NODEVFS cleanup:
Don't call devsw_{add,delete}().
These two drivers are actually broken, and have been for quite some time.
2003-02-27 07:36:03 +00:00
Søren Schmidt 4f57804cd3 Fix UDMA modes setup on CMD chips. 2003-02-27 07:11:42 +00:00
Tim J. Robbins 04dbfb5c89 Catch up with recent netncp changes: ncp_chkintr() takes a thread, not
a proc, as its second argument.
2003-02-27 06:49:46 +00:00
David Xu 3b3df40fc4 Release sched_lock before calling upcall_free. 2003-02-27 05:42:01 +00:00
Scott Long 4bc7efe837 Add the ID for the CS4205 codec found in Dell laptops. Obtained from
the CS4205 spec.
2003-02-27 03:51:43 +00:00
David Xu 1d56863dd2 Needn't kse.h 2003-02-27 03:16:35 +00:00
Julian Elischer ac2e415327 Change the process flags P_KSES to be P_THREADED.
This is just a cosmetic change but I've been meaning to do it for about a year.
2003-02-27 02:05:19 +00:00
David Xu 7d33ae9677 cat KSE > /dev/null 2003-02-27 01:11:58 +00:00
Ruslan Ermilov 824018495d Implemented "nooption" and "nomakeoption" config(8) tokens.
Fixed memory leak in the "nodevice" option implementation.

Use these instead of sed(1) in MD NOTES.

Use a single makefile (sys/conf/makeLINT.mk) to generate
LINT for all architectures.  (Previous versions missed
the LINT dependency on Makefile, and i386 version also
missed the dependency on ${NOTES}.)

Fixed bugs in the previous NOTES conversion using the
"nodevice" token and sed(1):

- i386 LINT lost "device pst".

- pc98 LINT lost SC_*, MAXCONS and KBD_DISABLE_KEYMAP_LOAD
  options, and got needless DPT_* options.

- Added nooptions PPC_DEBUG, PPC_PROBE_CHIPSET, KBD_INSTALL_CDEV
  to sparc64 LINT so that it has a chance to config(8).

This basically returns us to where we were before.
2003-02-26 23:36:59 +00:00
Bill Paul c8bca6dc3d As previously threatened, add TCP/IP checksum offload support to
the fxp driver. This is enabled only for the 82550/82551 chips
(PCI revision code 12 or 13). RX and TX checksum offload are
both supported. Transmit offload is limited to TCP and UDP only
right now: there seems to be a problem with IP header checksumming
on transmit in some cases.

This chip has hardware VLAN support as well. I hope to enable
support for this eventually.
2003-02-26 22:12:04 +00:00
Max Khon d52cf765d3 Catch up with KSE changes.
Reviewed by:	tjr
2003-02-26 21:25:55 +00:00
Poul-Henning Kamp 6d473442ca NODEVFS cleanup:
Don't call cdevsw_{add,remove}()
Bracket a more correct subset in "#if experimental"
2003-02-26 21:14:39 +00:00
Poul-Henning Kamp 73f936c5ac NODEVFS cleanup:
Don't call cdevsw_{add,remove}()
Remove remnants of the previous DEVFS.
2003-02-26 21:10:04 +00:00
Poul-Henning Kamp e3163ad47d NODEVFS cleanup: Don't call cdevsw_{add,remove}() 2003-02-26 21:04:51 +00:00
Poul-Henning Kamp f400e58886 msg 2003-02-26 21:01:26 +00:00
Poul-Henning Kamp 109a8a2e47 NODEVFS cleanup: Create devices with make_dev() instead of cdevsw_add() 2003-02-26 20:54:46 +00:00
Poul-Henning Kamp e4d0d8c84a msg 2003-02-26 20:53:28 +00:00
Poul-Henning Kamp 81d4b45da7 NODEVFS cleanup: remove calls to cdevsw_remove() 2003-02-26 20:20:58 +00:00
Mike Barcroft f0603d5be6 Move the typedef for size_t into _iovec.h, so that size_t is available
for struct iovec.
2003-02-26 20:16:58 +00:00
Mike Barcroft 7e7a2c70c0 Change spelling of u_int' to unsigned int' in the POSIX case. 2003-02-26 20:10:54 +00:00
Bill Paul 7dd982591b Some more updates for the new world order:
- Make transmission of packets work again. This stopped working because
  ether_ifattach() was forcing ifp->if_output to be ether_output() and
  clobbering our attempt to override this vector with a pointer to
  ng_fec_output(). Move the overriding of ifp->if_output to after
  ether_ifattach().

- Abandon the use of the netgraph ng_ether_input_p hook for snagging
  incoming frames, and instead override the ifp->if_input vector for
  interfaces that have been aggregated into our bundle. (I would have
  loved to have written things this way in the first place, but I
  didn't want to have to be the one to implement the if_input hook
  and change all the drivers.) This avoids collisions with the ng_ether
  module, which uses the same hook. Each aggregated device now calls
  ng_fec_input() directly, which then fakes up the rcvif pointer
  before invoking ifp->if_input itself.

This module should actually work now.
2003-02-26 19:49:32 +00:00
John Baldwin 844933a831 Move an optimization check so that it breaks out of the correct loop.
Basically, as soon as we have run out of events to handle in the swi,
we stop looping through all the channels in a for loop.
2003-02-26 19:21:56 +00:00
Søren Schmidt 9fb9aa7f06 Fix a reversed test for ATAPI_DEVICE in the Promise setup code. 2003-02-26 19:13:17 +00:00
Olivier Houchard 7ee68e82e7 Add SigmaTel STAC9750 entry.
Submitted by:	Paulius Bulotas <paulius.bulotas@microlink.lt>
2003-02-26 18:39:04 +00:00
Jonathan Lemon 272c5dfe93 In timewait state, if the incoming segment is a pure in-sequence ack
that matches snd_max, then do not respond with an ack, just drop the
segment.  This fixes a problem where a simultaneous close results in
an ack loop between two time-wait states.

Test case supplied by: Tim Robbins <tjr@FreeBSD.ORG>
Sponsored by: DARPA, NAI Labs
2003-02-26 18:20:41 +00:00
Sam Leffler f1dacb5270 Change default setting of hw.wi.txerate to zero so that tx error msgs are
ignored (as before).  This was the original setting but a bug in ppsratecheck
made me do stupid things.
2003-02-26 17:18:35 +00:00
Sam Leffler 893bec8059 o fix ppsratecheck to interpret a maxpps of zero as "ignore everything"
o add a comment explaining the significance of using 0 or -1 (actually
  any negative value) for maxpps
2003-02-26 17:16:38 +00:00
Mike Barcroft 832b6bd471 Simplify struct __timespec, fix style bugs, add an XXX comment.
Submitted by:	bde
2003-02-26 16:50:01 +00:00
Olivier Houchard 33673595a6 Unbreak emu10k1 by properly using the buffer address.
New contestant for the lamest commit of the year award:	cognet
2003-02-26 16:11:18 +00:00
Maxime Henrion 09e192903c Unbreak the IOMMU code.
Pointy hat to:	mux
Reviewed by:	tmm
2003-02-26 15:02:55 +00:00
Mark Murray c63e8d6470 No-op. Change the type of unnamed bit-fields to unsigned to shut up
warnings.
2003-02-26 14:59:14 +00:00
Peter Grehan 4b67de3419 Register typo and incorrect 32-bit constant load in previous commit.
Resulted in AST delivery not working.
2003-02-26 14:41:39 +00:00
Orion Hodson a4273e83bc Replicate OSS behaviour when rate settings fails.
PR:	kern/26563
2003-02-26 14:38:19 +00:00
Jonathan Lemon ef6b48deb9 The TCP protocol lock may still be held if the reassembly queue dropped FIN.
Detect this case and drop the lock accordingly.

Sponsored by: DARPA, NAI Labs
2003-02-26 13:55:13 +00:00
Yoshihiro Takahashi a5459e94a5 Use rman_get_start() to get start address of the resource. 2003-02-26 13:46:40 +00:00
David Xu 426269b2c2 Fix a bug when handling SIGCONT.
Reported By: Mike Makonnen <mtm@identd.net>
2003-02-26 12:47:46 +00:00
Marcel Moolenaar 21c598caae Increase the block size for reading and writing from 8KB to 1MB and
introduce a preprocessor define for it. The larger block size
significantly speeds up the loading of the kernel.

Submitted by: Arun Sharma <arun.sharma@intel.com>
2003-02-26 09:13:05 +00:00
Mike Silbersack a75a485d62 Fix a condition so that ip reassembly queues are emptied immediately
when maxfragpackets is dropped to 0.

Noticed by:	bmah
2003-02-26 07:28:35 +00:00
Scott Long 303473e252 Bump __FreeBSD_version to note that taskqueue_swi now runs without Giant,
and the Giant-encumbered version is now called taskqueue_swi_giant.
2003-02-26 06:59:22 +00:00
Scott Long 3f9be55c27 Revert the use of -g that leaked in. 2003-02-26 06:56:46 +00:00
Bill Paul 0aef141cd0 Attempt to make the ng_fec module play nice with BPF again. Things have
changed since this code was written:

- The ng_ether_input_p hook only accepts two arguments now: the pointer
  to the ether header structure is gone.

- It's no longer necessary to cons up a fake ether header before passing
  incoming packets to BPF_MTAP().

ng_fec_input() has been modified to account for these two changes.
Running tcpdump on fec0 should work now.

PR:	kern/46720
2003-02-26 06:38:54 +00:00
David E. O'Brien a8896ec82d Consistently use NOFORTH to control the usage of ficl. 2003-02-26 06:18:52 +00:00
David Xu f5044aeb45 Better to not know anything about KSE. 2003-02-26 05:47:25 +00:00
Warner Losh 3dc191a139 Add SMC 34C90. Not tested, but should be a no-op except for the id string.
Print the sockbase when we can't get the memory for debug.
2003-02-26 05:45:48 +00:00
Warner Losh d705fb0577 Add a number of IDs from linux for old, rare pci devices:
o A second 82092AA id.
o SMC 34c90
Plus a couple of trivial formatting changes.
2003-02-26 05:44:00 +00:00
Scott Long ae54359608 Bring aac out from under Giant:
- the mutex aac_io_lock protects the main codepaths which handle queues and
  hardware registers.  Only one acquire/release is done in the top-half and
  the taskqueue.  This mutex also applies to the userland command path and
  CAM data path.
- Move the taskqueue to the new Giant-free version.
- Register the disk device with DISKFLAG_NOGIANT so the top-half processing
  runs without Giant.
- Move the dynamic command allocator to the worker thread to avoid locking
  issues with bus_dmamem_alloc().

This gives about 20% improvement in most of my benchmarks.
2003-02-26 04:46:21 +00:00
Scott Long 7874f606d5 Introduce a new taskqueue that runs completely free of Giant, and in
turns runs its tasks free of Giant too.  It is intended that as drivers
become locked down, they will move out of the old, Giant-bound taskqueue
and into this new one.  The old taskqueue has been renamed to
taskqueue_swi_giant, and the new one keeps the name taskqueue_swi.
2003-02-26 03:15:42 +00:00
Scott Long 13f9c3024f Use BUS_SPACE_MAXADDR_32BIT in the DMA tag where needed. Before the recent
fix to BUS_SPACE_MAXADDR, we were probably bouncing quite a bit =-(
2003-02-26 02:55:58 +00:00
Scott Long 46777e9769 Retire the aacd major (151) now that it's no longer needed. 2003-02-26 02:52:14 +00:00
Scott Long 7540e65e84 Move to 'struct disk*' API
Submitted by:	phk
2003-02-26 02:50:27 +00:00
Maxime Henrion f6c912dd0c Correctly set BUS_SPACE_MAXSIZE in all the busdma backends.
It was bogusly set to 64 * 1024 or 128 * 1024 because it was
bogusly reused in the BUS_DMAMAP_NSEGS definition.
2003-02-26 02:16:06 +00:00
David Xu 5614648e5e Add a missing '!'. 2003-02-26 01:56:14 +00:00
Robert Watson 05c06d15e8 Further GC of M_STRING, missed previously. 2003-02-26 01:00:29 +00:00
Robert Watson ae4f61f0d7 Replace license with two-clause BSD; an old license template with three
clauses was used by mistake.
2003-02-26 00:59:53 +00:00
Robert Watson b8e39e3ad3 GC M_STRING, no longer required as strdup() accepts a malloc type.
Requested by:	phk
2003-02-26 00:58:35 +00:00
David Xu 4b4866ed42 Add a simple facility to allow round roubin in userland.
Reviewed by:	julain
2003-02-26 00:58:23 +00:00
Jeff Roberson 48d4ffc119 - The interlock was not being droped in nfs_flush() if the first part of
an if clause was true.  Break the two clauses out into seperate statements
   since they require different actions.

Reported/Tested by:	jake
Spotted by:	jhb
2003-02-26 00:24:19 +00:00
Kirk McKusick 7e734c4149 When doing cleanup of excessive buffers in bdwrite (see kern/vfs_bio.c
delta 1.371) we must ensure that we do not get ourselves into a
recursive trap endlessly trying to clean up after ourselves.

Reported by:	Attila Nagy <bra@fsn.hu>
Sponsored by:   DARPA & NAI Labs.
2003-02-25 23:59:09 +00:00
Kirk McKusick 74f3809a19 Change the field used to test whether the superblock has been updated
from the filesystem size field to the filesystem maximum blocksize
field. The problem is that older versions of growfs updated only the
new size field and not the old size field. This resulted in the old
(smaller) size field being copied up to the new size field which
caused the filesystem to appear to fsck to be badly trashed.

This also adds a sanity check to ensure that the superblock is not
being updated when the filesystem is mounted read-only. Obviously
such an update should never happen.

Reported by:	Nate Lawson <nate@root.org>
Sponsored by:   DARPA & NAI Labs.
2003-02-25 23:21:08 +00:00
John Baldwin fe6301c61c Chase the musical variable names.
Pointy hat to:	jhb
Reported by:	des
2003-02-25 22:48:33 +00:00
Mike Makonnen 0bd5f7979d Unbreak mutex profiling (at least for me).
o Always check for null when dereferencing the filename component.
	o Implement a try-and-backoff method for allocating memory to
	  dump stats to avoid a spin-lock -> sleep-lock mutex lock order
	  panic with WITNESS.

Approved by:	des, markm (mentor)
Not objected:	jhb
2003-02-25 22:28:46 +00:00
Robert Watson 354d43abf3 Pass a malloc type into the libkern strdup() implementation explicitly,
so that callers can specify what malloc pool the resulting memory
should come from.

Requested by:	phk
2003-02-25 22:11:39 +00:00
Poul-Henning Kamp 9fed9b054d NO_GEOM cleanup:
Retire major #13 (da), #116 (ad), #157 (ar)
2003-02-25 22:09:10 +00:00
Poul-Henning Kamp f64bbf8b61 NO_GEOM cleanup:
Move to "struct disk *" centric api.
2003-02-25 22:06:21 +00:00
Søren Schmidt 2957c08b9c Fix support for Acer chips. The UDMA enable regs wasn't set properly. 2003-02-25 21:22:27 +00:00
David E. O'Brien 6e818956c5 Move most everything back to a MI NOTES, and use "nodevice" in MD NOTES
Where needed.  Use 'sed' for now in place of "nooptions".  Add a sparc64
MD NOTES.

Reviewed by:	arch@
2003-02-25 20:59:23 +00:00
John Baldwin e1159d10c0 Limit the maximum I/O size to 8 pages for version 2 controllers. This
fixes problems with some mlx(4) cards in Alpha machines.

Reviewed by:	msmith (ages ago)
2003-02-25 20:47:22 +00:00
John Baldwin 464e014eb9 Fix a small fat-finger: s/mlxd/mxld/.
Reported by:	Bob Willcox <bob@immure.com>
2003-02-25 20:35:56 +00:00
Jake Burkholder 0f1a7e05a2 - Added inlines pmap_is_current, pmap_is_alternate and pmap_set_alternate
for testing and setting the current and alternate address spaces.
- Changed PTDpde and APTDpde to arrays to support multiple page directory
  pages.

ponsored by:	DARPA, Network Associates Laboratories
2003-02-25 19:40:21 +00:00
Ruslan Ermilov e478cf0a5a Fixed CLEANFILES.
Submitted by:	cron
2003-02-25 15:41:49 +00:00
Søren Schmidt dd6a5ae906 Convert to new disk API.
Prodded by: phk
2003-02-25 15:33:36 +00:00