Commit Graph

23838 Commits

Author SHA1 Message Date
John Baldwin
2ccd992403 - Use "+a" instead of "=&a" for several constraints. This should fix
compiling errors where gcc would run out of registers.
- Add "cc" to the list of clobbers for micro-ops where we perform
  instructions that alter %eflags.
- Use xchgl instead of cmpxchgl to release a spin lock.  This could allow
  for more efficient register allocation as we no longer mandate that %eax
  be used.
- Reenable the optimized mutex micro-ops in the non-i386 case.
2001-01-16 03:45:54 +00:00
John Baldwin
10fd583277 Free the intrhand name when free'ing a intrhand.
Submitted by:	bde
2001-01-16 02:17:51 +00:00
Bosko Milekic
35c05ac61b Add some KASSERTs valid if WITNESS is defined to verify that the mbuf
allocation routines are being called safely. Since we drop our relevant
mbuf mutex and acquire Giant before we call kmem_malloc(), we have
to make sure that this does not pave the way for a fatal lock order
reversal. Check that either Giant is already held (in which case it's safe
to grab it again and recurse on it) or, if Giant is not held, that no
other locks are held before we try to acquire Giant.

Similarily, add a KASSERT valid in the WITNESS case in m_reclaim() to
nail callers who end up in m_reclaim() and hold a lock.

Pointed out by: jhb
2001-01-16 01:53:13 +00:00
Jason Evans
238510fc46 Implement condition variables. 2001-01-16 01:00:43 +00:00
Matt Jacob
e01862e9b0 Use the residual from a spacing operation to try and figure out where
we *really* are.

It should be noted that there is a degenerate case where soft tape
location will be lost (not causing a frozen state- but causing
the loss of reporting fileno/blockno)- that's where you backspace
over a filemark- you stop backspacing as soon as you cross the
filemark, but you have no idea what the record number now is because
you have no idea how many records you are into the file you just
backed into. Such is life.

While I'm at it, also pick up residuals from writing filemarks.

PR:		24222
2001-01-16 00:53:45 +00:00
Matt Jacob
64a471a304 Get rid of those pesky "driver mistake" messages... destroy the create_d dev_t
when you take down the device.

Reviewed by:	audit@freebsd.org (Warner, Justin)
2001-01-16 00:30:37 +00:00
John Baldwin
8a6b1c8f54 - Fix atomic_load_* and atomic_store_* to generate functions for atomic.c
that modules can call.
- Remove the old gcc <= 2.8 versions of the atomic ops.
- Resort the order of some things in the file so that there is only
  one #ifdef for KLD_MODULE, and so that all WANT_FUNCTIONS stuff is
  moved to the bottom of the file.
- Remove ATOMIC_ACQ_REL() and just use explicit macros instead.
2001-01-16 00:18:36 +00:00
Matt Jacob
86bff6836d Fix PR 24220 by using the periph private field0 for a CCB for not
only CCB type but also extra flags- one of which can be "position
updated".

In other changes: Add in a SA_QUIRK_NO_CPAGE quirk so that it's possible
to avoid using a (broken) device's implementation of he DEVICE COMPRESSION
page.

Also do a couple of printout cleanups.

As per some discussion on FreeBSD-scsi, skip doing tape flushing
if we're reading tape logical block location (MTIOCRDSPOS).
2001-01-15 22:28:11 +00:00
Mark Murray
c202cd74f8 Clean up Makefile, and remove the last vestiges of NOBLOCKRANDOM. 2001-01-15 19:35:00 +00:00
Matt Jacob
7afb656f3f Add was_fabric_dev/fabric_dev tags to our local FC database structure
(so we can see rapidly whether something was a fabric device but is
now gone).

Add a tag which says what role this adapter should take. It can take
on the value of None, Target, Initiator or Both. None is useful for
warm failover purposes. Remove the ISP_CFG_NOINIT silliness since
a role of "None" does this.

Add a isp_lastmbxcmd tag to store the opcode for the last mailbox
command used.
2001-01-15 18:40:37 +00:00
Matt Jacob
144ff11903 Put in offset definitions for FPM and FBM registers, plus just enough
bits defined so we can reset them.
2001-01-15 18:37:14 +00:00
Matt Jacob
df1590c05d Set default adapter role. 2001-01-15 18:36:39 +00:00
Matt Jacob
fe4a3254ce Use the isp_lastmbxcmd tag to report timed out mailbox commands.
Arrrggghhhh! Very likely fix 22650 by remembering to, ahem, set
CAM_AUTOSNS_VALID when one has sense data.
2001-01-15 18:36:09 +00:00
Matt Jacob
70d2cccebd Do more cleanup of the usage of 0..125 for F-port topologies. 2001-01-15 18:34:49 +00:00
Matt Jacob
6677e7f89e When resetting the Qlogic 2X00 units, reset the FPM (Fibre Protocol
Module) and FBM (Fibre Buffer Modules). Also remember to clear the
semaphore registers. Tell the RISC processor to not halt on FPM
parity errors.

