Commit graph

38741 commits

Author SHA1 Message Date
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
Tim J. Robbins 93997ef1c9 Allocate struct ipx_ifaddrs with an initial reference count of 1, not 0.
The wrong reference count was causing them to get freed too early and
have their contents scrambled.
2003-02-25 15:10:23 +00:00
Søren Schmidt 2e6c2a1089 Properly teardown the interrupt so we wont panic on detach. 2003-02-25 14:46:30 +00:00
Søren Schmidt 472e291b31 Removed the ISA only hooks here, no longer needed.. 2003-02-25 14:24:42 +00:00
Robert Watson 9327ee33bf When generating a TCP response to a connection, not only test if the
tcpcb is NULL, but also its connected inpcb, since we now allow
elements of a TCP connection to hang around after other state, such
as the socket, has been recycled.

Tested by:	dcs
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-02-25 14:08:41 +00:00
Maxime Henrion a4910cd21c Bump __FreeBSD_version for the d_mmap_t interface change. 2003-02-25 13:38:09 +00:00
Maxime Henrion b9deb009c2 Convert one more d_mmap_t consumer I missed in my previous commit. 2003-02-25 13:30:50 +00:00
Søren Schmidt ae64a900aa Fix support for the old CMD 646 chips, interrupt setup was wrong. 2003-02-25 12:56:37 +00:00
Maxim Konovalov b36f5b3735 style(9): join lines. 2003-02-25 11:53:11 +00:00
Maxim Konovalov 99e8617d24 Ip reassembly queue structure has ipq_nfrags now. Count a number of
dropped ip fragments precisely.

Reviewed by:	silby
2003-02-25 11:49:01 +00:00
David Xu d9b05fa0b0 Remove an unsafe KASSERT. 2003-02-25 11:23:17 +00:00
Jeff Roberson 869d735043 - Properly handle the vnode interlock in nfs_fsync.
Reported by:	phk
2003-02-25 08:50:21 +00:00
Jeff Roberson 2e3981a70c - Add the missing NULL interlock argument to a recently added BUF_LOCK. 2003-02-25 08:23:11 +00:00
Søren Schmidt b301920c88 Revert the probe code change.
It helped those fake devices probe delays to go away, but as a side
effect it also made some not so conforming CD/DVD drives go away...
2003-02-25 08:22:01 +00:00
Poul-Henning Kamp 5cd0cc885f NO_GEOM cleanup:
Move to "struct disk *" centric API.
Add NULL check to a malloc(9) return value.

Ok'ed by:	sos
2003-02-25 08:02:57 +00:00
Poul-Henning Kamp 42170da1d8 NO_GEOM cleanup:
Move to new "struct disk *" centric API.
Retire major #147 (twed)
2003-02-25 07:41:51 +00:00
Poul-Henning Kamp b2fe65c5be NO_GEOM cleanup:
Move to "struct disk*" centric API.
Retire major #131 (mlxd)
2003-02-25 07:35:41 +00:00
Poul-Henning Kamp e78dcaf403 Retire major #133 (amrd). 2003-02-25 07:24:51 +00:00
Alan Cox 077808c588 Fuse two #ifdefs with identical conditions. 2003-02-25 06:46:08 +00:00
Kirk McKusick 3a7053cb60 Prevent large files from monopolizing the system buffers. Keep
track of the number of dirty buffers held by a vnode. When a
bdwrite is done on a buffer, check the existing number of dirty
buffers associated with its vnode. If the number rises above
vfs.dirtybufthresh (currently 90% of vfs.hidirtybuffers), one
of the other (hopefully older) dirty buffers associated with
the vnode is written (using bawrite). In the event that this
approach fails to curb the growth in it the vnode's number of
dirty buffers (due to soft updates rollback dependencies),
the more drastic approach of doing a VOP_FSYNC on the vnode
is used. This code primarily affects very large and actively
written files such as snapshots. This change should eliminate
hanging when taking snapshots or doing background fsck on
very large filesystems.

Hopefully, one day it will be possible to cache filesystem
metadata in the VM cache as is done with file data. As it
stands, only the buffer cache can be used which limits total
metadata storage to about 20Mb no matter how much memory is
available on the system. This rather small memory gets badly
thrashed causing a lot of extra I/O. For example, taking a
snapshot of a 1Tb filesystem minimally requires about 35,000
write operations, but because of the cache thrashing (we only
have about 350 buffers at our disposal) ends up doing about
237,540 I/O's thus taking twenty-five minutes instead of four
if it could run entirely in the cache.

Reported by:	Attila Nagy <bra@fsn.hu>
Sponsored by:   DARPA & NAI Labs.
2003-02-25 06:44:42 +00:00
David Xu d4b570f053 Remove a bogus comment. 2003-02-25 05:17:18 +00:00
David Xu 768298d8c4 Remove a never true condition. 2003-02-25 05:14:18 +00:00
Jeff Roberson 17661e5ac4 - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.
- Remove the buftimelock mutex and acquire the buf's interlock to protect
   these fields instead.
 - Hold the vnode interlock while locking bufs on the clean/dirty queues.
   This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another
   BUF_LOCK with a LK_TIMEFAIL to a single lock.

Reviewed by:	arch, mckusick
2003-02-25 03:37:48 +00:00
Maxime Henrion 07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Jeffrey Hsu edf02ff15d Hold the TCP protocol lock while modifying the connection hash table. 2003-02-25 01:32:03 +00:00
Marcel Moolenaar 907cf80fbf Remove support for running in SimOS. The support has rotted over
time and there's no indication that it will improve anytime soon.
By removing support for SimOS it is possible to build LINT on
Alpha, which is considered more important at the moment.

Not objected to on: alpha@
2003-02-25 00:42:40 +00:00
David E. O'Brien 957a6263b6 Only apply rev 1.10 (which hacks around the i386 boot2 being too big for
both ufs1 and ufs2 support) on i386.
2003-02-25 00:10:20 +00:00
Poul-Henning Kamp 7d6ddd1027 NO_GEOM cleanup:
Move to new "struct disk *" centered API".

OK'ed by:	emoore
2003-02-24 21:49:27 +00:00
Jake Burkholder 5cd612b27e - Removed UMAXPTDI and UMAXPTEOFF.
- Changed VM_MAXUSER_ADDRESS to be defined in terms of PTDPTDI.  In order for
  assumptions about the recursive page table map to work it must be the base
  of the recursive map.  Any pte offset that's not NPTEPG will break these
  assumptions.

Sponsored by:	DARPA, Network Associates Laboratories
2003-02-24 20:29:52 +00:00
Alan Cox 3fa24ec9f1 In vm_page_dirty(), assert that the page is not in the free queue(s). 2003-02-24 17:30:45 +00:00
Alexander Kabaev ba873f4c18 Correctly map SIGSYS signal to/from Linux.
Submitted by:   "Georg-W. Koltermann" <g.w.k@web.de>
2003-02-24 16:16:45 +00:00
Yoshihiro Takahashi 2302407b21 The mpbiosreason variable does not used for pc98. 2003-02-24 14:36:03 +00:00
Yoshihiro Takahashi 7bc5ac11b7 Fix printf format error. 2003-02-24 14:32:27 +00:00
David Schultz 9cdb2d4d9d Expand the reference count on struct dquot to 32 bits.
This fixes a panic on large systems where a single user
may have more than 64K active or inactive vnodes.

PR:		48234
Reviewed by:	mike (mentor)
2003-02-24 08:49:59 +00:00
Kirk McKusick 3bf0ed940b When removing the last item from a non-empty worklist, the worklist
tail pointer must be updated.

Reported by:	Kris Kennaway <kris@obsecurity.org>
Sponsored by:   DARPA & NAI Labs.
2003-02-24 07:28:41 +00:00
David E. O'Brien e901be8e96 <machine/vmparam.h> is the right place to get KERNBASE, so don't special
platform case it (or use alternate spellings).
2003-02-24 06:56:18 +00:00
Sam Leffler 45e10ed9ef o instead of applying arbitrary tunables, just honor the COP_F_BATCH
flag that can be marked on each symmetric op
o eliminate hw.ubsec.maxbatch and hw.ubsec.maxaggr since they are not
  needed anymore
o change ubsec_feed to return void instead of int since zero is always
  returned and noone ever looked at the return value
2003-02-24 06:03:13 +00:00
Scott Long 3303c14b57 Don't NULL out p_fd until after closefd() has been called. This isn't
totally correct, but it has caused breakage for too long.  I welcome
someone with more fd fu to fix it correctly.
2003-02-24 05:46:55 +00:00
David E. O'Brien b9a49f7eb4 pst(4) should be portable across all our platforms. 2003-02-24 05:12:24 +00:00
Kirk McKusick c555826bd7 Revert to old (broken for over 1.5Tb filesystems) version of cgbase
so that boot loader once again will fit.

