Commit Graph

32113 Commits

Author SHA1 Message Date
Alan Cox
ce6612b6b6 Don't call vm_map_growstack() from trapwrite() as vm_fault() now performs
this automatically.
2002-04-27 17:07:15 +00:00
Alan Cox
72ba293d78 MFi386 1.222: Remove vm_map_growstack() and acquisition and release of Giant
around vm_fault() in trap_pfault().
2002-04-27 17:00:28 +00:00
Darren Reed
7df187a3ad Merge updates from 3.4.26 - 3.4.27. 2002-04-27 16:56:25 +00:00
Warner Losh
cd5a4c63c7 This patch fixes my breakage of ssid matching. I introduced the
breakage when I tried to merge OpenBSD wi_hostap changes into the
tree.  Skibo found the problem and submitted these patches.  Thanks!

Submitted by: skibo@pacbell.net
2002-04-27 16:03:25 +00:00
Warner Losh
0853849336 Better names for the PCI cards. The biggest change is that we now
identify the Intersil Prism 2.5 PCI native card as that, rather than
Linksys, the first folks to get it to market.
2002-04-27 16:01:26 +00:00
Alan Cox
644d87b30a MFi386 1.222: Remove vm_map_growstack() and acquisition and release of Giant
around vm_fault().
2002-04-27 09:34:15 +00:00
Seigo Tanimura
acbbcc5f1d Fix the code fragment clobbered in my last commit. 2002-04-27 09:33:49 +00:00
Seigo Tanimura
d48d4b2501 Add a global sx sigio_lock to protect the pointer to the sigio object
of a socket.  This avoids lock order reversal caused by locking a
process in pgsigio().

sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now
require sigio_lock to be locked.  Provide sowwakeup_locked(),
soisconnected_locked(), and so on in case where we have to modify a
socket and wake up a process atomically.
2002-04-27 08:24:29 +00:00
Poul-Henning Kamp
f5d157fb51 Explain magic number.
Add magic date no explanation.

Add a delta which was lost in transit yesterday which prevented
other timecounters from actually being used.
2002-04-27 07:28:54 +00:00
Poul-Henning Kamp
50d866ce0f Fix a {} bug which doesn't have any effect yet.
Spotted by:	jake
2002-04-27 07:07:37 +00:00
Poul-Henning Kamp
f175569ac2 Make the dummy timecounter actually tick or we will never get anyhere. 2002-04-27 07:06:52 +00:00
John Baldwin
e64b74e35b Whitespace bogon. 2002-04-27 04:48:36 +00:00
Marcel Moolenaar
9ae9d0ff86 Insert a semi-colon between label 'skip:' and the closing brace
of the FOREACH loop to silence GCC 3.
2002-04-27 02:58:18 +00:00
Scott Long
fe3cb0e1ec Add a CAM interface to the aac driver. This is useful in case you should
ever connect a SCSI Cdrom/Tape/Jukebox/Scanner/Printer/kitty-litter-scooper
to your high-end RAID controller.  The interface to the arrays is still
via the block interface; this merely provides a way to circumvent the
RAID functionality and access the SCSI buses directly.  Note that for
somewhat obvious reasons, hard drives are not exposed to the da driver
through this interface, though you can still talk to them via the pass
driver.  Be the first on your block to low-level format unsuspecting
drives that are part of an array!

To enable this, add the 'aacp' device to your kernel config.

MFC after:	3 days
2002-04-27 01:31:17 +00:00
Warner Losh
3465a702f3 Make this driver compile for -stable also to prep for MFC 2002-04-26 23:11:23 +00:00
Mike Barcroft
a30d4b3270 Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>.  This puts us in line with NetBSD and OpenBSD.
2002-04-26 22:48:23 +00:00
Alan Cox
cbd53e95fe o Control access to the vm_page_buckets with a mutex.
o Fix some style(9) bugs.
2002-04-26 22:44:15 +00:00
Wes Peters
8373917257 Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by:	Gordon Tetlow <gordont@gnf.org>
2002-04-26 22:32:15 +00:00
Poul-Henning Kamp
62efba6a0c Now that the private parts of timecounters are no longer being fingered
by other bits of code, split struct timecounter into two.

struct timecounter contains just the bits which pertains to the hardware
counter and the reading of it.

struct timehands (as in "the hands on a clock") contains all the ugly bit
fidling stuff.  Statically compile ten timehands.

This commit is the functional part.  A later cosmetic patch will rename
various variables and fieldnames.
2002-04-26 21:51:08 +00:00
Poul-Henning Kamp
b4a1d0deb1 Hide the private parts of timecounter from a couple of places that don't
really need to know the gory details.
2002-04-26 21:31:44 +00:00
Poul-Henning Kamp
14021ab570 Redo the pps bit to avoid digging into the private bits of the timecounter. 2002-04-26 21:22:02 +00:00
Daniel C. Sobral
1a923a14f4 A long, long time ago, msmith introduced vfs.root.mountfrom
loader variable, which let users specify the root mount point
the exact way one does after booting the kernel.