Throw out the ISP_CFG_NOINIT silliness and instead go to the use of
adapter 'roles' to see whether one completes initialization or not
(mostly for Fibre Channel). The ultimate intent, btw, of all of this
is to have a warm standby adapter for failover reasons.  Because
we do roles now, setting of Target Capable Class 3 service parameters
in the ICB for the 2x00 cards reflects from role. Also, in isp_start,
if we're not supporting an initiator role, we bounce outgoing commands
with a Selection Timeout error. Also clean out the TOGGLE_TMODE
goop for FC- there is no toggling of target mode like there is
for parallel SCSI cards.

Do more cleanup with respect to using target ids 0..125 in F-port
topologies. Also keep track of things which *were* fabric devices
so that when you rescan the fabric you can notify the outer layers
when fabric devices go away.

Only force a LOGOUT for fabric devices if they're still logged in
(i.e., you cat their Port Database entry. Clean up the Get All Next
scanning.

Finally, use a new tag in the softc to store the opcode for the
last mailbox command used so we can report which opcode timed
out.
2001-01-15 18:33:08 +00:00
Ian Dowse
f55ff3f3ef The ffs superblock includes a 128-byte region for use by temporary
in-core pointers to summary information. An array in this region
(fs_csp) could overflow on filesystems with a very large number of
cylinder groups (~16000 on i386 with 8k blocks). When this happens,
other fields in the superblock get corrupted, and fsck refuses to
check the filesystem.

Solve this problem by replacing the fs_csp array in 'struct fs'
with a single pointer, and add padding to keep the length of the
128-byte region fixed. Update the kernel and userland utilities
to use just this single pointer.

With this change, the kernel no longer makes use of the superblock
fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c
to indicate that these fields must be calculated for compatibility
with older kernels.

Reviewed by:	mckusick
2001-01-15 18:30:40 +00:00
Hellmuth Michaelis
54a232485c it seems that a commit to i4b/drivers/i4b_ispppsubr.c on 2000-01-12 has
broken the handling of uncompressed VJ packets. The attached diff should
hopefully fix that.
Submitted by:	Thomas Moestl <tmoestl@gmx.net>
Reviewed by:	Sergio de Souza Prallon <prallon@tmp.com.br>
2001-01-15 14:58:46 +00:00
Hellmuth Michaelis
23f507c5d1 Reenable support for FreeBSD 4.x and possibly the other supported BSD's 2001-01-15 14:54:43 +00:00
Toshihiko ARAI
6fb806fdd1 Add support for SMC91C100FD chip of MELCO LPC-TX.
sn1 at port 0x240-0x24f irq 10 slot 0 on pccard0
sn1:  SMC91C100FD UTP MAC address 00:a0:dc:22:26:8c

Submitted by:	"KOMURO" <komujun@nifty.com>
2001-01-15 12:01:14 +00:00
Matthew Dillon
8f7939aeef Make NSWAPDEV reasonable so people do not mistakenly use unreasonable
values when creating custom kernels from LINT.

Suggested-by: "Louis A. Mamakos" <louie@TransSys.COM>
2001-01-15 06:45:01 +00:00
Peter Wemm
194b08ffc3 Implement an optimization for INTREN/INTRDIS that bde pointed out last
time I tinkered around here.  Since INTREN is called from the interrupt
critical path now, it should not be too expensive.  In this case, we
look at the bits being changed to decide which 8 bit IO port to write to
rather than unconditionally writing to both.  I could probably have gone
further and only done the write if the bits actually changed, but that
seemed overkill for the usual case in interrupt threads.

[an outb is rather expensive when it has to cross the ISA bus]
2001-01-15 04:18:58 +00:00
Josef Karthauser
4c3a3ec075 Instead of hard coding the major numbers for IDE and SCSI disks
look in the device's cdevsw for the D_DISK flag.
2001-01-14 23:33:50 +00:00
Julian Elischer
6b79597012 Add a generic "queued function callin" mechanism
Use it to implement (hopefully) SMP safe node/hook addition
and removal.
Fix some debug stuff.
2001-01-14 23:25:54 +00:00
Søren Schmidt
3ce9aa9100 Use prober atomic operations when test&set'ing ->active.
This turns some of my lockups under SMP into spontanious reboots...
2001-01-14 19:36:20 +00:00
Dag-Erling Smørgrav
b41686b9c5 Add {ACD,AST,ATAPI,ATA}_DEBUG.
Approved by:	sos
2001-01-14 19:03:53 +00:00
Poul-Henning Kamp
9039f19fa0 A bit of sanity-checking in bioqdisksort(): panic if we recurse. 2001-01-14 18:48:42 +00:00
Matt Jacob
52f1d19f90 The size of kinfo_proc on an alpha is 904 (not 640). 2001-01-14 18:21:19 +00:00
Dag-Erling Smørgrav
158eb2773f The Linuxulator needs sysvipc to work. 2001-01-14 18:16:01 +00:00
Dag-Erling Smørgrav
faa784b70c Use predictable internal names for the sysvipc modules, so we have a
chance of getting dependencies working.
2001-01-14 18:04:30 +00:00
Mark Murray
b79ad7e642 Remove NOBLOCKRANDOM as a compile-time option. Instead, provide
exactly the same functionality via a sysctl, making this feature
a run-time option.

The default is 1(ON), which means that /dev/random device will
NOT block at startup.

setting kern.random.sys.seeded to 0(OFF) will cause /dev/random
to block until the next reseed, at which stage the sysctl
will be changed back to 1(ON).

While I'm here, clean up the sysctls, and make them dynamic.
Reviewed by:		des
Tested on Alpha by:	obrien
2001-01-14 17:50:15 +00:00
Hajimu UMEMOTO
f788b00b22 fixed possibility of panic at key_acquire().
key_acquire() does not require a secpolicy structure.

Obtained from:	KAME
2001-01-14 17:25:08 +00:00
John Baldwin
4408a4e8ff Argh, remove a local customization that snuck in here.
Noticed by:	jasone
2001-01-14 10:19:42 +00:00
John Baldwin
decc707afc Remove I386_CPU from GENERIC. Support for the 386 seriously pessimizes
performance on other x86 processors.  Custom kernels can still be built
that will run on the 386.
2001-01-14 10:11:10 +00:00
John Baldwin
285e3ac733 Revert the previous revision now that atomic_store_rel_ptr() actually
works.
2001-01-14 09:56:35 +00:00
John Baldwin
9d979d8912 Fix the atomic_load_acq() and atomic_store_rel() functions to properly
implement memory fences for the 486+.  The 386 still uses versions w/o
memory fences as all operations on the 386 are not program ordered.
The 386 versions are not MP safe.
2001-01-14 09:55:21 +00:00
Greg Lehey
940b9a4808 struct rangelock: Remove the field 'plex' from the entry. Range locks
are accessed only via the plex, so there's never any confusion as to
the plex number.  This value was, as a result, unused.
2001-01-14 06:34:57 +00:00
Greg Lehey
96f2d202a1 format_config: If a subdisk loses its drive (due to a bug which has
not yet been caught), don't save the config with a null drive
   	name (which causes the drive to be renamed "plex" on the next
   	start), put in the text "*invalid*" instead.

	This is damage control, not a fix.

Experienced by:	peter

Break some long format strings so that they fit in style(9)-sized
lines.

Remove some "outdentation".
2001-01-14 06:33:10 +00:00
Greg Lehey
a08d6f1a2c config_plex: Check that we have specified a plex organization.
Tripped over by:	"Jeroen C. van Gelderen" <jeroen@vangelderen.org>
2001-01-14 06:29:56 +00:00
Warner Losh
2fedd05ce9 Use ANSI prototype and function definition for dkcksum so that this
file can be included with C++ again.  This appears to have been broken
in 1.54 with the introduction of it as an inline function.
2001-01-14 05:14:37 +00:00
John Baldwin
6fe65214f2 Work around the broken atomic_store_rel_ptr() on the i386 arch by just
using atomic_cmpset_rel_ptr() instead for _release_lock_quick().  When
atomic_store_rel_ptr() is functional and MP safe, then this can be
reverted.
2001-01-14 00:16:17 +00:00
John Baldwin
b947e93403 - Use sched_lock to prevent the mutex name from changing out from under us
while we are copying it to the kinfo_proc structure.
- Test against p_stat to see if we are blocked on a mutex.
- Terminate ki_mtxname with a null char rather than ki_wmesg.
2001-01-13 23:08:34 +00:00
Ben Smithurst
4c061a9da1 Fix getsid() to use "=" instead of "==".
Not objected to by:	audit
2001-01-13 22:49:59 +00:00
John Baldwin
1d073b1d43 Add 3 new dynamic sysctl's to control the sleep states switched to on a
power button, sleep button, or lid close event.  The sysctl's use the
ACPI sleep state names S0, S1, S2, S3, S4, S4B, and S5.

Reviewed by:	iwasaki
2001-01-13 21:28:57 +00:00
Yoshihiro Takahashi
0a05044793 Merged from sys/i386/conf/GENERIC revision from 1.286 to 1.291. 2001-01-13 13:23:42 +00:00
Yoshihiro Takahashi
3cf9cf0797 Merged from sys/i386/conf/GENERIC.hints revision 1.6 and 1.7. 2001-01-13 13:23:22 +00:00
Yoshihiro Takahashi
628f1ab931 Check __i386__, not i386. 2001-01-13 13:21:43 +00:00
Kirk McKusick
cb3ab5aaf7 Properly compute the size of the final block of superblock summary information.
Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>
2001-01-12 21:56:55 +00:00
KATO Takenori
55d15a0439 Merged from sys/i386/isa/npx.c revision 1.87. 2001-01-12 13:42:53 +00:00
KATO Takenori
7590772d33 Merged from sys/i386/i386/machdep.c revisions 1.427 and 1.428. 2001-01-12 13:39:50 +00:00
KATO Takenori
d6f631a1f9 Merged from sys/conf/files.i386 revisions 1.342, 1.344, 1.345 and 1.346. 2001-01-12 13:38:46 +00:00