Sponsored by:   DARPA & NAI Labs.
2003-02-24 04:57:01 +00:00
David E. O'Brien 36f19f1bee Wrap the static endian functions to shutup GCC. 2003-02-24 04:44:53 +00:00
Mike Silbersack af9c7d06d5 Fix a comment which didn't match the new cookie behavior.
Submitted by:	Scott Renfro <scott@renfro.org>
MFC after:	1 day
2003-02-24 03:15:48 +00:00
Peter Grehan 597dc6637a Catch up with ATAng changes 2003-02-24 03:12:30 +00:00
Jonathan Lemon 060958481a Fix another case for timewait. 2003-02-24 02:06:50 +00:00
Jonathan Lemon 9c3309d174 Update to work with the new timewait state.
Reviewed by: sam
2003-02-24 02:06:02 +00:00
David Xu 0fccb684d1 Remove a XXXKSE. kg_completed now needs proc lock. 2003-02-24 01:28:10 +00:00
Jeffrey Hsu 11a20fb8b6 tcp_twstart() need to be called with the TCP protocol lock held to avoid
a race condition with the TCP timer routines.
2003-02-24 00:52:03 +00:00
David Xu f5878f69df Backout last surplus commit. That day just wasn't my day. 2003-02-24 00:49:55 +00:00
Jeffrey Hsu 2fbef91887 Pass the right function to callout_reset() for a compressed
TIME-WAIT control block.
2003-02-24 00:48:12 +00:00
Jake Burkholder 28c9e1aa5c Use the direct mapping of IdlePTD setup in locore for proc0's page directory,
instead of allocating another page of kva and mapping it in again.  This was
likely an oversight in revision 1.174 (cut and paste from pmap_pinit).

Discussed with:	peter, tegge
Sponsored by:	DARPA, Network Associates Laboratories
2003-02-24 00:39:50 +00:00
Peter Grehan 84188b7cc1 Add apple partition map GEOM module 2003-02-24 00:16:51 +00:00
David E. O'Brien 0f7d7a85f0 Make the 'a' parameter of bus_space_write_multi_stream_*() a const pointer. 2003-02-24 00:11:15 +00:00
Tor Egge 07d2563244 Allow machines with one CPU and a valid mp table to boot an SMP kernel. 2003-02-23 23:49:57 +00:00
Dan Moschuk 25b803ef49 Add support for Peppercon ROL-F Card.
Submitted by: Sascha Holzeiter <sascha@root-login.org>
PR: 48559
2003-02-23 23:35:35 +00:00
Marcel Moolenaar 0f265fea23 Use the correct size for reading and writing the PCI config space.
Reading the PCI config space with the wrong (larger) size is not
a problem in this case, but writing can be as it clobbers unrelated
registers. In this case the clobbering is for reserved fields, which
too is mostly harmless... for now. Hence, this change is mostly
preventive in nature.
2003-02-23 23:09:17 +00:00
Tor Egge 6a07a13944 Sync new socket nonblocking/async state with file flags in accept().
PR:		1775
Reviewed by:	mbr
2003-02-23 23:00:28 +00:00
David E. O'Brien 1e44b62e0d There is no reason to be cute with ntohl(). Just call it directly rather
than use a macro that tries to do conversions in place.

Compile tested on:	sparc64
2003-02-23 22:26:39 +00:00
Jake Burkholder ef49a94104 Previous commit missed a 1 that should be NGPTD, and an NPDEPG that should
be NPDEPTD.  Grumble.

Sponsored by:	DARPA, Network Associates Laboratories
2003-02-23 22:12:08 +00:00
David E. O'Brien 71655cc2c9 This commit was generated by cvs2svn to compensate for changes in r111368,
which included commits to RCS files with non-trunk default branches.
2003-02-23 21:58:31 +00:00
David E. O'Brien e242322ffe Import Linux's linux/include/asm-sparc64/bitopts.h.
This is taken from the 2.4.3 Linux sources as shipped on Red Hat 7.1 Alpha.
2003-02-23 21:58:31 +00:00
David E. O'Brien 068bd9b1d9 Import Linux's linux/include/asm-sparc64/bitopts.h.
This is taken from the 2.4.3 Linux sources as shipped on Red Hat 7.1 Alpha.
2003-02-23 21:58:31 +00:00
Jake Burkholder 910548dea7 - Added macros NPGPTD, NBPTD, and NPDEPTD, for dealing with the size of the
page directory.
- Use these instead of the magic constants 1 or PAGE_SIZE where appropriate.
  There are still numerous assumptions that the page directory is exactly
  1 page.

Sponsored by:	DARPA, Network Associates Laboratories
2003-02-23 21:20:00 +00:00
Brian Feldman 3fbe138ca9 It seems that sound(4)'s feeder routines don't need to allocate memory
without waiting, since they are called from a system-call context only.
This appears to fix all sorts of problems with open("/dev/dsp", O_WRONLY)
randomly returning ENXIO.

Found by:	cognet
2003-02-23 20:49:45 +00:00
David E. O'Brien 437ce69ead The rest of our platforms make bus_space_write_multi_stream_2's 'a' a
const pointer.
2003-02-23 20:42:32 +00:00
David E. O'Brien 2ae86927a6 Add an empty bus_space_unmap() like Alpha has. puc(4) uses it. 2003-02-23 19:54:16 +00:00
David E. O'Brien cc2f8c60cd PAGE_SIZE is unsigned on all our platforms, and is a long on some.
So cast to u_long before printing out and use a matching specifier.

Tested on:	sparc64
2003-02-23 19:49:30 +00:00
David E. O'Brien 660a811fcd Pass 'nodevice' onto the final output. 2003-02-23 19:40:45 +00:00
David E. O'Brien 40578dc8ce Add adv_adj_endian_qdone_info() & adv_adj_scsiq_endian()
so this at least compiles on big-endian machines.
2003-02-23 19:16:53 +00:00
Poul-Henning Kamp e165e4d26a NO_GEOM cleanup:
Move to "struct disk *" centered API.

Fix some minor nits.
2003-02-23 19:15:34 +00:00
Mike Silbersack a432399c56 Improve the security and performance of syncookies:
Security improvements:
- Increase the size of each syncookie secret from 32 to 128 bits
  in order to make brute force attacks on the secrets much more
  difficult.
- Always return the lowest order dword from the MD5 hash; this
  allows us to expose 2 more bits of the cookie and makes ACK
  floods which seek to guess the cookie value more difficult.

Performance improvements:
- Increase the lifetime of each syncookie from 4 seconds to 16
  seconds.  This increases the usefulness of syncookies during
  an attack.
- From Yahoo!: Reduce the number of calls to MD5Update; this
  results in a ~17% increase in cookie generation time here.

Reviewed by:	hsu, jayanth, jlemon, nectar
MFC After:	15 seconds
2003-02-23 19:04:23 +00:00
Poul-Henning Kamp e5dc8339ae NO_GEOM cleanup:
Move ida driver to "struct disk *" centric api.

Retire major number 109.
2003-02-23 18:45:50 +00:00
Poul-Henning Kamp 7d0bbeb87c Fix the detach code to actually detach the disk instance created
during attach.
2003-02-23 18:31:17 +00:00
Poul-Henning Kamp 6ccf52c822 Remove a goto the very next statement. 2003-02-23 18:20:03 +00:00
Poul-Henning Kamp 14ebcbfa42 Mark major 102 unused now that the fla driver no longer needs a major number. 2003-02-23 18:12:41 +00:00
Poul-Henning Kamp acb18acfec Bracket the kern.vnode sysctl in #ifdef notyet because it results
in massive locking issues on diskless systems.

It is also not clear that this sysctl is non-dangerous in its
requirements for locked down memory on large RAM systems.
2003-02-23 18:09:05 +00:00
Søren Schmidt 7931af6934 Temporarily disable tagged queueing while I figure out why it broke. 2003-02-23 16:43:26 +00:00
Søren Schmidt 4efc1603dc Fix chipset setup problem on older ALI chips. 2003-02-23 16:36:21 +00:00
Jonathan Lemon f243998be5 Yesterday just wasn't my day. Remove testing delta that crept into the diff.
Pointy hat provided by: sam
2003-02-23 15:40:36 +00:00
Søren Schmidt 9644f64b75 Fix timeout when using UDMA speeds, bad chip setup. 2003-02-23 15:05:04 +00:00
Robert Watson 96c4266cb3 Add an implementation of strdup() to libkern. Allocated memory is of
type M_STRING, now defined in malloc.h.  Useful when string parsing
must occur using the kernel strsep() and we want to avoid toasting
the source string.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-02-23 14:30:17 +00:00
Peter Grehan 9ea031d50b Doh. Forgot to remove _KERNEL version. 2003-02-23 13:47:44 +00:00
Poul-Henning Kamp 5cb3dc8fa3 OK, I was too sleepy there...
Pointy hat over here!
2003-02-23 13:45:55 +00:00
Yoshihiro Takahashi dddb791fa4 Add NOTES for pc98. 2003-02-23 13:34:21 +00:00
Yoshihiro Takahashi a0450500b3 Move MD devices to <machine>/conf/NOTES. 2003-02-23 13:32:33 +00:00
Yoshihiro Takahashi 08daad2b26 Merged from sys/dev/syscons/syscons.c revision 1.393. 2003-02-23 13:29:59 +00:00
Yoshihiro Takahashi d653affd6c Fix compile error with FB_INSTALL_CDEV option. 2003-02-23 13:28:44 +00:00
Yoshihiro Takahashi 0f46d10b5c MFi386: revision 1.554. 2003-02-23 13:26:21 +00:00
Yoshihiro Takahashi fe18df5d91 The ether_ifdetach() function requires only one argument now. 2003-02-23 13:24:26 +00:00
Yoshihiro Takahashi 6bc774603f Move ar_devclass definition to if_ar.c. 2003-02-23 13:20:42 +00:00
Yoshihiro Takahashi 8aee776d63 Remove unneeded entries and fix indent. 2003-02-23 13:17:27 +00:00
Poul-Henning Kamp 8f5ef1a9fa Implement CLOCK_MONOTONIC. 2003-02-23 10:18:31 +00:00
Jake Burkholder e29632c9e1 - Added macros PDESHIFT and PTESHIFT, use these instead of magic constants
in locore.
- Removed the macros PTESIZE and PDESIZE, use sizeof instead in C.