Let's take this opportunity to document it...
2002-04-26 20:52:59 +00:00
Poul-Henning Kamp
7bf758bff0 Simplify the RFC2783 and PPS_SYNC timestamp collection API. 2002-04-26 20:24:28 +00:00
Marcel Moolenaar
9bedf13fee Initialize MCA in cpu_startup() so that it's ready before we wake-up
the application processors. This allows us to collect unconsumed AP
specific error records as part of the wake-up.
2002-04-26 19:36:25 +00:00
Marcel Moolenaar
6e0be618ed MCA specific code has been moved to a seperate file. It is expected
to grow enough to be in the way here.
2002-04-26 19:33:20 +00:00
Marcel Moolenaar
e477773f01 Machine Check Architecture (MCA) support code. Error records are
collected at boot and made available through sysctl(8). At the
moment, the following MIB names are created:

	hw.mca.count	- The number of error records collected.
	hw.mca.first	- The lowest sequence number present.
	hw.mca.last	- The highest sequence number present.
	hw.mca.<X>	- The error record with sequence number <X>.

Using sysctl(8) allows us to easily detect and analyze the records,
which is very helpful during development of MCA but can also be used
in production as a way to collect machine health statistics.
2002-04-26 19:30:11 +00:00
Marcel Moolenaar
53f1567fc3 Machine Check Architecture (MCA) structures and constants. 2002-04-26 19:16:59 +00:00
Ruslan Ermilov
6bde859f40 Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld.  For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1.  Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment.  KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules.  GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists.  Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories.  This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage.  Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists?  (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
Orion Hodson
c6d4b83ad1 Add ac97_reset function that polls ready bits in power register. One
component in tweaks required for the ICH3 controller in the thinkpad
x22 reported by Colin Perkins on -multimedia.
2002-04-26 15:27:56 +00:00
Poul-Henning Kamp
9e1b5510c3 Move the winding of timecounters out of hardclock and into a normal
timeout loop.

Limit the rate at which we wind the timecounters to approx 1000 Hz.

This limits the precision of the get{bin,nano,micro}[up]time(9)
functions to roughly a millisecond.
2002-04-26 12:37:36 +00:00
Poul-Henning Kamp
056abcabb7 Various cleanup and sorting of clock reading functions. Add the two
functions missing in the complete 12 function complement.
2002-04-26 10:19:29 +00:00
Poul-Henning Kamp
656d3e04d1 Rename tco_setscales() and tco_delta() to use the same tc_ prefix as
the rest of this file.
2002-04-26 10:11:02 +00:00
Poul-Henning Kamp
7e2d76ff05 Remove the tc_update() function. Any frequency change to the
timecounter will be used starting at the next second, which is
good enough for sysctl purposes.  If better adjustment is needed
the NTP PLL should be used.
2002-04-26 10:06:26 +00:00
Brian Somers
b94c4e9a93 Test if rootvnode is NULL rather than if rootdev is NODEV when determining
if there's a filesystem present.

rootdev can be NODEV in the NFS-mounted root scenario.

Discussed with: Harti Brandt <brandt@fokus.gmd.de>, iedowse
2002-04-26 09:52:54 +00:00
Wes Peters
1de372dcd4 Add a -k option to reboot to specify the kernel to boot next time
around.  If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by:	Several on IRC
MFC after:	4 days
2002-04-26 07:31:04 +00:00
Greg Lehey
a182065f27 vinum_open: recognize twed device.
Submitted by:	Holger Kipp <holger.kipp@alogis.com>
PR:		37458
MFC after: 	5 days
		(to get 4.6 code freeze)
2002-04-26 04:23:19 +00:00
Robert Watson
ae6b9ab00b Add UDF to the list of filesystems where locking assertions should be
evaluated.

Approved by:	scottl
2002-04-26 04:06:08 +00:00
Boris Popov
b88157559d UIO_NOCOPY is not supported for now, so refuse read opeartion if this flag
is set. The full emulation of bio are on its way...
2002-04-26 03:49:02 +00:00
Robert Watson
dbb17987fc 1.43 (dfr 04-Apr-97): /*
1.43         (dfr      04-Apr-97):  * [dfr] Kludge until I get around to fixing all the vfs locking.
1.43         (dfr      04-Apr-97):  */

	The new devfs doesn't support VFS locking.  So don't do locking
	assertions for devfs vnodes.

	With this change, a kernel with options DEBUG_VFS_LOCKS actually
	gets to single-user mode.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-26 03:39:04 +00:00
Mike Silbersack
e1f1827f98 Make sure that sockets undergoing accept filtering are aborted in a
LRU fashion when the listen queue fills up.  Previously, there was
no mechanism to kick out old sockets, leading to an easy DoS of
daemons using accept filtering.

Reviewed by:	alfred
MFC after:	3 days
2002-04-26 02:07:46 +00:00
Dag-Erling Smørgrav
521eb014c8 Add the mutex profiling lock to the witness list. This hopefully unbreaks
the MUTEX_PROFILING + WITNESS + !WITNESS_SKIPSPIN case.

Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-04-25 22:48:40 +00:00
Bruce Evans
2c900f6451 Fixed some longstanding bugs in _getenv_static():
- malformed environment strings (ones without an '=') were not rejected.
  There shouldn't be any of these, but when the static environment is
  empty it always begins with one of these; this one should be considered
  as the terminator after the end of the environment, but it isn't.
- the comparison of the name being looked up with the name in the
  environment was fuzzy -- only the characters up to the length of the
  latter were compared, so _getenv_static("foobar") matched "foo=..."
  in the environment and everything matched "" in the empty environment.

MFC after:	3 days
2002-04-25 20:25:15 +00:00
Semen Ustimenko
37f044d650 Implement true multicast filtering.
Inspired by:	dc(4)

MFC after:	1 week
2002-04-25 18:16:15 +00:00
Marcel Moolenaar
780a1fb3ca The official name for McKinley is: Itanium 2 2002-04-25 17:51:43 +00:00
Yoshihiro Takahashi
0b9a090051 MFi386: revision 1.339. 2002-04-25 13:32:56 +00:00
Yoshihiro Takahashi
27ecba3177 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
Yoshihiro Takahashi
f9ef610bd0 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
Yoshihiro Takahashi
5497ee0acf Merged from sys/dev/syscons/syscons.c revision 1.383 2002-04-25 13:25:36 +00:00
Bruce Evans
ff557fa1a9 Break the following implementation of panic(3):
#!bin/sh

	# Original version of this by Michael Reifenberger
	# <root@nihil.plaut.de>.

	mdconfig -d -u 11 >/dev/null 2>&1
	dd if=/dev/zero of=zz bs=1m count=1

	while :
	do
		mdconfig -a -t vnode -f zz -u 11
		fdisk -f - -iv /dev/md11 <<EOF1
		g c1 h64 s32
		p 1 165 0 2048
		a 1
	EOF1
		mdconfig -d -u 11
	done

Garbage pointers in __si_u were not cleared by destroy_dev().  Not
clearing si_disk made the above fatal because the disk layer uses
si_disk as a flag to indicate that the dev_t has been completely
initialized.  disk_destroy() clears si_disk for the parent dev_t
but doesn't get called for children.

Not fixed:
- setting the undocumented sysctl debug.free_devt should cause more
  complete destruction of the dev_t including clearing of __si_u, but
  actually causes the above to panic a little earlier.
- the loop leaks 10 memory allocations per iteration (4 DEVFS, 2 devbuf
  and 4 dev_t).

Reviewed by:	timeout by MAINTAINER after 3 months
2002-04-25 13:17:33 +00:00
Josef Karthauser
c628479a57 Add a power exceeded debug message.
Update the $NetBSD$ ident to match reality.
2002-04-25 12:58:30 +00:00
Josef Karthauser
8e0c4b3892 MFNetBSD:
revision 1.96
    date: 2001/11/22 21:59:33;  author: augustss;  state: Exp;  lines: +3 -3
    Correct a comment.
2002-04-25 12:51:08 +00:00
Josef Karthauser
9206cd4c25 MFNetBSD:
revision 1.95
    date: 2001/11/20 16:09:01;  author: augustss;  state: Exp;  lines: +39 -6
    Sanity check max packet lengths.
2002-04-25 12:49:38 +00:00
Josef Karthauser
cafee33353 MFNetBSD:
revision 1.94
    date: 2001/11/20 13:50:07;  author: augustss;  state: Exp;  lines: +16 -9
    Update for new speed handling.
2002-04-25 12:37:55 +00:00
Andrew R. Reiter
d4d6aee5a0 - Fix a round down bogon in uma_zone_set_max().
Submitted by: jeff@
2002-04-25 06:24:40 +00:00
Darren Reed
37d55dca34 bring in changes from 3.4.26. 2002-04-25 03:31:39 +00:00
Darren Reed
39252e7612 This commit was generated by cvs2svn to compensate for changes in r95415,
which included commits to RCS files with non-trunk default branches.
2002-04-25 03:23:53 +00:00
Darren Reed
43ba65e60d Import IPFilter 3.4.26 kernel sources, including H.323 proxy.
Include the licence file for both IPFilter and the H.323 proxy (from QNX),
for convienence.
2002-04-25 03:23:53 +00:00
Darren Reed
13114a18ac Import IPFilter 3.4.26 kernel sources, including H.323 proxy.
Include the licence file for both IPFilter and the H.323 proxy (from QNX),
for convienence.
2002-04-25 03:23:52 +00:00
Marcel Moolenaar
d297ad160e Don't use the symbol name to lookup the symbol value when we can use
the symbol index defined by the relocation. The elf_lookup() support
function is to be used by elf_reloc() when symbol lookups need to be
done. The elf_lookup() function operates on the symbol index and
will do a symbol name based lookup when such is required, otherwise
it uses the symbol index directly. This solves the problem seen on
ia64 where the symbol hash table does not contain local symbols and
a symbol name based lookup would fail for those symbols.

Don't pass the symbol name to elf_reloc(), as it isn't used any more.
2002-04-25 01:22:16 +00:00
Andrew R. Reiter
04a3d10ee5 - Tweak wording of panic message to make more sense. 2002-04-24 22:32:48 +00:00
Poul-Henning Kamp
f6424ee53f Improve the cross-references in the XML output.
Explained by:	des
Sponsored by:	DARPA & NAI Labs.
2002-04-24 21:02:28 +00:00
Andrew R. Reiter
d98861bb51 - Turn the atm_stackq_pool into a uma_zone (and change it's name to
atm_stackq_zone).
- Change the related atm_allocate() and atm_free() calls into uma_zalloc()
  and uma_zfree() calls.
2002-04-24 20:56:23 +00:00
Hajimu UMEMOTO
83649f07c7 Correct timer management (deprecated) in nd6_timer.
Obtained from:	KAME
MFC after:	3 days
2002-04-24 19:09:48 +00:00
John Hay
de0d2cad31 Add another chip id for the new LAVA 4-port serial card.
PR:		37333
Submitted by:	Ari Suutari <ari.suutari@syncrontech.com>
MFC after:	4 days
2002-04-24 18:55:50 +00:00
John Hay
aaeedfc626 Ignore the multifunction bit in the PCIR_HEADERTYPE.
PR:		37333
Submitted by:	Ari Suutari <ari.suutari@syncrontech.com>
MFC after:	4 days
2002-04-24 18:53:43 +00:00
Andrew R. Reiter
1bbd50f9c8 - Remove atm_attributes_pool and the relating atm_allocate() and atm_free()
calls associated with the pool and the objects allocated out from the
  pool.
- Insert atm_attributes_zone which is a uma_zone that is used just as the
  atm_attributes_pool was (including the max objects value).  Also, used
  the appropriate zalloc and zfree's where necesary.
2002-04-24 18:06:18 +00:00
Maxime Henrion
78689b156f Don't call freeenv() on a modified pointer.
Submitted by:	Alexander Kabaev <ak03@gte.com>
Reviewed by:	phk
Pointy hat to:	mux
2002-04-24 17:49:21 +00:00
Justin T. Gibbs
e905720a60 aic7xxx_freebsd.c -> aic7xxx_osm.c 2002-04-24 16:59:47 +00:00
Justin T. Gibbs
8f214efc9a Major update to the aic7xxx driver:
ahc_eisa.c:
ahc_pci.c:
	Conform to new aic7xxx IRQ API.

	Adapt to aic7xxx_freebsd -> aic7xxx_osm changes.

aic7770.c:
	Disable card generated interrupt early in our probe for
	"extra safety"

	Commonize some seeprom code with the PCI side of the driver.

aic7xxx.c:
	Correctly initialize a few scratch ram locations during
	a sequencer restart.  This avoids spurious sequencer ram
	parity errors in some configurations.

	Include the softc in ahc_update_residual calls.  We need it
	for some diagnostics in this code path.

	Flag a data overrun on an auto-request sense failure as a
	CAM_AUTOSENSE_FAIL rather than a CAM_DATA_RUN_ERR.

	Force a renegotiation after noticing a parity error.  This
	covers targets that lose our negotiation settings but don't
	bother to give us a unit attention condition.  This can happen
	if a target fails during a reselection of us during a cable
	pull.

	Convert some code to using constants.

	Fix some typos.

	Correct target mode message loop handling.  ahc_clear_msg_state
	was not clearing the "need to go to message out phase" bit once
	our loop was over.

	Simplify some abort handling code.

	Include tag information in target mode immediate notify events.

	When shutting down EISA controllers, don't EISA BIOS settings in
	the high portions of scratch ram.  This fixes warm boot issues on
	some systems.

	Save a bit of space by only allocating the SCBs that we can use.

	Avoid some code paths in ahc_abort_scbs() if we are currently
	acting as a target.

	Correctly cleanup stranded SCBs in the card's SCB array.  These
	are SCBs who's mapping has already been torn down by code that
	aborted the SCB by seeing it in another list first.

	Add a comment about some potential bus reset issues for target
	mode on Twin (EISA only) controllers.

aic7xxx.h:
	Cleanup the hardware scb definitions a bit.

	Allocate a ful 256 byte scb mapping index.  This simplifies
	the lookup code since the table covers all possible (and potentially
	bogus) values.

	Make AHC_DEBUG work again.

aic7xxx.reg:
	Updates to hardware SCB definition.

	New definitions for target mode fixes.

aic7xxx.seq:
	In target mode, initialize SAVED_LUN just after we receive
	the identify message.  It may be required in the error recovery
	path when a normal cdb packet (includes lun) is not sent up to
	the host for processing.

	Respond to irregular messages during a selection in target mode.

	Defer looking for space for a cdb packet until we are about to
	enter command phase.  We want to be able to handle irregular messages
	even if we would otherwise return QUEUE_FULL or BUSY.

	Add support for sending Ignore Wide Residue messages as a target.

	In the disable disconnect case in target mode, set our transfer
	rate correctly once data are availble.

aic7xxx_93cx6.c:
aic7xxx_93cx6.h:
	Add the ability to write and erase the seeprom.

aic7xxx_inline.h:
	Correct Big Endian handling of large cdb sizes (> 12 bytes).

	Adaptec to changes in the calc_residual API.

	Correct a target mode bug where we always attempted to service
	the input queue even if no progress could be made due to lack
	of ATIOs.

aic7xxx_osm.c:
	Adaptec to new IRQ mapping API.  The new API allows the core
	to only enable our IRQ mapping once it is safe (sufficient
	initialization) to do so.

	Slap bootverbose protection around some diagnostics.

	Only attempt DT phases if we are wide.

aic7xxx_osm.h:
	Enable big endian support.

	Adjust for IRQ API change.

aic7xxx_pci.c:
	Be more careful about relying on subvendor 9005 information.
	We now only trust it for HBAs.  This should allow the driver
	to attach to some MBs where the subvendor/device information
	does not follow the Adaptec spec.

	Only enable interrupts on the card once we are fully setup.

	Disable external SCB ram usage on the aic7895.  I have not
	been able to make it 100% reliable.

	Adjust to seeprom routines being properly prefixed with "ahc".

	Fix a few bugs in the external SCB ram probing routine.  We
	need to clear any parity errors we've triggered during the
	probe to avoid future, fatal, interrupts.

	If we detect an invalid cable combination, pretent there are
	no cable at all.  This will enable all of the terminators
	which is probably the safest configuration we can "guess".

MFC after: 4 days
2002-04-24 16:58:51 +00:00
Justin T. Gibbs
7ce72dbaec Add macro functionality.
Staticize and allow unique naming of data structures so that more
than on sequencer program can be statically compiled into the kernel
at a time.
2002-04-24 16:24:43 +00:00
Warner Losh
d5ccecfad7 o Work around bugs in the powerof2 macro: It thinks that 0 is a power of
2, but that's not the case.  This fixes the case where there were slots
  in the PIR table that had no bits set, but we assumed they did and used
  strange results as a result.
o Map invalid INTLINE registers to 255 in pci_cfgreg.c.  This should allow
  us to remove the bogus checks in MI code for non-255 values.

I put these changes out for review a while ago, but no one responded
to them, so into current they go.

This should help us work better on machines that don't route
interrupts in the traditional way.

MFC After: 4286 millifortnights
2002-04-24 15:30:11 +00:00
Warner Losh
e5d7e9c76c Fix a PNPID in a comment
Submitted by: David Xu
2002-04-24 15:22:53 +00:00
Poul-Henning Kamp
078c6f01f9 Make specific provisions for the kernel simulator used in the regression
tests, other userland programs may need to include <geom/geom.h>.

Sponsored by:	DARPA & NAI Labs.
2002-04-24 12:53:12 +00:00
Ruslan Ermilov
2cbc81ffe4 The install.debug and reinstall.debug targets are needed solely
to build kernel and kernel modules so stop supporting them in
bsd.subdir.mk and reimplement them in kern.post.mk and kmod.mk
as special versions of the install and reinstall targets, and
only define them if DEBUG is also defined (when debug versions
are really built).

Prompted by:	bde
2002-04-24 11:26:19 +00:00
Seigo Tanimura
ce00aebe22 Free(9) should be Giant-free.
Suggested by:	jhb
2002-04-24 09:59:18 +00:00
Jake Burkholder
127e8646b8 Split file system setup code out into a function called mount.
Implement vsnprintf.  Implement panic in terms of it.
2002-04-24 05:54:10 +00:00
Scott Long
cbfd045b10 Prepare for a major update to the aac driver:
Update the aac driver with the new crashdump api.
	Protect sync fibs with a mutex.
	Align all DMA buffers on a PAGE_SIZE boundary.

MFC after:	3 days
2002-04-24 05:12:50 +00:00
Jake Burkholder
0d0c927680 Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.
2002-04-24 04:27:49 +00:00
Mike Silbersack
c473d3e406 Remove sodropablereq - this function hasn't been used since the
syncache went in.

MFC after:	3 days
2002-04-24 04:11:08 +00:00
Jake Burkholder
3ff6556567 Add an exit function. 2002-04-24 02:50:59 +00:00
Jake Burkholder
083d8c5bab Add -Wno-unused. 2002-04-24 02:50:36 +00:00
Jake Burkholder
8c2f8986a6 memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
Jake Burkholder
4b487ad2ec Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.
2002-04-24 02:10:35 +00:00
Jake Burkholder
e2b255fdea Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
Jake Burkholder
912ceb7f18 Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.
2002-04-24 01:40:54 +00:00
Mike Barcroft
58631bbe0e Rearrange <netinet/in.h> so that it is easier to conditionalize
sections for various standards.  Conditionalize sections for various
standards.  Use standards conforming spelling for types in the
sockaddr_in structure.
2002-04-24 01:26:11 +00:00
Matt Jacob
c7948a94c5 Make Veritas Storage Appliance a HILUNS device.
MFC after:	1 day
2002-04-24 00:00:55 +00:00
Poul-Henning Kamp
53705e35ae Implement the GEOMGETCONF ioctl which returns vital stats for the
current device in XML in an sbuf.

Sponsored by:	DARPA & NAI Labs
2002-04-23 19:54:02 +00:00
Jeffrey Hsu
4bc37205bc The cold and panicstr variables do not need to be protected by sched_lock.
Submitted by:	Jennifer Yang (yangjihui@yahoo.com)
Reviewed by:	jake & jhb in principle
2002-04-23 19:50:22 +00:00
Poul-Henning Kamp
2285b09474 All in a days work: make a function static. 2002-04-23 19:03:03 +00:00
Poul-Henning Kamp
3c9f58204e Don't free(9) a pointer which has been modified.
Chapeau de pointe:	mux
2002-04-23 18:52:39 +00:00
Poul-Henning Kamp
708da94ef2 Add a basic sanity check on pointers passed to free(9).
Should be improved by:	jeff
2002-04-23 18:50:25 +00:00
Poul-Henning Kamp
00d70dec4e Don't call malloc(9) to allocate zero bytes softc data for devices. 2002-04-23 15:48:23 +00:00
Boris Popov
959b83b921 Track nfs's getpages() changes:
Properly count v_vnodepgsin.
    Do not reread page if is already valid.
    Properly handle partially filled pages.
2002-04-23 14:30:43 +00:00
Boris Popov
3f36e6f21a Get rid from extra #ifdefs. 2002-04-23 13:55:14 +00:00
Boris Popov
30fc2d74fa Initialize thread select queue in the same way as rev 1.93 of sys_generic.c
does.

Missed and found by:	alfred
2002-04-23 13:29:23 +00:00
Poul-Henning Kamp
7d590cc46f Introduce some serious paranoia to try to catch a memory overwrite problem
as early as possible.

Sponsored by:	DARPA & NAI Labs
2002-04-23 11:48:45 +00:00
Gary Jennejohn
bb83e7583e On slow machines interrupts could be lost, so check for pending
interrupts in a loop.

Tested by: Andrew Gordon <arg-bsd@arg1.demon.co.uk>
2002-04-23 10:25:35 +00:00
Ruslan Ermilov
b25a566d47 Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.
Ensure all standard targets honor SUBDIR.  Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents).  Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk.  Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)
2002-04-23 09:03:56 +00:00
Marcel Moolenaar
ef845b75e7 Remove unused static variable quantum. 2002-04-23 06:14:10 +00:00
Robert Watson
7a0776e477 Slightly restructure extattr_get_vp() so that there's only one entry point
to VOP_GETEXTATTR().  This simplifies code flow when inserting MAC hooks.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-23 01:27:38 +00:00
Alfred Perlstein
ea5b39d029 Don't FILEDESC_LOCK around calls to falloc(). 2002-04-22 20:09:11 +00:00
Poul-Henning Kamp
efb9df5cef Protect against multitple #includes of this file. 2002-04-22 19:54:17 +00:00
Andrew R. Reiter
e2a8a1af0e - Revert previous change of atm storage pools -> uma_zones until a solution
to atm_free() is written.
2002-04-22 18:26:05 +00:00
John Polstra
1c33cc4bc5 Add missing splx calls in bge_tick. These don't make any functional
difference in -current, but they are important for -stable where
they are missing too.