Sponsored by:	DARPA, Network Associates Laboratories
2003-02-23 09:45:50 +00:00
Sam Leffler eb73a605cd o add a CRYPTO_F_CBIMM flag to symmetric ops to indicate the callback
should be done in crypto_done rather than in the callback thread
o use this flag to mark operations from /dev/crypto since the callback
  routine just does a wakeup; this eliminates the last unneeded ctx switch
o change CRYPTO_F_NODELAY to CRYPTO_F_BATCH with an inverted meaning
  so "0" becomes the default/desired setting (needed for user-mode
  compatibility with openbsd)
o change crypto_dispatch to honor CRYPTO_F_BATCH instead of always
  dispatching immediately
o remove uses of CRYPTO_F_NODELAY
o define COP_F_BATCH for ops submitted through /dev/crypto and pass
  this on to the op that is submitted

Similar changes and more eventually coming for asymmetric ops.

MFC if re gives approval.
2003-02-23 07:25:48 +00:00
Marcel Moolenaar 19d4fb8e5c Workaround for compiling LINT. Large kernels (like LINT) can have
branch targets that are too far apart for the BRADDR relocation.
This is caused by the branch prediction optimizationi in the atomic
inlines here, because they jump across sections.
The workaround is to suppress jumping to a different section when
compiling LINT. To generate correct code in that case, the section
directives are replaced by a branch and a label to deal with the
fall-through case. Reasonably good C compilers will optimize this
away anyway, so the end result isn't really that bad.
2003-02-23 06:34:21 +00:00
Marcel Moolenaar 1583e8d08e Fix compilation on non-i386 machines. Inconsistent conditional
compilation yielded definitions that we're used.
2003-02-23 03:39:22 +00:00
Peter Grehan 485d645e63 Drop down Apple Partition Map code that has been in use by some
ppc developers for a while.

OK'd by:  phk
2003-02-23 01:25:35 +00:00
Orion Hodson 148f84cf1e Fix compilation on alpha. Pointy hat to Marcel. 2003-02-23 01:06:58 +00:00
Sam Leffler 14dd6717f8 Add a new config option IPSEC_FILTERGIF to control whether or not
packets coming out of a GIF tunnel are re-processed by ipfw, et. al.
By default they are not reprocessed.  With the option they are.

This reverts 1.214.  Prior to that change packets were not re-processed.
After they were which caused problems because packets do not have
distinguishing characteristics (like a special network if) that allows
them to be filtered specially.

This is really a stopgap measure designed for immediate MFC so that
4.8 has consistent handling to what was in 4.7.

PR:		48159
Reviewed by:	Guido van Rooij <guido@gvr.org>
MFC after:	1 day
2003-02-23 00:47:06 +00:00
Alan Cox 01a06ce250 The root of the splay tree maintained within the pm_pteobj always refers
to the last accessed pte page.  Thus, the pm_ptphint is redundant and can
be removed.
2003-02-22 23:43:08 +00:00
Jake Burkholder d44f8f150c unsigned -> pt_entry_t.
Sponsored by:	DARPA, Network Associates Laboratories
2003-02-22 23:41:27 +00:00
Jake Burkholder fc718df7d0 Add a /a modifier to the show ktr ddb command, which prints the whole trace
buffer without stopping.  Useful if you just want to capture the output but
can't run ktrdump.
2003-02-22 23:30:37 +00:00
Orion Hodson c7bbf97e00 o Add back support for DXS channels.
o Make DXS3 the primary playback channel.  It may be the only
universally supported channel with the assorted revisions of this
chipset.

o Add sysctl and handler for enabling s/pdif output from DXS3.
2003-02-22 23:28:15 +00:00
Peter Grehan d273b006c5 Expose powerpc_mb() to user-space. Currently needed for atomic.h users,
this may go away in the future.
2003-02-22 22:58:13 +00:00
Jonathan Lemon a14c749f04 Check to see if the TF_DELACK flag is set before returning from
tcp_input().  This unbreaks delack handling, while still preserving
correct T/TCP behavior

Tested by: maxim
Sponsored by: DARPA, NAI Labs
2003-02-22 21:54:57 +00:00
Robert Watson 90623e1a9e Don't panic when enumerating SYSCTL_NODE() nodes without any children
nodes.

Submitted by:	green, Hiten Pandya <hiten@unixdaemons.com>
2003-02-22 17:58:06 +00:00
Bosko Milekic fd18f292bd Make xl use m_getcl() to allocate an mbuf and a cluster in one shot,
as opposed to one after the other.  This is faster in both -CURRENT
and -STABLE.  Additionally, there is less code duplication for
error-checking.

One thing to note is that this code seems to return(1) when no buffers
are available; perhaps ENOBUFS should be the correct return value?

Partially submitted & tested by: Hiten Pandya <hiten@unixdaemons.com>
MFC after: 1 week
2003-02-22 14:46:31 +00:00
Poul-Henning Kamp 4209510904 It is pretty evident that nobody loves this file anymore, so retire it
to the Attic from where it can be picked up again, should it ever again
become fashionable to run an alpha simulator.
2003-02-22 13:52:38 +00:00
Poul-Henning Kamp d9af634109 Use DISKFLAG_OPEN rather than maintaining our own flag.
Use nullclose() rather than now empty twed_close().
2003-02-22 10:42:21 +00:00
Poul-Henning Kamp 89f8bb39da Use nullclose(), not noclose(). 2003-02-22 10:40:36 +00:00
Poul-Henning Kamp 1c7d84ed3c Don't use mbuf allocator flags for malloc(9). 2003-02-22 10:35:37 +00:00
Poul-Henning Kamp 3eb309c55e Use the standard DISKFLAG_OPEN instead of implementing our own.
Use noclose() instead now that our close method is empty.
2003-02-22 10:10:12 +00:00
Poul-Henning Kamp 3512c1b386 Use system noioctl() instead of homerolled. 2003-02-22 10:02:05 +00:00
Poul-Henning Kamp c3dbde2864 NO_GEOM cleanup: unifdef -UNO_GEOM 2003-02-22 09:36:40 +00:00
Poul-Henning Kamp d0083ea9ce NO_GEOM cleanup:
Move to "struct disk *" centric use of disk_* API.

Remove NOOP ioctl, spl*() and some debug printfs.
2003-02-22 09:32:57 +00:00
Mike Silbersack 375386e284 Add the ability to limit the number of IP fragments allowed per packet,
and enable it by default, with a limit of 16.

At the same time, tweak maxfragpackets downward so that in the worst
possible case, IP reassembly can use only 1/2 of all mbuf clusters.

MFC after: 	3 days
Reviewed by:	hsu
Liked by:	bmah
2003-02-22 06:41:47 +00:00
Mike Makonnen 750a91d8b1 Remove a comment which hasn't been true since rev. 1.158
Approved by:	jhb, markm (mentor)(implicit)
2003-02-22 05:59:48 +00:00
Robert Watson 838a6d03e8 Export the name of the device used to mount the root file system as
kern.rootdev.  If rootdev is undefined (NFS mount, etc), export an
empty string.

Desired by:	peter
2003-02-22 05:01:12 +00:00
Kirk McKusick 5bb651cb72 This patch fixes a deadlock between the bufdaemon and a process taking
a snapshot. As part of taking a snapshot of a filesystem, the kernel
builds up a list of the filesystem metadata (such as the cylinder
group bitmaps) that are contained in the snapshot. When doing a
copy-on-write check, the list is first consulted. If the block being
written is found on the list, then the full snapshot lookup can be
avoided. Besides providing an important performance speedup this
check also avoids a potential deadlock between the code creating
the snapshot and the bufdaemon trying to cleanup snapshot related
buffers. This fix creates a temporary list containing the key
metadata blocks that can cause the deadlock. This temporary list
is used between the time that the snapshot is first enabled and the
time that the fully complete list is built.

Reported by:	Attila Nagy <bra@fsn.hu>
Sponsored by:   DARPA & NAI Labs.
2003-02-22 00:59:34 +00:00
Kirk McKusick 37e2ebfdba This patch fixes a bug on an active filesystem on which a snapshot
is being taken from panicing with either "freeing free block" or
"freeing free inode". The problem arises when the snapshot code
is scanning the filesystem looking for inodes with a reference
count of zero (e.g., unlinked but still open) so that it can
expunge them from its view. If it encounters a reclaimed vnode
and has to restart its scan, then it will panic if it encounters
and tries to free an inode that it has already processed. The fix
is to check each candidate inode to see if it has already been
processed before trying to delete it from the snapshot image.