MFC after:	1 day
2002-04-22 16:15:16 +00:00
Ruslan Ermilov
05276e5f8c Back out remnants of revision 1.97: we don't need TARGET_ARCH here. 2002-04-22 15:53:04 +00:00
Ruslan Ermilov
0ac2fc87d2 Use standard bsd.init.mk prologue. 2002-04-22 15:47:11 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Warner Losh
632754e510 Implement shared secret mode for hostap mode.
Submitted by: Thomas Skibo <skibo@pacbell.net>
2002-04-22 07:09:13 +00:00
Poul-Henning Kamp
29f88f470e Comment out Kirks io-request priority hack until we can do this in a
civilized way which doesn't cause grief.

The problem is that it is not generally safe to cast a "struct bio
*" to a "struct buf *".  Things like ccd, vinum, ata-raid and GEOM
constructs bio's which are not entrails of a struct buf.

Also, curthread may or may not have anything to do with the I/O request
at hand.

The correct solution can either be to tag struct bio's with a
priority derived from the requesting threads nice and have disksort
act on this field, this wouldn't address the "silly-seek syndrome"
where two equal processes bang the diskheads from one edge to the
other of the disk repeatedly.

Alternatively, and probably better: a sleep should be introduced
either at the time the I/O is requested or at the time it is completed
where we can be sure to sleep in the right thread.