Sponsored by:   DARPA & NAI Labs.
2003-02-22 00:29:51 +00:00
Kirk McKusick d60682c239 This patch fixes a bug in the logical block calculation macros so
that they convert to 64-bit values before shifting rather than
afterwards. Once fixed, they can be used rather than inline expanded.

Sponsored by:   DARPA & NAI Labs.
2003-02-22 00:19:26 +00:00
Poul-Henning Kamp ad3467e1fc NO_GEOM cleanup: Convert CCD(4) to be use "struct disk*" instead of "dev_t"
as "this" handle.
2003-02-21 23:25:43 +00:00
Poul-Henning Kamp d25ecb917b - m = m_gethdr(M_NOWAIT, MT_HEADER);
+       m = m_gethdr(M_DONTWAIT, MT_HEADER);

'nuff said.
2003-02-21 23:17:12 +00:00
Bosko Milekic acc769b2ec Nuke EPIC_MGETCLUSTER entirely. Since 1.60 we don't use it anymore and
instead use our optimized m_getcl().

Submitted by: Hiten Pandya <hiten@unixdaemons.com>
MFC After: 1 week
2003-02-21 23:12:32 +00:00
Peter Wemm 86bb731626 Missing M_TRYWAIT from so_upcall third argument. 2003-02-21 22:23:40 +00:00
Poul-Henning Kamp 2c6b49f6af NO_GEOM cleanup:
Retire the "d_dump_t" and use the "dumper_t" type instead.

Dumper_t takes a void * as first arg which is more general than the
dev_t taken by d_dump_t.  (Remember: we could have net-dumpers if
somebody wrote us one!)

Define the convention for GEOM controlled disk devices to be that the
first argument to the dumper function is the struct disk pointer.

Change device drivers accordingly.
2003-02-21 19:00:48 +00:00
Bosko Milekic 812c95c8f3 Some style fixes.
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-21 16:24:49 +00:00
Poul-Henning Kamp b82ff75854 NO_GEOM cleanup:
Change the argument to disk_destroy() to be the same struct disk * as
disk_create() takes.

This enables drivers to ignore the (now) bogus dev_t which disk_create()
returns.
2003-02-21 15:13:26 +00:00
Ruslan Ermilov 73b893a720 Overhaul the targets and hope this is now much more readable.
This adds some orthodox kernel-* and modules-* targets and
retires harmful ``clobber''.

Now, do we really want to keep the ``modules'' target here?
2003-02-21 11:02:49 +00:00
David Xu 34ada4b3bb If UTS kernel is calling kse_wakeup for itself, do nothing. 2003-02-21 07:11:38 +00:00
Kenneth D. Merry 56eac725a3 Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fix
a number of related problems along the way.

 - Automatically detect CDROM drives that can't handle 6 byte mode
   sense and mode select, and adjust our command size accordingly.
   We have to handle this in the cd(4) driver (where the buffers are
   allocated), since the parameter list length is different for the
   6 and 10 byte mode sense commands.

 - Remove MODE_SENSE and MODE_SELECT translation removed in ATAPICAM
   and in the umass(4) driver, since there's no way for that to work
   properly.

 - Add a quirk entry for CDROM drives that just hang when they get a 6
   byte mode sense or mode select.  The reason for the quirk must be
   documented in a PR, and all quirks must be approved by
   ken@FreeBSD.org.  This is to make sure that we fully understand why
   each quirk is needed.  Once the CAM_NEW_TRAN_CODE is finished, we
   should be able to remove any such quirks, since we'll know what
   protocol the drive speaks (SCSI, ATAPI, etc.) and therefore whether
   we should use 6 or 10 byte mode sense/select commands.

 - Change the way the da(4) handles the no_6_byte sysctl.  There is
   now a per-drive sysctl to set the minimum command size for that
   particular disk.  (Since you could have multiple disks with
   multiple requirements in one system.)

 - Loader tunable support for all the sysctls in the da(4) and cd(4)
   drivers.

 - Add a CDIOCCLOSE ioctl for cd(4) (bde pointed this out a long
   time ago).

 - Add a media validation routine (cdcheckmedia()) to the cd(4)
   driver, to fix some problems bde pointed out a long time ago.  We
   now allow open() to succeed no matter what, but if we don't detect
   valid media, the user can only issue CDIOCCLOSE or CDIOCEJECT
   ioctls.

 - The media validation routine also reads the table of contents off
   the drive.  We use the table of contents to implement the
   CDIOCPLAYTRACKS ioctl using the PLAY AUDIO MSF command.  The
   PLAY AUDIO TRACK INDEX command that we previously used was
   deprecated after SCSI-2.  It works in every SCSI CDROM I've tried,
   but doesn't seem to work on ATAPI CDROM drives.  We still use the
   play audio track index command if we don't have a valid TOC, but
   I suppose it'll fail anyway in that case.

 - Add _len() versions of scsi_mode_sense() and scsi_mode_select() so
   that we can specify the minimum command length.

 - Fix a couple of formatting problems in the sense printing code.

MFC after: 	4 weeks
2003-02-21 06:19:38 +00:00
Crist J. Clark b0d226932e The ancient and outdated concept of "privileged ports" in UNIX-type
OSes has probably caused more problems than it ever solved. Allow the
user to retire the old behavior by specifying their own privileged
range with,

  net.inet.ip.portrange.reservedhigh  default = IPPORT_RESERVED - 1
  net.inet.ip.portrange.reservedlo    default = 0

Now you can run that webserver without ever needing root at all. Or
just imagine, an ftpd that can really drop privileges, rather than
just set the euid, and still do PORT data transfers from 20/tcp.

Two edge cases to note,

  # sysctl net.inet.ip.portrange.reservedhigh=0

Opens all ports to everyone, and,

  # sysctl net.inet.ip.portrange.reservedhigh=65535

Locks all network activity to root only (which could actually have
been achieved before with ipfw(8), but is somewhat more
complicated).

For those who stick to the old religion that 0-1023 belong to root and
root alone, don't touch the knobs (or even lock them by raising
securelevel(8)), and nothing changes.
2003-02-21 05:28:27 +00:00
Hidetoshi Shimokawa 41dc7a9831 Oops, forgot to put back debug level. 2003-02-21 02:27:13 +00:00
Hidetoshi Shimokawa 559dfd9b55 remove unused code. 2003-02-21 02:14:00 +00:00
Hidetoshi Shimokawa cd1f52fe80 Fix typo
Submitted by: Masahiro Ito <m_itoh@mub.biglobe.ne.jp>
2003-02-21 02:09:39 +00:00
Hidetoshi Shimokawa d17c7743c6 Don't scan lun by myself while boot process leave it CAM to scan the bus.
Some drives seem to be confused by simultaneous probes.

Tested by: marcel

As a side effect, logical units whose lun is greater than 0 might not be
probed correctly if the lun of 0 doesn't exist in the target because
CAM doesn't scan such luns.
I have a SCSI-FireWire bridge which maps SCSI-ID to LUN and it is an
example of such targets.
2003-02-21 02:09:04 +00:00
Orion Hodson 3299968464 Clean up viachan_init. 2003-02-21 01:47:59 +00:00
Orion Hodson 439fa3dd0a Fix assignment of record sgd_addr and clean up via8233chan_init. 2003-02-21 01:47:17 +00:00
Scott Long 65ac4ed65e On detach, don't remove the child from our list of children unless it has
successfully detached.
2003-02-20 23:13:48 +00:00
Poul-Henning Kamp 263444cfbf Change the console interface to pass a "struct consdev *" instead of a
dev_t to the method functions.

The dev_t can still be found at struct consdev *->cn_dev.

Add a void *cn_arg element to struct consdev which the drivers can use
for retrieving their softc.
2003-02-20 20:54:45 +00:00
Søren Schmidt bb5bdd386e First round off updates/fixes to the ATA driver.
This moves all chipset specific code to a new file 'ata-chipset.c'.
Extensive use of tables and pointers to avoid having the same switch
on chipset type in several places, and to allow substituting various
functions for different HW arch needs.
Added PIO mode setup and all DMA modes.
Support for all known SiS chipsets. Thanks to Christoph Kukulies for
sponsoring a nice ASUS P4S8X SiS648 based board for this work!

Tested on:	i386, PC98, alpha and sparc64
2003-02-20 20:02:32 +00:00
Søren Schmidt 4b25d7a6e4 First round off updates/fixes to the ATA driver.
This moves all chipset specific code to a new file 'ata-chipset.c'.
Extensive use of tables and pointers to avoid having the same switch
on chipset type in several places, and to allow substituting various
functions for different HW arch needs.
Added PIO mode setup and all DMA modes.
Support for all known SiS chipsets. Thanks to Christoph Kukulies for
sponsoring a nice ASUS P4S8X SiS648 based board for this work!

Tested on:	i386, PC98, alpha and sparc64
2003-02-20 19:55:45 +00:00
Jonathan Lemon 8608c4c1f9 Remove unused variables in the IPSEC case.
Submitted by:  Lars Eggert <larse@ISI.EDU>
2003-02-20 18:22:21 +00:00
Olivier Houchard 38cc994207 Implement a "sndbuf_getbufaddr" function and use it instead of vtophys().
Reviewed by:	orion
2003-02-20 17:31:12 +00:00
Maxime Henrion 659be1116f Uncomment the xl(4) driver since it's now working properly
on sparc64.
2003-02-20 17:08:42 +00:00
Poul-Henning Kamp 02574b19e1 Add a dead_cdevsw which does its best to return ENXIO if at all possible.
In devsw() return dead_cdevsw instead of NULL in case the dev_t does not
have a si_devsw.