The sleep also needs to be in constant timeunits, 1/hz can be practicaly
any sub-second size, at high HZ the current code practically doesn't
do anything.
2002-04-22 06:53:20 +00:00
Marcel Moolenaar
d435ac4e91 Add ia64_sal_init_state(). This function will initialize the machine
check handling. In its current form, it only determines the largest
amount of state information it can get from SAL and allocates a region
7 memory block for it.

The next steps involve:
o  get and log any unconsumed (NVM stored) error records across
   reboots,
o  register an OS_MCA handler and enable machine checks.
2002-04-22 06:43:31 +00:00
Marcel Moolenaar
1dc66a63cd Add state information types. 2002-04-22 06:35:40 +00:00
Andrew R. Reiter
27e69e45bb - Change the atm_attributes_pool and atm_stackq_pool to be uma_zone's
(with the appropriate set_max) rather than using the HARP storage pool
  code.
2002-04-22 05:11:44 +00:00
Jake Burkholder
11dcdc976b Avoid using pmap_kenter "early", since it may need to dink with vm_page
structures, which may not be setup yet.  Minor cleanups.
2002-04-21 22:57:42 +00:00
Marcel Moolenaar
7ac993bf17 Fix WAW dependency violation on r17 (line 198) that only exists for
the SMP case. While on the subject, remove unnecessary stops. I don't
know if this resolves the memory corruption I'm seeing, but it does
have the potential. We'll see...
2002-04-21 22:43:50 +00:00
Marcel Moolenaar
0f9d8c9b27 Implement elf_reloc(). The RT specification says that we can expect
both Elf_Rel and Elf_Rela types of relocation, so handle them both
even though we only have Rel_Rela ATM. We don't handle 32-bit and
big-endian variants yet. Support for that is not trivial enough to
implement it without any evidence that we ever need it in the near
future.