This may improve our survival chances with devices which go away unexpectedly.
2003-02-20 15:35:54 +00:00
Tim J. Robbins 8fcac23f33 Regen from syscalls.master 1.50. 2003-02-20 13:34:15 +00:00
Tim J. Robbins c7edd68c94 Mark linux_getpid(), linux_getuid() and linux_getgid() as MPSAFE. 2003-02-20 13:32:48 +00:00
Hajimu UMEMOTO 5b13e7814b Add M_WAITOK 2003-02-20 11:24:55 +00:00
Scott Long 3cbd08b843 The completion queue is no longer used, so nuke its associated code
and data structures.
2003-02-20 08:51:16 +00:00
David Xu ab7d94f7eb Forgot to set KU_DOUPCALL in kse_wakeup. 2003-02-20 08:22:04 +00:00
David Xu eb117d5cb0 Add a timeout parameter to kse_release. 2003-02-20 08:18:15 +00:00
Marcel Moolenaar 344c6212b8 Simplify page alignment. 2003-02-20 06:47:54 +00:00
Peter Wemm d8fcb6da11 Fix fumble in rev 1.525. pmap_kenter()'s second argument is a physical
address, not a page index.

Laughed at by:  jake
2003-02-20 05:35:52 +00:00
Bosko Milekic 025b4be197 o Allow "buckets" in mb_alloc to be differently sized (according to
compile-time constants).  That is, a "bucket" now is not necessarily
  a page-worth of mbufs or clusters, but it is MBUF_BUCK_SZ, CLUS_BUCK_SZ
  worth of mbufs, clusters.
o Rename {mbuf,clust}_limit to {mbuf,clust}_hiwm and introduce
  {mbuf,clust}_lowm, which currently has no effect but will be used
  to set the low watermarks.
o Fix netstat so that it can deal with the differently-sized buckets
  and teach it about the low watermarks too.
o Make sure the per-cpu stats for an absent CPU has mb_active set to 0,
  explicitly.
o Get rid of the allocate refcounts from mbuf map mess.  Instead,
  just malloc() the refcounts in one shot from mbuf_init()
o Clean up / update comments in subr_mbuf.c
2003-02-20 04:26:58 +00:00
Tim J. Robbins 27e39ae4d8 Remove the PL_SHAREMOD flag from struct plimit, which could have been
used to share resource limits between rfork threads, but never was.
Removing it makes resource limit locking much simpler -- only the current
process can change the contents of the structure that p_limit points to.
2003-02-20 04:18:42 +00:00
Olivier Houchard fe6d8dd8ee Add a "hw.syscons.bell" sysctl, which can disable the bell at syscons level. 2003-02-20 03:27:09 +00:00
Olivier Houchard d6bf23783f Remove duplicate includes.
Submitted by:	Cyril Nguyen-Huu <cyril@ci0.org>
2003-02-20 03:26:11 +00:00
Olivier Houchard f5ca18bc8c Merge diff between rev 1.08 and rev 1.11 of Tekram driver, this notably add
support for Tekram DC395U2W cards.
Add a fix submitted by joerg@ to correctly report some errors to CAM.
Use bus_dma instead of the remaining vtophys().
2003-02-20 03:21:34 +00:00
Bosko Milekic ec73437395 Fix a serious bug when computing the index for the
reference counter array for mbuf clusters.  I don't know
how this got past early testing nor how it survived so long
without getting caught.  If anyone was seeing really really
bizarre memory corruption in a few mbufs this would be why.
2003-02-20 03:01:04 +00:00
Peter Grehan 9ec2814126 Adjust IRQ count for psim's OpenPIC model - it seems to be
off by 1.
2003-02-20 01:59:42 +00:00
Peter Grehan c0bf6c1f26 Catch up to latest KSE changes 2003-02-20 01:57:49 +00:00
David Xu a87891ee9e Move thread limits testing code up a bit. This let UPCALLING thread
takes possible accumulated contexts away.
2003-02-20 01:11:17 +00:00
Jonathan Lemon ffae8c5a7e Unbreak non-IPV6 compilation.
Caught by: phk
Sponsored by: DARPA, NAI Labs
2003-02-19 23:43:04 +00:00
Scott Long cb0d64b9b9 Fix a 64-bit bogon. The hardware command structure only has one 32 bit
field for holding driver-dependant data.  Instead of putting the pointer
to the driver command struct in there, take advantage of these structs
being a (virtually) contiguous array and just put the array index in the
field.
2003-02-19 23:33:56 +00:00
Poul-Henning Kamp 0c977c9c53 Add M_WAITOK 2003-02-19 22:51:33 +00:00
Jonathan Lemon 340c35de6a Add a TCP TIMEWAIT state which uses less space than a fullblown TCP
control block.  Allow the socket and tcpcb structures to be freed
earlier than inpcb.  Update code to understand an inp w/o a socket.

Reviewed by: hsu, silby, jayanth
Sponsored by: DARPA, NAI Labs
2003-02-19 22:32:43 +00:00
Jonathan Lemon 7990938421 Convert tcp_fillheaders(tp, ...) -> tcpip_fillheaders(inp, ...) so the
routine does not require a tcpcb to operate.  Since we no longer keep
template mbufs around, move pseudo checksum out of this routine, and
merge it with the length update.

Sponsored by: DARPA, NAI Labs
2003-02-19 22:18:06 +00:00
Scott Long 9c3a7fce37 Make the aac driver be INTR_MPSAFE. Once the interrupt handler determines
that a command completion happened, all further processing is deferred to
a taskqueue.  The taskqueue itself runs implicetely under Giant, but we
already used a taskqueue for the biodone() processing, so this at least
saves the contesting of Giant in the interrupt handler.
2003-02-19 21:58:34 +00:00
Scott Long 8480cc638e o Move the cleanup of the fib maps into aac_free_commands() so as to
retain symetry with aac_alloc_commans().  Since aac_alloc_commands()
  allocates fib maps and places them onto the fib lists, aac_free_commands()
  should reverse those operations.

o Combine two ifs with the same body with an ||.

o Switch from uintptr_t to uint32_t for fib map load operations.
  The target is a uint32_t so using this type for the map load call
  avoids an extra cast.  uintptr_t should only be used when you need
  an "int sized the same as the machine's poitner size" which is not
  the case here.

o Removed the commented out M_WAITOK flag in the allocation in
  aac_alloc_commands().  The kernel will only block in the allocator
  if it can grow the size of the kernel.  This usually results in a
  page-out which could involve this aac device.  Thus, sleeping here
  could deadlock the machine.  Assuming this operation is occurring outside
  of attach time, we have enough fibs to operate anyway, so waiting for
  fibs to free up is okay if not optimal.

o In aac_alloc_commands(), if we cannot dmamem_alloc additional fib
  space, free the fib map.

o In aac_alloc_commands(), if we cannot create per-command dmamaps, don't
  lose track of the fib map that is mapping all of the commands that we
  have already released into the free pool.  Instead, just cut out of
  the loop and modify aac_free_commands to not attempt to free maps that
  have not been allocated.

o Don't use a magic number when pre-allocating fibs.

o Use PAGE_SIZE to allocate in page sized chunks instead of an
  architecture specific constant.

Submitted by: gibbs
2003-02-19 21:38:29 +00:00
Jonathan Lemon 414462252a Correct comments. 2003-02-19 21:33:46 +00:00
Jonathan Lemon 3bfd6421c2 Clean up delayed acks and T/TCP interactions:
- delay acks for T/TCP regardless of delack setting
   - fix bug where a single pass through tcp_input might not delay acks
   - use callout_active() instead of callout_pending()

Sponsored by: DARPA, NAI Labs
2003-02-19 21:18:23 +00:00
Poul-Henning Kamp ec20bdf897 #include "opt_cpu.h" so we notice our options. 2003-02-19 20:50:02 +00:00
Jake Burkholder 367a0516d8 Fix definite panic when releasing interrupt resources.
Spotted by:	tmm
2003-02-19 19:40:40 +00:00
Maxime Henrion 5e303db539 Fix panic on sparc64 introduced in my last commit. I really
wish the busdma APIs were more consistent accross architectures.

We should probably move all the other DMA map creations in
xl_attach() where we can really handle them failing, since
xl_init() is void and shouldn't fail.

Pointy hat to:	mux
Tested by:	Anders Andersson <anders@hack.org>
2003-02-19 18:33:29 +00:00
Jake Burkholder b41be772ad Missed a missing M_WAITOK. 2003-02-19 17:29:07 +00:00
Jake Burkholder a5902eaf0c Use M_WAITOK. 2003-02-19 17:25:58 +00:00
David Xu fc8cdd87d2 Count non-threaded group. 2003-02-19 13:40:24 +00:00
David Xu 4f6cfa4520 Update comments to reflect new KSE code. 2003-02-19 13:36:51 +00:00
Tim J. Robbins 6dae0c1e3e Do not call smbfs_attr_cacheremove() in the EXDEV case in smbfs_rename().
One of the vnodes is on different mount and is possibly on a different
kind of filesystem; treating it as an smbfs vnode then writing to it
will probably corrupt it.

PR:		48381
MFC after:	1 month
2003-02-19 11:54:35 +00:00
Tim J. Robbins a44a414e11 The "m = m->m_next" that was removed in the revision 1.12 was necessary
for the m->m_next != NULL case to avoid looping infinitely when the first
mbuf in the chain becomes full.
2003-02-19 10:12:42 +00:00
David Xu 30621e142d M_WAITOK and remove an useless comment. 2003-02-19 09:59:12 +00:00
Jake Burkholder eba43df47a Munge the zs sbus attachment to work with fhc. This is a bit of a hack,
but they would otherwise be almost identical so there's not much point in
splitting it up further.
2003-02-19 08:29:17 +00:00
Jake Burkholder 63ec9d57c9 Implement interrupt resource allocation and setup. Set the interrupt
group number properly based on the board id.  Perform dummy reads of
registers after writing to flush the hardware write buffers.

This gets the soon to be committed zs attachment working.
2003-02-19 08:23:38 +00:00
David Xu 9de9159822 Eliminate unused KSE symbols. 2003-02-19 06:59:00 +00:00
Poul-Henning Kamp a23c180ec5 Bump __FreeBSD_version to mark the fact that <sys/dkstat.h> should no longer
be included.
2003-02-19 06:32:52 +00:00
Warner Losh a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
David Xu 0252d20369 Optimize the case when max threads number was hit. 2003-02-19 04:01:55 +00:00
Peter Wemm bbf9145de3 Remove unused variable and code. 2003-02-19 00:32:01 +00:00
Peter Wemm 169ade77af Get rid of a silly message I added back in Sept 2001 (1.68). 2003-02-18 23:45:01 +00:00
Paul Saab 2648ded594 Add some PCI device ID's from HP 2003-02-18 21:53:44 +00:00
Warner Losh 51715fe79d Move the resource handling down into the pci bus as well.
Minor CIS resource allocation code cleanup
Remove some fairly useless debug writes.

This finishes the work to move as much cardbus code as possible into
pci.  We wind up removing 800-odd lines from cardbus.c: we go from
1285 to 400 lines.

Reviewed by: mdodd
2003-02-18 21:24:00 +00:00
Maxime Henrion 44250c5cd8 - Fix mbuf leak when we successfully allocate a new mbuf but fail to
bus_dmamap_load() it.
- Make it so reusing mbufs when we can't allocate (or map) new ones
  actually works.  We were previously trying to reuse a mbuf which
  was already bus_dmamap_unload()'ed.

Reviewed by:	silby
2003-02-18 18:50:54 +00:00
Hidetoshi Shimokawa d5e6895166 Fix fwdev memory leak on detaching. 2003-02-18 10:56:00 +00:00
Hidetoshi Shimokawa 69f034dae4 Use pci_get_devid(). 2003-02-18 10:01:44 +00:00
Hidetoshi Shimokawa 12f2a2958b Add 'uPD72871/2 IEEE1394 1-Chip OHCI Host Controller'. 2003-02-18 09:46:52 +00:00
Hidetoshi Shimokawa 1adf684228 * firewire.c
- Fix memory leak in detaching.
- Initialize fc->status to other than FWBUSREST.

* fwohci.c
- Ignore BUS reset events while BUS reset phase. We can't clear that flag
	during bus reset phase.
2003-02-18 09:39:48 +00:00
Jake Burkholder cce6f96a05 Add central and fhc. 2003-02-18 09:38:51 +00:00
Jake Burkholder 012d9539bf Add drivers for the central and fhc busses found in enterprise class
UltraSPARCs, and an eeprom attachment for fhc, which allows the date
to be set properly on these machines.  Central is a wierd bus which
seems to only ever have 1 fhc attached to it.   FHC (FireHose Controller)
is another wierd bus with various things on it depending where its attached.
The fhc attached to central has eeprom and zs, and the fhcs which attach
directly to nexus have simm-status, environment and other nodes, none of
which I'll probably ever have documentation for.

Thanks to Ade Lovett for providing access to an 8 cpu e4500.
2003-02-18 09:01:01 +00:00
Sam Leffler 0bbd84e2d0 remove stray debugging printf
Noted by:	Kasper Steensgaard <steensgaard@person.dk>
2003-02-18 06:25:46 +00:00
Sam Leffler 5c47350dad M_MOVE_PKTHDR must happen before any cluster is attached
Submitted by:	Harti Brandt <brandt@fokus.fraunhofer.de>
MFC after:	1 day
2003-02-18 06:20:16 +00:00
Peter Wemm af3d516f55 Initiate de-orbit burn for USE_PCI_BIOS_FOR_READ_WRITE. This has been
#if'ed out for a while.  Complete the deed and tidy up some other bits.

We need to be able to call this stuff from outer edges of interrupt
handlers for devices that have the ISR bits in pci config space.  Making
the bios code mpsafe was just too hairy.  We had also stubbed it out some
time ago due to there simply being too much brokenness in too many systems.
This adds a leaf lock so that it is safe to use pci_read_config() and
pci_write_config() from interrupt handlers.  We still will use pcibios
to do interrupt routing if there is no acpi.. [yes, I tested this]

Briefly glanced at by:  imp
2003-02-18 03:36:49 +00:00
Warner Losh 2c422e4625 Include class designation in pnpinfo for generic driver loading 2003-02-18 03:25:57 +00:00
Scott Long 72d3502e50 Sanity check the BAR length reported by the CIS with the BAR length that
is encoded in the PCI BAR.  The latter is more reliable.

This allows the sio/modem function of the Xircom RealPort ethernet+modem
card to work.  Note that there still seem to be issues with sio_pci not
releasing resources on detach.
2003-02-17 23:47:31 +00:00
Warner Losh 5794c59372 Move the pnp and location info into the common pci bus. Make all known
pci busses implement this.

Also minor comment smithing in cardbus.  Fix copyright to this year
with my name on it since I've been doing a lot to this file.

Reviewed by: jhb
2003-02-17 21:20:35 +00:00
Warner Losh 1493e06d04 an driver now needs wlan, so put the required explicit depends
into the source.

Reviewed by: ambrisko
2003-02-17 19:57:32 +00:00
Warner Losh 29575b16f5 Kill a now-bogus comment 2003-02-17 19:48:39 +00:00
Warner Losh 180811460d These don't need to be semi-public after all. 2003-02-17 19:47:02 +00:00
Warner Losh 016f481986 Bump pnpinfo and location size to 128 bytes. Since these are computed
on the fly and read into userland one at a time, this costs very
little total memory.  The pnpinfo sizes of pccard is more than 64
bytes due to the length of the strings that man cards have in their
CIS.
2003-02-17 19:01:33 +00:00
David Xu 88aba94cdc Further fix PS_NEEDSIGCHK 2003-02-17 14:54:57 +00:00
David Xu 02bbffaf3c Move code for detecting PS_NEEDSIGCHK into thread_schedule_upcall,
I think it is a better place to handle it.
2003-02-17 14:41:22 +00:00
Hidetoshi Shimokawa f918ec7bac * firewire.c
- Don't initiate bus reset even if probe failed for some nodes to prevent
	infinite bus reset loop.

Problem Reported by: Pierre Beyssac <pb@fasterix.frmug.org>

- Protect timeout routine with splfw() for 4-stable.

* sbp.c

- Make sure to release devq when start request.
2003-02-17 14:24:06 +00:00
Maxim Konovalov 27b15c23f8 o Restore an interrupt priority level before return.
Submitted by:	Roman Kurakin <rik@cronyx.ru>
Reviewed by:	joerg
MFC after:	5 days
2003-02-17 13:41:55 +00:00
Maxim Konovalov b52d5ea3d2 o Fix ipfw uid rules: socheckuid() returns 0 when uid matches a socket
cr_uid.

Note: we do not have socheckuid() in RELENG_4, ip_fw2.c uses its
own macro for a similar purpose that is why ipfw2 in RELENG_4 processes
uid rules correctly. I will MFC the diff for code consistency.

Reported by:	Oleg Baranov <ol@csa.ru>
Reviewed by:	luigi
MFC after:	1 month
2003-02-17 13:39:57 +00:00
Julian Elischer 3931c9a231 Fix missed patch in last commit 2003-02-17 10:21:32 +00:00
Tim J. Robbins 96d7f8ef46 Use the proc lock to protect p_realtimer instead of Giant, and obtain
sched_lock around accesses to p_stats->p_timer[] to avoid a potential
race with hardclock. getitimer(), setitimer() and the realitexpire()
callout are now Giant-free.
2003-02-17 10:03:02 +00:00
Jeff Roberson 58a3c27384 - Add a new function, thread_signal_add(), that is called from postsig to
add a signal to a mailbox's pending set.
 - Add a new function, thread_signal_upcall(), this causes the current thread
   to upcall so that we can deliver pending signals.

Reviewed by:	mini
2003-02-17 09:58:11 +00:00
Julian Elischer 4a338afd7a Move a bunch of flags from the KSE to the thread.
I was in two minds as to where to put them in the first case..
I should have listenned to the other mind.