For the FPTR relocations, we currently use the fptr_storage used by
_reloc() is locore.s. This is in no way a real solution, but for now
provides the service we need to get the basics going.

A static recursive function lookup_fdesc() is used to find the address
of a function in a way that keeps track of the load module so that
we can get the correct GP value if we need to construct an OPD (ie
there's no OPD yet for the function.

For simplicity, we create an OPD for the IPLT relocations as well and
simply fill the user provided function descriptor from the OPD. Since
the the official descriptors are unique, this has no bad side effects.
Note that we ignore the addend for FPTR relocations, but use the
addend for IPLT relocations as an offset to the function address.

This commit allows us to load and relocate modules and modules appear
to work correctly, although we probably need to make sure that we set
GP correctly in all cases when we have inter-module calls. This
especially applies to assembly coded functions that have cross module
calls.
2002-04-21 21:27:57 +00:00
Marcel Moolenaar
8420105927 Add function link_elf_get_gp(), specific to ia64 for now, to get
the DT_PLTGOT value. On ia64 this is the value of GP. We need this
to construct function descriptors, but the elf file structure is
not exported to MD code.

Note that the name of the function is based on the meaning that
DT_PLTGOT has on ia64. This may differ on other architectures. As
such, link_elf_get_gp() has a high level of MD to it. Renaming the
function to describe what DT_* value is returned makes it generic,
but also makes the MD code less clear and if we only need this on
ia64, then a general name for a specific function doesn't help.

In short: I don't know what is "right" at this time, so I'll go
with what I have.
2002-04-21 21:08:30 +00:00
Ian Dowse
3aed248695 Limit to the maximum allowed reply size the amount of data that
nfsrv_readdir and nfsrv_readdirplus can return. A client request
containing an over-large `count' field could trigger the "Bad nfs
svc reply" panic in nfs_syscalls.c.

Spotted while trying to reproduce kern/37304, which turned out to
be fixed in FreeBSD a long time ago.

MFC after:	1 week
2002-04-21 16:14:54 +00:00
Bruce Evans
4cc6241557 Don't attempt to decvlare M_DEVFS whern MALLOC_DECLARE is not defined.
This fixes warnings that should be errors in fstat.

Reminded by:	alpha tinderbox

Fixed some style bugs (ones near BOF and EOF; there are many more).
2002-04-21 15:47:03 +00:00
Bruce Evans
54a4c5bf21 Include <sys/systm.h> for (at least) the definition of atomic functions
which are sometimes used by the macros in <sys/mutex.h>; don't depend
on not-quite-necessary namespace pollution in <sys/mutex.h>.
2002-04-21 15:35:54 +00:00
Doug Rabson
fb767b2d4e Setup the child's return values correctly when forking an IA-32 process. 2002-04-21 12:34:58 +00:00
Mark Murray
bd41864183 Use protected names (_foo) to cutdown on boatloads of lint warnings. 2002-04-21 11:16:10 +00:00
Mark Murray
20f99c2b81 Wrap GCC-specific stuff and provide alternative for lint. 2002-04-21 11:11:02 +00:00
Mark Murray
b935044a8a Parenthesise macro arguments to reduce lint warnings. 2002-04-21 11:08:52 +00:00
Mark Murray
815eb79cb8 Fix really dumb braino of mine; cast a sizeof() to an int, which it is
being compared to, not size_t, which it already is.
2002-04-21 11:02:36 +00:00
Mark Murray
28e7ba4d11 Used protected names (_foo) for parameter names. This helps clean up
a boatload of lint warnings.
2002-04-21 10:57:43 +00:00
Mark Murray
db8f2e326c Stylify (mainly line up macro EOL-continuation \'s), and add a dummy
alternative for lint.
2002-04-21 10:49:00 +00:00
Mark Murray
1a924d7213 Parenthesise macro arguments to reduce lint warnings. 2002-04-21 10:43:24 +00:00
Mark Murray
d8c1bdfeb2 Stylify, fix tabs.
Liked by:	bde (a couple of months back)
2002-04-21 10:38:35 +00:00
Mark Murray
83238851f8 Remove macros that are defined elsewhere. 2002-04-21 10:32:48 +00:00
Marcel Moolenaar
76a9e6c9f5 Improve self-relocation and fix ABI misinterpretation. The changes
here mostly mirror the changes made in
	boot/efi/libefi/arch/ia64/start.S rev 1.5

Significant difference: We don't handle the IPLT relocation here.
For barebones KLD support, we make the fptr_storage global.
2002-04-21 08:56:17 +00:00
Marcel Moolenaar
77de753f65 Improve self-relocation:
o  We don't expect the PLT relocations to follow the .rela section
   anymore. We still assume that PLT relocations are long formed,
o  Document register usage,
o  Improve ILP,
o  Fix the FPTR relocation by creating unique OPDs per function.
   Comparing functions is valid now,
o  The IPLT relocation naturally handles the addend. Deal with it.
   We ignore the addend for FPTR relocations for now. It's not at
   all clear what it means anyway.

Fix ABI misinterpretation:
o  For Elf_Rela relocations, the addend is explicit and should not
   be loaded from the memory address we're relocating. Only do that
   for Elf_Rel relocations (ie the short form).
o  DIR64LSB is not the same as REL64LSB. DIR64LSB applies to a
   symbol (S+A), whereas REL64LSB applies to the base address (BD+A),
2002-04-21 08:49:47 +00:00
David E. O'Brien
34ef85ee3d o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
Andrew R. Reiter
64151e7a8a - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +00:00
Marcel Moolenaar
9daa5b147a GCC 3.x WARNS: Add a break to the default case. 2002-04-20 21:56:42 +00:00
Mike Barcroft
04961ff8be Reenable the newly unbroken hfa device. 2002-04-20 19:44:38 +00:00
Mike Barcroft
72cd6fa0c0 Change two KM_COPY()s to bcopy(). This should have been done when the
KM_* macros were removed.
2002-04-20 19:27:34 +00:00
Jake Burkholder
9ba847abf3 MFi386 1.222. Remove vm_map_growstack and acquisition and release of Giant
from trap_pfault.
2002-04-20 17:28:08 +00:00
Jake Burkholder
d1fef1792c Check the alignment of the stack pointer before copying in windows from the
user stack in response to a failed window fill, allowing the process to be
killed if its wrong.  This caused user programs which misalign their stack
pointer to get stuck in an infinite loop at the kernel-userland boundary,
which is mostly harmless.

The same thing causes a fatal RED state exception on OpenBSD and probably
NetBSD.

Inspired by:	art@openbsd.org
2002-04-20 16:23:52 +00:00
Jake Burkholder
bb52b4f3fc Fix off by one errors in cache flush calls (mostly harmless). 2002-04-20 15:58:40 +00:00
Jake Burkholder
26956cba94 Add needed include of tick.h. 2002-04-20 15:52:53 +00:00
Robert Watson
b099af16dd Add an XXX: linux_uselib() should be using vn_open() rather than invoking
VOP_OPEN() and doing lots of manual checking.  This would further
centralize use of the name functions, and once the MAC code is integrated,
meaning few extraneous MAC checks scattered all over the place.  I don't
have time to fix this now, but want to make sure it doesn't get
forgotten.  Anyone interested in fixing this should feel free.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-20 14:43:34 +00:00
Semen Ustimenko
da1b4964c9 Update the email appearing in copyright string.
MFC after:	1 day
2002-04-20 12:39:41 +00:00
Semen Ustimenko
d09fa37dd9 Merge ``&& must be ||'' bug noticed and fixed in OpenBSD. The only ill effect
was if_baudrate being always 10Mbit.

Obtained from:	OpenBSD
MFC after:	1 day
2002-04-20 12:35:38 +00:00
Seigo Tanimura
1c2451c24d Push down Giant for setpgid(), setsid() and aio_daemon(). Giant protects only
malloc(9) and free(9).
2002-04-20 12:02:52 +00:00
Benno Rice
f6310641b9 Replace inline asm with it's inline function wrapper. 2002-04-20 10:06:22 +00:00
Andrew R. Reiter
e062d89cdc - Create a ``zero fill'' constructor for uma_zcreate's ctor argument.
Inspired by: jake@
2002-04-20 09:04:58 +00:00
Alan Cox
a569838764 Reintroduce locking on accesses to vm_object_list. 2002-04-20 07:23:22 +00:00
Boris Popov
5f3d1ad8c9 Add character translation table between Unix and NetWare according
to Sweden standards.

Submitted by:	Roger Olofsson <roger.olofsson@kommun.engelholm.se>
MFC after:	1 week
2002-04-20 05:35:02 +00:00
Mike Barcroft
c636dc4381 Add typedef of sa_family_t to <sys/un.h>, per POSIX and X/Open. Hide
portions of <sys/un.h> when a standard has been requested.
2002-04-20 02:26:43 +00:00