Submitted by:	 parts by davidxu@
Reviewed by:	jeff@ mini@
2003-02-17 09:55:10 +00:00
Marcel Moolenaar d1d78df69b Define _ALIGNBYTES to be 15. This should have been done right away. 2003-02-17 09:53:29 +00:00
Marcel Moolenaar a2ca37c83e Print two new processor features:
o  Spontaneous deferral (A feature required by dutch railways :-)
o  16-byte atomic operations (ld, st, cmpxchg)
2003-02-17 08:17:26 +00:00
Jeff Roberson 5215b1872f - Split the struct kse into struct upcall and struct kse. struct kse will
soon be visible only to schedulers.  This greatly simplifies much the
   KSE code.

Submitted by:	davidxu
2003-02-17 05:14:26 +00:00
Warner Losh 50cc4892cb Move call to pci_print_verbose until after all the variables that it
depends on.

Pointy hat to: imp (anybody know if these things are accepted at Eco-Cycle?)
2003-02-17 04:13:44 +00:00
Jeff Roberson e4625663c9 - Move ke_sticks, ke_iticks, ke_uticks, ke_uu, ke_su, and ke_iu back into
the proc.  These counters are only examined through calcru.

Submitted by:	davidxu
Tested on:	x86, alpha, UP/SMP
2003-02-17 02:19:58 +00:00
Andrew Gallatin 71a45f46e7 zero the end of the memory cluster we're disposing of. Otherwise teh
vm page startup code finds a 20GB cluster on this wacky alphaserver I'm
working on..

MFC After: 7 days
2003-02-16 19:25:04 +00:00
Poul-Henning Kamp 029f0b69a4 Change "dev_t gdbdev" to "void *gdb_arg", some possible paths for GDB
will not have a dev_t.
2003-02-16 19:22:21 +00:00
Warner Losh 58f4eca2a6 Whatever dumbass wrote sio_pci.c didn't include a detach method.
Wearing said pointy hat, correct the oversight and hope nobody
notices.

# this should make xircom modems happier to detach once other bugs with
# the cardbus layer are fixed.

Noticed by: scottl
Conical Hat to: imp
2003-02-16 18:05:54 +00:00
Warner Losh 3c2eeec09a No need to wrap siodetach() with sio_pccard_detach. 2003-02-16 18:03:15 +00:00
Andrew Gallatin cb259970c3 When trimming memory to fit Maxmem, and we discard an entire cluster,
make certain to subtract its pages from physmem.  Otherwise we end up
running phys_avail_cnt negative, and bad stuff happens.

MFC After: 1 week
2003-02-16 17:30:49 +00:00
Alfred Perlstein 9d4156aed3 Fix logic in loop so it actually executes.
Pointed out by: fjoe
2003-02-16 16:12:10 +00:00
Matt Jacob e5824c5d33 Pointy hat- bad commit. 2003-02-16 14:26:23 +00:00
Poul-Henning Kamp d0b4513884 This file is now empty and should no longer be used anywhere.
Put a #warning here to alert people to the fact.
2003-02-16 14:15:03 +00:00
Poul-Henning Kamp f341ca9891 Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
Poul-Henning Kamp 7d51c17432 Move cp_time[CPUSTATES] and related #defines to <sys/resource.h> 2003-02-16 13:30:29 +00:00
Poul-Henning Kamp 7694957ecc Declare tty related counters in a tty related .h file. 2003-02-16 13:23:29 +00:00
Poul-Henning Kamp 3abd4ccf87 Move the tty related statistics counters to live with the tty code. 2003-02-16 13:22:15 +00:00
Jeff Roberson 71146186a1 - Introduce a new function bremfreel() that does a bremfree with the buf
queue lock already held.
 - In getblk() and flushbufqueues() use bremfreel() while we still have the
   buf queue lock held to keep the lists consistent.
 - Add LK_NOWAIT to two cases where we're essentially asserting that the bufs
   are not locked while acquiring the locks.  This will make sure that we get
   the appropriate panic() and not another one for sleeping with a lock held.
2003-02-16 10:43:06 +00:00
Jeff Roberson 5e8feb5bed - Add a WITNESS_SLEEP() for the appropriate cases in lockmgr(). 2003-02-16 10:39:49 +00:00
Alan Cox 6420521aa5 Remove GIANT_REQUIRED from vm_pageq_remove(). 2003-02-16 06:36:48 +00:00
Alfred Perlstein 5015c68a3c prevent overflow in shminfo.shmmax 2003-02-16 06:08:55 +00:00
Tim J. Robbins 5d58e28570 Add MPSAFE comment to linux_sigpending(). 2003-02-16 02:33:12 +00:00
Tim J. Robbins 1df69b2d1a Regen from syscalls.master 1.52. 2003-02-16 02:32:17 +00:00
Tim J. Robbins d97ccc7e54 Mark linux_sigpending() as MPSAFE. 2003-02-16 02:31:05 +00:00
Tim J. Robbins a5ea48d458 Regen from syscalls.master 1.49. 2003-02-16 02:28:35 +00:00
Jeffrey Hsu a44009e07d Remove extraneous FILEDESC_LOCK around atomic read. 2003-02-16 02:15:15 +00:00
Warner Losh 387ca2cc8a Checkpoint a work in progress:
o Use the common pci_* routines in preference to the copied and hacked
  routines from an ancient pci.c.

This saves 509 lines in cardbus.c.  More savings to follow when I
convert the resource code over.  In the past when I've done this the
resource code conversion breaks cardbus in subtle ways so I'm doing a
1/2 way checkpoint this time.  cardbus still works for me the same as
it did before.

It also looks like cardbus devices now show up as pci bus devices to
pciconf -l, but maybe that was happening before.

Inspired by a patch from Justin Gibbs many moons ago.  When he
finishes his kobj multiple inheritance work, we can transition the
finished version of this work to that fairly easily.
2003-02-16 02:06:50 +00:00
Warner Losh 594b5aeb67 Use rman_get_device rather than rle->resl->r_dev.
make pci_hdrtypedata and pci_read_extcap accessible (but maybe in the end
   we'll make them private again).
2003-02-16 02:02:44 +00:00
Matt Jacob 03cf2fba38 Make sure we propagate rxid && iid in isp_target_put_atio 2003-02-16 01:37:51 +00:00
Matt Jacob 7369ae168f Pick up some compilation warning fixes from NetBSD.
If we don't have ISP_FW_CRASH_DUMP defined, we have to do
a isp_reinit in the core code- not the platform code- so
fix the ISP_CONN_FATAL case.
2003-02-16 01:32:52 +00:00
Matt Jacob a5cf62c2b3 Roll to latest level. 2003-02-16 01:30:31 +00:00
Scott Long 1e962d0012 Clean up the CIS BAR parsing code by removing several pointless checks.
Don't complain about the Option ROM BAR type since it's perfectly valid.
2003-02-16 00:20:24 +00:00
Andrew R. Reiter 1f5a94d5f6 - Update a couple of comments to make sense with what today's code is
doing (stale comments make arr something something ;)).
2003-02-15 23:25:12 +00:00
Tor Egge 218a01e062 Avoid file lock leakage when linuxthreads port or rfork is used:
- Mark the process leader as having an advisory lock
  - Check if process leader is marked as having advisory lock when
    closing file
  - Check that file is still open after lock has been obtained
  - Don't allow file descriptor table sharing between processes
    with different leaders

PR:		10265
Reviewed by:	alfred
2003-02-15 22:43:05 +00:00
Ruslan Ermilov 4ce9429c20 Added dependency on the apm(4) module. 2003-02-15 21:22:19 +00:00
Marcel Moolenaar 89c1ecfade Fix misuse of Maxmem in the calculation of the VHPT size. Maxmem
is already in pages, so we should not convert from bytes to pages.
The result of this bug was bad scaling of the VHPT relative to the
available memory.

Submitted by: Arun Sharma <arun@sharma-home.net>
2003-02-15 20:58:32 +00:00
Alan Cox 814f5c92d7 Remove the acquisition and release of Giant around pmap_growkernel().
It's unnecessary for two reasons: (1) Giant is at present already held in
such cases and (2) our various implementations of pmap_growkernel() look to
be MP safe.  (For example, for sparc64 the proof of (2) is trivial.)
2003-02-15 20:01:09 +00:00
Alan Cox 53b1963649 Move kernel_vm_end's declaration to pmap.h; add a comment regarding the
synchronization of access to kernel_vm_end.
2003-02-15 19:38:23 +00:00
Alan Cox 8e42580deb Assert that the kernel map's system mutex is held in pmap_growkernel(). 2003-02-15 19:23:37 +00:00
Andrew R. Reiter da8f0c8429 - Remove old comment for PURGE() as it no longer exists and implied it
was a comment to cache_zap().
- Add a comment to quickly state what cache_zap() does.

Reviewed by:	phk, mux
2003-02-15 18:58:06 +00:00
Takeshi Shibagaki a544e1117c Add YIS YWL-11B. This card has same vendor id and product id
as XI300 Wireless LAN. So use PCMCIA_CARD2().
2003-02-15 13:59:54 +00:00
Takeshi Shibagaki 617d6dd179 Regen. 2003-02-15 13:58:28 +00:00
Takeshi Shibagaki a51440388a Add YIS YWL-11B. This card has same vendor id and product id
as XI300 Wireless LAN.
2003-02-15 13:57:52 +00:00
Tim J. Robbins 4444375710 Acquire Giant around calls to kern_sigaction() in sigaction(),
freebsd4_sigaction() and osigaction() instead of around the whole
body of those functions. They now no longer hold Giant around calls
to copyin() and copyout(), and it is slightly more obvious what
Giant is protecting.
2003-02-15 09:56:09 +00:00
Tim J. Robbins c41c566c4a osigpending() no longer needs Giant, for the same reason sigpending()
does not.
2003-02-15 09:15:30 +00:00
Tim J. Robbins 48e8f774cb All uses of p_siglist are protected by the proc lock now, so there's
no need to acquire Giant in sigpending() anymore.
2003-02-15 08:42:02 +00:00
Tim J. Robbins 1bdd8ae409 Lock proc while accessing p_siglist, p_sigmask and p_sigignore
in nfs_sigintr().
2003-02-15 08:25:57 +00:00
Darren Reed 7ae7a6c4f7 fix bug in updating of interface pointers when resyncing state 2003-02-15 06:47:27 +00:00
Darren Reed aeb497128e Commit import changed from vendor branch of ipfilter to -current head 2003-02-15 06:25:25 +00:00
Darren Reed 32c7da78f7 Commit import changed from vendor branch of ipfilter to -current head 2003-02-15 06:23:45 +00:00
Darren Reed d2c988ba46 sometimes i hate it when you leave temp files in a directory you import from 2003-02-15 06:21:14 +00:00
Darren Reed 8732fffb9b This commit was generated by cvs2svn to compensate for changes in r110911,
which included commits to RCS files with non-trunk default branches.
2003-02-15 06:18:25 +00:00
Darren Reed 46e22717ef Import IPFilter 3.4.31 into -current 2003-02-15 06:18:25 +00:00
Alfred Perlstein e7d6662f1b Do not allow kqueues to be passed via unix domain sockets. 2003-02-15 06:04:55 +00:00
Alfred Perlstein edf6699ae6 Fix LOR with PROC/filedesc. Introduce fdesc_mtx that will be used as a
barrier between free'ing filedesc structures.  Basically if you want to
access another process's filedesc, you want to hold this mutex over the
entire operation.
2003-02-15 05:52:56 +00:00
Ruslan Ermilov 0b56eafddf Implemented a simple "nodevice" config(8) command that cancels
the effect of the "device" command, and use it to generate the
OLDCARD from GENERIC.

Suggested by:	bde
2003-02-15 02:39:13 +00:00
Jeffrey Hsu 4b40c56c28 Take advantage of pre-existing lock-free synchronization and type stable memory
to avoid acquiring SMP locks during expensive copyout process.
2003-02-15 02:37:57 +00:00
Takanori Watanabe a89fcf2843 Allow non-privilaged user to retrive battery or AC line information.
Reviewed by: rwatson
2003-02-15 01:46:22 +00:00
Hidetoshi Shimokawa 6611732341 Protect calling fwohci_intr() with splfw() for 4-stable. 2003-02-15 01:25:39 +00:00
Hidetoshi Shimokawa 3173a15429 - Increase split transaction timeout from 2 sec to 6 sec.
Problem reported by: Michael Reifenberger <root@nihil.reifenberger.com>

- Improve debug message.
2003-02-15 00:54:10 +00:00
Kirk McKusick aca3e4974f Replace use of random() with arc4random() to provide less guessable
values for the initial inode generation numbers in newfs and for
newly allocated inode generation numbers in the kernel.

Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 21:31:58 +00:00
Bosko Milekic 9e7225808e Make m_getm() always return the top of the newly allocated chain, as
opposed to returning the top of the old chain when there was one and
the top of the newly allocated chain if there was no old chain.

Actually, it should be noted that prior to this fix, although the
comment above m_getm() advertised that m_getm() would return the
top of the old chain (if an old chain was being passed in) it
actually [wrongly] was returning the tail mbuf in the old chain
instead.  This is a bug but since the one use of m_getm() in
the tree luckily did not depend on the behavior, it happened
to work out without notice.

Harti Brandt pointed out that the advertised behavior was actually
not the real behavior and so this change makes m_getm() ALWAYS
return the newly allocated chain (and fixes the comment).  This
is less confusing and is the best course of action as then the
caller is always able to have both a reference to the top of
the original chain (because it's passing it in in the call) and
a reference to the newly attached chain.  Although the API is
slightly modified, I don't think that any third-party code uses
m_getm() and if it does, it surely can't be working properly
because the old behavior was bogus.

API bug pointed out by: Harti Brandt <brandt@fokus.fraunhofer.de>
2003-02-14 16:50:13 +00:00
Hidetoshi Shimokawa c26f4c7168 Clear the bus reset event flag as soon as possible after
the initialization has completed to start transactions even when
interrupt is disabled during the boot process.
2003-02-14 15:52:32 +00:00
Dag-Erling Smørgrav af2eed6648 Style nit. 2003-02-14 13:30:25 +00:00
Alfred Perlstein 3dc593c895 KASSERT format string does not need newline termination 2003-02-14 13:28:44 +00:00
Alfred Perlstein 0c5f7aaab5 Add kasserts to catch bad API usage.
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-14 13:18:51 +00:00
Alfred Perlstein c11110eabe Fix crash dumps on ata and scsi.
To fix scsi, don't wait for ithreads if we're dumping, it makes the
debugger sad.

To fix ata, use what appears to be a polling method if we're dumping,
I stole this from tmm but added code to ensure that this change is
only in effect while dumping.

Tested by: des
2003-02-14 13:10:40 +00:00
Alfred Perlstein e95499bd4c style. 2003-02-14 12:44:48 +00:00
Alfred Perlstein aae87a3681 Print a backtrace in case we tsleep from inside of DDB. 2003-02-14 12:44:07 +00:00
Tim J. Robbins eabe23f352 Lock proc while accessing p_siglist p_sigmask and p_sigignore.
Not tested because netncp does not compile.
2003-02-14 09:16:43 +00:00
Tim J. Robbins fbbad44413 Lock proc while manipulating p_sigmask p_sigignore and p_siglist. 2003-02-14 09:12:12 +00:00
Tim J. Robbins fb30aed1a5 Obtain proc lock around modification of p_siglist in linux_wait4(). 2003-02-14 08:59:49 +00:00
Ruslan Ermilov c2604cb567 Diff reduction to GENERIC. 2003-02-14 08:41:25 +00:00
Alan Cox e33d37b66f - Add a mutex for synchronizing the use of CMAP/CADDR 1 and 2.
- Eliminate small style differences between pmap_zero_page(),
   pmap_copy_page(), etc.
2003-02-14 07:34:28 +00:00
Eric Anholt 05d1e23aa7 Split the arch-specific AGP files into the appropriate files.* and do the same
for the agp module, and add agp to the list of modules to compile for alpha.
Add an alpha_mb() to agp_flush_cache for alpha -- it's not correct but may
improve the situation, and it's what linux and NetBSD do.
2003-02-14 06:33:52 +00:00
Eric Anholt 11c6a5f80d Remove an extra agp_flush_cache(). The i810 case that needs it already has it. 2003-02-14 06:31:45 +00:00
Warner Losh 2ff0908a66 o transition from exca_write to exca_putb and read->getb. This is so that
we can have additional different types of bridges.
o remove now bogus comment.
o Don't clear CARD_OK when we can't attach a card.
o minor style nits

# this make kldload of cardbus drivers work for me when the card is
# present on boot.
2003-02-14 06:21:51 +00:00
Warner Losh e0ba3d7e56 Massive overhaul of exca to help with the isa efforts:
o chip_name arrays ifdef'd out.
o use the OLDCARD-like get/put functions so we can support differnt types
  of mappings.
o Write the beggings of is this a valid exca device and introduce more
  chipset support.

# this is partially a wip, but also needed because some other cahnges I've
# made require some of these changes.
2003-02-14 06:21:18 +00:00
Hidetoshi Shimokawa f3d2847dd0 - Though I got a feedback from the originator of kern/48129 that the
previous revision fixed the panic, I found the problem exits in
another part of the function by investigating the crom dump sent by him.
The search was started in the middle of bus info block and the
routine misunderstood the EUI64 as a crom entry. This problem is fixed.

PR: kern/48129

Fix incorrect type mask included in a logical unit number and check
the validity of the lun.
2003-02-14 03:09:59 +00:00
Kirk McKusick 50bd54e391 Correct lines incorrectly added to the copyright message.
Submitted by:	Frank van der Linden <fvdl@wasabisystems.com>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 00:31:06 +00:00
Matthew N. Dodd 8ae37ad0ba Bandaid the bits that use the elink_foo() functions which are
i386 only at this point.
2003-02-13 23:01:59 +00:00
David E. O'Brien d23dc82958 FB_INSTALL_CDEV not usable on Alpha. 2003-02-13 22:33:26 +00:00
David E. O'Brien cc874de3f4 Fix whitespace problems with option lines. 2003-02-13 22:27:40 +00:00
David E. O'Brien 36dc5b9427 Fix the style of the SCHED_4BSD commit. 2003-02-13 22:24:44 +00:00