Commit graph

25936 commits

Author SHA1 Message Date
Doug Rabson a0e512b219 Make sure that all resource allocation is handled in the pcib device, not
the chipset. This is already how the multi-hose systems handle resource
allocation and it fixes a bug where dense and bwx memory allocations were
not handled properly.

Reviewed by: gallatin
2001-05-23 19:44:17 +00:00
John Baldwin b516d2f5e1 Add in assertions to ensure that we always call msleep or mawait with
either a timeout or a held mutex to detect unprotected infinite sleeps
that can easily lead to deadlock.

Submitted by:	alfred
2001-05-23 19:38:26 +00:00
Poul-Henning Kamp f73cf22ade Vlan tags are 12 bits, mask off anything above since the chip doesn't
seem to do so for us.

PR:		27567
Submitted by:	Koji HINO hino@ccm.cl.nec.co.jp
MFC after:	1 week
2001-05-23 19:25:14 +00:00
Poul-Henning Kamp 4787f91d6b syslogd gets kernel log messages only once every 30 seconds or
at the top of the minute, whichever comes first.  It seems
logtimeout() is only called once after the kernel log is opened
and then never again after that.  So I guess syslogd only gets
kernel log messages by virtue of syncer(4)'s flushes ...?

PR:		27361
Submitted by:	pkern@utcc.utoronto.ca
MFC after:	1 week
2001-05-23 19:02:50 +00:00
Poul-Henning Kamp 840d4a82e4 Use '+' not '|' to add PCATCH to tsleep. 2001-05-23 17:54:58 +00:00
Poul-Henning Kamp 840e78b879 Use the correct enums in struct sysinit. 2001-05-23 17:53:24 +00:00
Poul-Henning Kamp 3b6c05fa7f Remove the empty uscannerioctl() and use noioctl() instead. 2001-05-23 17:51:43 +00:00
Poul-Henning Kamp 5a9300c451 Change the way deletes are managed in DEVFS.
This fixes a number of warnings relating to removed cloned devices.

It also makes it possible to recreate deleted devices with
mknod(2).  The major/minor arguments are ignored.
2001-05-23 17:48:20 +00:00
Andrew Gallatin 42fcdcb3e9 catch up to i386:
- remove Giant for vm related traps
- don't hold Giant for MP safe syscalls

Reviewed-by: jhb
2001-05-23 16:34:07 +00:00
Alfred Perlstein 1752ee59ba ufs_bmaparray() may block on IO, drop vm mutex and aquire Giant when
calling it from the pager routine
2001-05-23 10:30:25 +00:00
Alfred Perlstein c5e62505ad aquire Giant when playing with the buffercache and doing IO.
use msleep against the vm mutex while waiting for a page IO to complete.
2001-05-23 10:28:11 +00:00
Alfred Perlstein 53240603ee aquire vm_mutex a little bit earlier to protect a pmap call. 2001-05-23 10:26:36 +00:00
Ruslan Ermilov 2c4645034f The following modules were renamed:
fdesc -> fdescfs
portal -> portalfs
umap -> umapfs
union -> unionfs
2001-05-23 10:06:48 +00:00
Ruslan Ermilov 801060df34 Name this module `umapfs'. 2001-05-23 10:02:22 +00:00
Ruslan Ermilov 99d300a1ec - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
systems were repo-copied from sys/miscfs to sys/fs.

- Renamed the following file systems and their modules:
  fdesc -> fdescfs, portal -> portalfs, union -> unionfs.

- Renamed corresponding kernel options:
  FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS.

- Install header files for the above file systems.

- Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland
  Makefiles.
2001-05-23 09:42:29 +00:00
Greg Lehey 468f05c7f7 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.

Remove the gross debug device/non-debug device hack used to recognize
whether the kernel module was in sync with the userland module.
2001-05-23 05:27:40 +00:00
Greg Lehey dd3dced8c4 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.
2001-05-23 05:27:15 +00:00
Greg Lehey 4ec8f62211 Move external declaration to vinumhdr.h. 2001-05-23 05:26:40 +00:00
Greg Lehey bc55b89e25 Set flag VF_HASDEBUG in vinum_conf to indicate that the module was
compiled with debug support.  This can be used by userland programs to
recognize which ioctls the module supports.

As a result, remove the gross debug device/non-debug device hack used
to recognize whether the kernel module was in sync with the userland
module.

Replace explicit references to major/minor numbers of vinum
superdevice with the VINUM_SUPERDEV macro written for that purpose.
2001-05-23 05:25:45 +00:00
Warner Losh a8ed536b94 Add better support for the Ricoh 5C296 and 5C396 chips. These chips
have a slightly different 3.3V support than the other clones, so
compensate as best we can.  Note: 3.3V support is untested since I do
not have any 3.3V cards that I know of to test it with.
2001-05-23 05:06:04 +00:00
Warner Losh e0e34f291e Add recognition for Toshiba ToPIC-100.
Submitted by: Shimodaira Toshio <tshimod1@ym.nsw.co.jp> in [bsd-nomads:15589]
2001-05-23 04:37:00 +00:00
Dima Dorfman a61a2e8e90 Add a makefile for snp(4) since it can be compiled as a module now. 2001-05-22 22:56:47 +00:00
Greg Lehey 4b2ec3c529 New header file.
Missed by:	Szilveszter Adam <sziszi@petra.hos.u-szeged.hu>
		David Wolfskill <david@catwhisker.org>
Pointy hat to:	grog
2001-05-22 22:29:35 +00:00
Dima Dorfman 0150c6e83d Unifdef DEV_SNP; snp(4) no longer requires these ugly hacks.
Silence by:	-hackers, -audit
2001-05-22 22:16:18 +00:00
Dima Dorfman 47eaa5f542 Convert this driver to (ab?)use line disciplines to get the input it
needs instead of relying on idiosyncratic hacks in the tty subsystem.
Also add module code since this can now be compiled as a module.

Silence by:	-hackers, -audit
2001-05-22 22:13:14 +00:00
Bruce Evans 1c1771cb5b Convert npx interrupts into traps instead of vice versa. This is much
simpler for npx exceptions that start as traps (no assembly required...)
and works better for npx exceptions that start as interrupts (there is
no longer a problem for nested interrupts).

Submitted by:	original (pre-SMPng) version by luoqi
2001-05-22 21:20:49 +00:00
Alfred Perlstein 240e0fdd93 aquire vm mutex in swp_pager_async_iodone. Don't call swp_pager_async_iodone
with the mutex held.
2001-05-22 19:01:26 +00:00
Andrew Gallatin 3bd404a4e2 grab the vm mtx around exec_new_vmspace() 2001-05-22 18:45:12 +00:00
Brian Somers 6ce76643aa MALLOC -> malloc, FREE -> free 2001-05-22 18:10:57 +00:00
Hajimu UMEMOTO 8d67252492 M_COPY_PKTHDR has to be done before MCLGET.
Obtained from:	KAME
2001-05-22 17:32:02 +00:00
Ruslan Ermilov 0a13f04ebe Hide UNION in opt_dontuse.h (see vfs_syscalls.c,v 1.109). 2001-05-22 08:32:13 +00:00
John Baldwin 86e92ee7e1 Remove duplicate include and sort includes. 2001-05-22 07:21:46 +00:00
John Baldwin 7d4ad42de5 Sort includes. 2001-05-22 07:01:11 +00:00
Greg Lehey 3b0d9edc7b Add vinumobj.h to SRCS. 2001-05-22 06:12:47 +00:00
Greg Lehey 74f5bf080b Remove Malloc definitions (now in vinumext.h) 2001-05-22 06:08:52 +00:00
John Baldwin 12635f9c89 Unlock the VM lock at the end of munlock() instead of locking it again. 2001-05-22 06:07:36 +00:00
John Baldwin 874468957d Sort includes from previous commit. 2001-05-22 05:35:45 +00:00
Dima Dorfman a8dbafbe87 Correct the vm_mtx handling; specifically, don't acquire it in
shm_deallocate_segment because shmexit_myhook calls it, and the latter
should always be called with it already held.

Submitted by:	dwmalone, dd
Approved by:	alfred
2001-05-22 03:56:26 +00:00
Greg Lehey c6ef641d24 Add a field 'version' to vinum_conf. This field is a constant which
gets incremented every time the kernel-userland interface changes.
This enables vinum(8) to check for the correct kernel version and to
produce a useful message if it doesn't match.

Requested by:	Too many to count.

Move the definitions of struct drive, sd, plex and volume to
vinumobj.h.

Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
2001-05-22 02:37:28 +00:00
Greg Lehey 2e387f1bd3 vinumstart: If a write request is for a RAID-[45] plex or a volume
with more than one plex, the data will be accessed
            multiple times.  During this time, userland code could
            potentially modify the buffer, thus causing data
            corruption.  In the case of a multi-plexed volume this
            might be cosmetic, but in the case of a RAID-[45] plex it
            can cause severe data corruption which only becomes
            evident after a drive failure.  Avoid this situation by
            making a copy of the data buffer before using it.

	    Note that this solution does not guarantee any particular
	    content of the buffer, just that it remains unchanged for
	    the duration of the request.

Suggested by:	alfred
2001-05-22 02:36:47 +00:00
Greg Lehey 5be7546b83 tokenize: Take third parameter specifying the maximum number of
parameters to return.  This code is used both in userland and in the
kernel.
2001-05-22 02:35:57 +00:00
Greg Lehey 24ad5cd24b Cosmetics: wrap long lines to be < 80 characters. 2001-05-22 02:35:19 +00:00
Greg Lehey c4d4f4147d Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
Use this instead of DEBUG_LASTREQS to decide whether to log lock
requests.

MFS:

vinumlock: Catch a potential race condition where one process is
           waiting for a lock, and between the time it is woken and
           it retries the lock, another process gets it and places it
           in the first entry in the table.

           This problem has not been observed, but it's possible, and
           it's easy enough to fix.

Submitted by:   tegge

vinumunlock: Catch a real bug capable of hanging a system.  When
             releasing a lock, vinumunlock() called wakeup_one.  This
             caused wakeups to sometimes get lost.  After due
             consideration, we think that this is due to the fact that
             you can't guarantee that some other process is also
             waiting on the same address.  This makes wakeup_one a
             very dangerous function to use.
2001-05-22 02:34:30 +00:00
Greg Lehey cf65a3dc63 Change ioctls to use the expurgated userland version of the Vinum
structures.
2001-05-22 02:33:32 +00:00
Greg Lehey acac8659d7 format_config: Replace long format lines.
Requested by:  bde

Add retryerrors keyword.

vinum_scandisk: Print a different message if an inadvertent start
command did not find any additional drives.  The previous message "no
drives found" confused and worried many people.

MFS:

vinum_open: Recognize Mylex devices as storage devices.
2001-05-22 02:32:22 +00:00
Greg Lehey ab15c118bf complete_rqe:
In case of error, check the VF_RETRYERRORS flag in the subdisk and
  don't take the subdisk down if it's set, just retry the I/O.

  Requested by:	peter

  If the buffer has been copied (XFR_COPYBUF), release the copied
  buffer when the I/O completes.

  Suggested by:	alfred
2001-05-22 02:31:08 +00:00
Greg Lehey 0e414969e0 Remove unnecessary declarations of userland functions.
Desired by:	   bde

This commit is the first of a general cleanup of the header files..
It won't be enough to make bde happy.

Move debug definitions from vinumhdr.h.
2001-05-22 02:30:44 +00:00
Greg Lehey 177bb9657f config_sd: Add code to recognize "retryerrors" keyword.
config_plex: Don't create the device until we're finished.

parse_config: check for corrupted configuration, thus avoiding a
potential panic.

remove_sd_entry: Restore structure.
2001-05-22 02:29:54 +00:00
Greg Lehey 7e18e4ffbc free_vinum: Change some explicit struct member references to the SD,
PLEX and VOL.
2001-05-22 02:29:15 +00:00
Greg Lehey 2c4a6d9016 Add xferinfo flag bit for copied buffers.
Create a new struct rangelockinfo.  In revision 1.21 of vinumlock.c,
the plex info was removed from struct rangelock, since it wasn't
needed there.  It *is* needed for trace information, however, so use
struct rangelockinfo for that.
2001-05-22 02:28:55 +00:00
Greg Lehey 1739a10826 New file containing definitions for separate views of objects for
userland and kernel.
2001-05-22 01:41:12 +00:00
Alfred Perlstein a4d22b8035 Remove KASSERT test for sleeping on mv_mtx, instead let WITNESS catch
it.

Requested by: jhb
2001-05-22 00:58:20 +00:00
John Baldwin 4edf4a58e6 Sort includes. 2001-05-22 00:56:25 +00:00
Dima Dorfman 21fa152ffa Fix a grammar nit.
PR:		27520
Submitted by:	Michael Lucas <mwlucas@blackhelicopters.org>
2001-05-22 00:29:42 +00:00
John Baldwin c4f96c5f83 Remove a few more spl's I missed earlier.
Reported by:	Michael Harnois <mdharnois@home.com>
Pointy hat:	me
2001-05-22 00:09:26 +00:00
John Baldwin 2178ff8b9f Sort includes from previous commit. 2001-05-21 23:19:50 +00:00
John Baldwin 9dceb26b23 Sort includes. 2001-05-21 18:52:02 +00:00
John Baldwin 270b041d95 - Assert that the vm mutex is held in pipe_free_kmem().
- Don't release the vm mutex early in pipespace() but instead hold it
  across vm_object_deallocate() if vm_map_find() returns an error and
  across pipe_free_kmem() if vm_map_find() succeeds.
- Add a XXX above a zfree() since zalloc already has its own locking,
  one would hope that zfree() wouldn't need the vm lock.
2001-05-21 18:47:17 +00:00
John Baldwin d8aad40c88 Axe unneeded spl()'s. 2001-05-21 18:30:50 +00:00
Poul-Henning Kamp c69ff89710 syslog.h fails to compile with -Wwrite-strings
PR:		27492
Submitted by:	Alexey V. Neyman <avn@any.ru>
2001-05-21 17:32:47 +00:00
Andrew Gallatin 08eceb4f4b Change pmap_emulate_reference() so that it only touches the vm_page
flags if it is safe to do so, otherwise it will just alter the pmap state
(eg, clear the appropriate PG_FOx bits).

This gets alpha booting in the face of the vm_mtx introduction.

Reviewed by: dfr
2001-05-21 16:09:29 +00:00
Andrew Gallatin 2ee7c91e2e catch these files up to their i386 neighbors to make alpha boot
prior to the vm_mtx
2001-05-21 16:04:24 +00:00
Yoshihiro Takahashi bd0432d8b0 Update pc98 memory probe functions.
- pc98_getmemsize() function returns available memory size under 16MB.
 - getmemsize() function is merged from PC-AT's one.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata) and
		NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
2001-05-21 12:51:44 +00:00
Yoshihiro Takahashi c48d35696d Merged from sys/i386/isa/npx.c revisions 1.99 and 1.100. 2001-05-21 12:20:22 +00:00
Yoshihiro Takahashi 2877ab5bdb Merged from sys/i386/i386/machdep.c revisions 1.452 and 1.453. 2001-05-21 11:57:54 +00:00
Yoshihiro Takahashi a93f8c6e6e Merged from sys/boot/i386/btx/btx/btx.s revision 1.24. 2001-05-21 11:49:21 +00:00
Hellmuth Michaelis 078aac9c09 Submitted by: Juha-Matti Liukkonen, Cubical Solutions Ltd (jml@cubical.fi)
Reviewed by:	hm

Bug in i4btel driver read routine corrected. The conditions in the
while() clause caused the receive queue to be referenced before checking
if a channel is connected, leading to kernel panic (do a 'dd
if=/dev/i4btel0 of=/dev/null' on an unconnected tel device, panic will
follow). Correction was to reorder the while clause conditions to check
for connectedness first.
2001-05-21 09:24:48 +00:00
Warner Losh 13ab4e6dc1 Move allocation of ExCA registers from the base driver into the bus
attachment code.
2001-05-21 07:32:46 +00:00
Warner Losh 2003c3f530 Move setting of Vcc bit to before the vcc switch statement. The
datasheets I have seem to indicate that generally this bit is viewed
as a toggle.  Correct comments to match code.
2001-05-21 05:49:15 +00:00
Warner Losh 57462c010c Next step on the road to pci: power taming.
Work through the various power commands and convert them from a "is
this a foo controller or a foo' controller or a foo''' controller" to
a cabability based scheme.  We have bits in the softc that tell us
what kind of power control scheme the controller uses, rather than
relying on being able to enumerate them all.  Cardbus bridges are
numerous, but nearly all implement the i82365sl-DF scheme (well, a few
implement cirrus CL-PD67xx, but those were made by Cirrus Logic!).

Add a pointer back to the softc in each pcic_slot so we can access
these flags.

Add comments that talk about the issues here.  Also note in passing
that there are two differ Vpp schemes in use and that we may need to
adjust the code to deal with both of them.  Note why it usually works
now.

We have 5 power management modes right now: KING, AB, DF, PD and VG.
AB is for the i82365 stpes A, B and C.  DF is for step DF.  PD is the
cirrus logic extensions for 3.3V while VG is the VADEM extensions for
3.3V.  KING is for the IBM KING controller found on some old cards.
# I'm looking for one of those old cards or a laptop that has the KING
# bridge in it.

We have to still cheat and treat the AB parts like the DF parts
because pci isn't here yet.  As far as I can tell, this is harmless
for actual old parts and necessary to work with 3.3V cards in some
laptops.

This almost eliminates all tests for controller in the code.  There
are still a few unrelated to power that need taming as well.
2001-05-21 04:44:14 +00:00
Warner Losh e67316366d Next step towards pcic_pci: the ability to allocate mapped memory in attach.
o Introduce flags word to the softc.  This will be used to control various
  aspects of the driver.  Right now there are two bits defined, PCIC_IO_MAPPED
  and PCIC_MEM_MAPPED.  One for ISA cards that are I/O mapped, the other is
  for PCI cards that are memory mapped.  Only the ISA side is implemented
  with this commit.
o Introduce a pcic_dealloc which will cleanly dealloc resources used.  Right
  now it is only supported when called from probe/attach.
o Keep track of resources allocated in the pcic_softc.
o move pcictimeout_ch to the softc so we can support multiple devices
  in polling mode.
o In ISA probe, set PCIC_IO_MAPPED.
o Introduce and compute the slot mask.  This will be used later when
  we expand the number of slots on ISA from 2 to 4.  In such a case, we
  appear to have to use polling mode otherwise we get two different cards
  trying to drive the same interrupt line.  I don't have hardware to
  test this configuration, so I'll stop here.
2001-05-21 03:22:52 +00:00
Jun Kuriyama da76f18bc6 Add description for 82801BA controller.
MFC after:	1 week
2001-05-21 01:24:14 +00:00
Warner Losh 69ffb52731 Two comments and one bug fix:
o Add defines for the VS[12]# bits in register 0x16.
o Add comment about what we're doing reading register 0x16 (PCIC_CDGC)
  in the DF case.
o Check bit VS1# rather than a random bit I was checking due to a bogus
  transcrition on my part from nakagawa-san's article.
o Add note about IBM KING and 3.3V operation from information larned from
  wildboard.
2001-05-21 00:55:44 +00:00
Alfred Perlstein 67d1f21cbe Aquire vm mutex when releasing sysv shm segments.
Obtained from: Dima Dorfman <dima@unixfreak.org>
2001-05-20 20:37:47 +00:00
Bruce Evans 17008f5343 Throw away the complications in npxsave() and their infrastructure.
npxsave() went to great lengths to excecute fnsave with interrupts
enabled in case executing it froze the CPU.  This case can't happen,
at least for Intel CPU/NPX's.  Spurious IRQ13's don't imply spurious
freezes.  Anyway, the complications were usually no-ops because IRQ13
is not used on i486's and newer CPUs, and because SMPng broke them in
rev.1.84.  Forcible enabling of interrupts was changed to
write_eflags(old_eflags), but since SMPng usually calls npxsave() from
cpu_switch() with interrupts disabled, write_eflags() usually just
kept interrupts disabled.
2001-05-20 20:04:40 +00:00
Bruce Evans 7010278935 Use a critical region to protect almost everything in npxinit().
npxinit() didn't have the usual race because it doesn't save to curpcb,
but it may have had a worse form of it since it uses the npx when it
doesn't "own" it.  I'm not sure if locking prevented this.  npxinit()
is normally caled with the proc lock but not sched_lock.

Use a critical region to protect pushing of curproc's npx state to
curpcb in npxexit().  Not doing so was harmless since it at worst
saved a wrong state to a dieing pcb.
2001-05-20 18:05:44 +00:00
Bruce Evans 259089eefc Use a critical region to protect pushing of curproc's npx state to
curpcb in vm86_bioscall().  I don't know if the state is ever in the
npx at that point.
2001-05-20 17:01:20 +00:00
Bruce Evans c2b095ab72 Use a critical region to protect saving of the npx state in savectx().
Not doing this was fairly harmless because savectx() is only called
for panic dumps and the bug could at worse reset the state.

savectx() is still missing saving of (volatile) debug registers, and
still isn't called for core dumps.
2001-05-20 16:51:08 +00:00
Andrew Gallatin c5c4ac3fb8 fix vm_mtx related compiler warning 2001-05-20 16:41:37 +00:00
Andrew Gallatin 29e7f33db5 fix alpha-MD compile errors after the vm_mtx commit 2001-05-20 16:22:46 +00:00
Kirk McKusick 57042c7f72 Update softdep_setup_directory_add prototype to reflect changes in
actual function.

Obtained from:	Jim Bloom <bloom@jbloom.jbloom.org>
2001-05-20 15:59:55 +00:00
Munechika SUMIKAWA 2bf767799a Plug memoly leak in overlaps fragment cases.
Obtained from:	KAME
2001-05-20 15:33:46 +00:00
MIHIRA Sanpei Yoshiro 1a92411c80 Add SmartLink 5634PCV SurfRider
PR:		kern/26952
Submitted by:	Simon Dick <simond@irrelevant.org>
2001-05-20 03:12:55 +00:00
John Polstra a514569e9a Fix a range checking bug in ng_int32_parse which affected 64-bit
machines.  The code formerly read:

    long val;
    if (val < (long)-0x80000000 || ...)
            return EINVAL;

The constant 0x80000000 has type unsigned int.  The unary `-'
operator does not change the type (or the value, in this case).
Therefore the promotion to long is done by 0-extension, giving
0x0000000080000000 instead of the desired 0xffffffff80000000.  I
got rid of the `-' and changed the cast to (int32_t) to give proper
sign-extension on all architectures and to better reflect the fact
that we are range-checking a 32-bit value.

This commit also makes the analogous changes to ng_int{8,16}_parse
for consistency.

MFC after:	3 days
2001-05-19 19:36:32 +00:00
Kirk McKusick dc01275be9 Must ensure that all the entries on the pd_pendinghd list have been
committed to disk before clearing them. More specifically, when
free_newdirblk is called, we know that the inode claims the new
directory block. However, if the associated pagedep is still linked
onto the directory buffer dependency chain, then some of the entries
on the pd_pendinghd list may not be committed to disk yet. In this
case, we will simply note that the inode claims the block and let
the pd_pendinghd list be processed when the pagedep is next written.
If the pagedep is no longer on the buffer dependency chain, then
all the entries on the pd_pending list are committed to disk and
we can free them in free_newdirblk. This corrects a window of
vulnerability introduced in the code added in version 1.95.
2001-05-19 19:24:26 +00:00
Brian Somers c7fee90e33 #include <digi/*.h> -> #include <dev/digi/*.h>
Suggested by: bde
2001-05-19 17:06:48 +00:00
Brian Somers c103d24a09 Fairwell digiio.h (moved to src/sys/sys) 2001-05-19 09:40:10 +00:00
Brian Somers 343ae1c099 digiio.h has moved to /usr/include/sys 2001-05-19 09:28:59 +00:00
Warner Losh aa3a855755 Add back the plain i82365 to the list of bridges that do special
things to get 3.3V.  It appears that some cardbus chipsets have id
registers that say they are C step parts, but they really support the
DF step 3.3V functionality.

# Need to verify that IBM KING is handled properly since the MISC1
# register is really a cirrus logic only register.
2001-05-19 06:36:09 +00:00
Warner Losh 0eee936491 Initialize cinfo structure at compile time rather than run time since
they are now constant.
2001-05-19 06:17:37 +00:00
Warner Losh b012272796 slots and next haven't been used in a while. GC them. 2001-05-19 06:13:12 +00:00
Jonathan Lemon d9b610a0db Add new 'loadavg' entry, fix overflow with meminfo.
PR: 27253, 27350
Submitted by: Jim Pirzyk
2001-05-19 05:54:26 +00:00
Warner Losh 11695ef016 Now that we've moved the mecia support out of pcic.c to its own
driver, we no longer need to go through the cinfo.XXXX indirections.
restore the direct calls that were replaced earlier.
2001-05-19 05:50:42 +00:00
Jonathan Lemon 93e08c6931 Use new kernel_sysctlbyname function. Remove private copy. 2001-05-19 05:48:07 +00:00
Jonathan Lemon 1890520a77 Add convenience function kernel_sysctlbyname() for kernel consumers,
so they don't have to roll their own sysctlbyname function.
2001-05-19 05:45:55 +00:00
Warner Losh bc0f2245d1 Move ISA specific code into pcic_isa. This is the probe routine, the
get/setb1 routines.  Also expose clrb and setb as pcic_{clrb,setb} so
we can use it from the probe.  pcic_probe is no longer needed.
2001-05-19 05:21:23 +00:00
Warner Losh 08db6b5c8e It turns out that Intel's i82365sl-DF step has the same ID as the VLSI
82C146.  The Intel i82365SL-DF supports 3.3V cards.  The Step A/B/C
parts do not appear to support this.  This is hard to know for sure
since it was deduced from "compatible" parts' data sheets and the
article mentioned below.

Rework the VLSI detection to be a little nicer and not depend on
scanning cards twice.  This would allow bad VLSI cards to coexist with
a good intel card, for example.  We now detect i82365SL-DF cards where
before we'd detect a VLSI.  For the most part, this is good, but we
run a small chance of detecting a single slot 82C146 as a i82365SL-DF.
Since I can't find a datasheet for the 82c146, I don't know if this is
a problem or not.

This work is based on an excellent article, in Japanese, by NAKAGAWA,
Yoshihisa-san that appeared in FreeBSD Press Number 4.  He provided a
patch against PAO3 in his article.  Since the pcic.c code has changed
some since then, I've gone ahead and cleaned up his patch somewhat and
changed how the code detects the buggy '146 cards.

I also removed the comment asking if there were other cards that
matched the 82C146 since we found one and additional information isn't
necessary.
2001-05-19 04:53:20 +00:00
Alfred Perlstein 5ee5c3aa1f remove my private assertions from tsleep.
add one assertion to ensure we don't sleep while holding vm.
2001-05-19 01:40:48 +00:00
Alfred Perlstein 2c3c846931 Regen syscalls that were made mpsafe via vm_mtx
obreak, getpagesize, sbrk, sstk, mmap, ovadvise, munmap, mprotect,
madvise, mincore, mmap, mlock, munlock, minherit, msync, mlockall,
munlockall
2001-05-19 01:37:12 +00:00
Alfred Perlstein 2395531439 Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb
2001-05-19 01:28:09 +00:00
Kirk McKusick 9f5192ff71 Must be a bit less aggressive about freeing pagedep structures.
Obtained from:	Robert Watson <rwatson@FreeBSD.org> and
		Matthew Jacob <mjacob@feral.com>
2001-05-18 22:16:28 +00:00
Nik Clayton 96bf38f272 Add a new ioctl to syscons, CONS_SCRSHOT. Given a userland buffer, it
copies out the current contents of the video buffer for a syscons terminal,
providing a snapshot of the text and attributes.

Based heavily on work originally submitted by Joel Holveck <joelh@gnu.org>
for 2.2.x almost 30 months ago, which I cleaned up a little, and forward
ported to -current.

See also the usr.bin/scrshot utility.
2001-05-18 08:52:56 +00:00
Boris Popov 10fa1684ed Currently there is no way to tell if write operation invoked via
vn_start_write() on the given vnode will be successful. VOP_LEASE() may
help to solve this problem, but its return value ignored nearly everywhere.
For now just assume that the missing upper layer on write means insufficient
access rights (which is correct for most cases).
2001-05-18 07:43:13 +00:00
David E. O'Brien 02c629d468 Make _BSD_TIME_T_ (time_t) an int' rather than long'. This will help
flag errors where programmers assume time_t is a long, which it is not on
64-bit platforms.

Submitted by:	bde
2001-05-18 01:43:25 +00:00
David E. O'Brien ef76752043 Style changes -- revert ordering to mostly two revs ago.
Embellish some comments, fix tab'ing.

Requested by:	bde
2001-05-18 01:40:40 +00:00
John Baldwin ea7549540f - Use a timeout for the tsleep in scheduler() instead of having vmmeter()
wakeup proc0 by hand to enforce the timeout.
- When swapping out a process, keep the process locked via the proc lock
  from the first checks up until we clear PS_INMEM and set PS_SWAPPING in
  swapout().  The swapout() function now must be called with the proc lock
  held and releases it before returning.
- Comment out the code to attempt to lock a process' VM structures before
  swapping out.  It is broken in that it releases the lock after obtaining
  it.  If it does grab the lock, it needs to hand it off to swapout()
  instead of releasing it.  This can be revisisted when the VM is locked
  as this is a valid test to perform.  It also causes a lock order reversal
  for the time being, which is the immediate cause for temporarily
  disabling it.
2001-05-18 00:08:38 +00:00
Jonathan Lemon 2e2b823898 Add workaround for embedded NICs, in particular, the 815E boards.
There appears to be a bug where the chip will lock up when running
in 10Mb/s mode.
2001-05-17 23:50:24 +00:00
John Baldwin 1c58e4e550 During the code to pick a process to kill when memory is exhausted, keep
the process in question locked as soon as we find it and determine it to
be eligible until we actually kill it.  To avoid deadlock, we don't block
on the process lock but skip any process that is already locked during our
search.
2001-05-17 22:49:03 +00:00
John Baldwin 1ad5401134 - Don't panic on a try lock operation for a sleep lock if we hold a spin
lock.  Since we won't actually block on a try lock operation, it's not
  a problem.  Add a comment explaining why it is safe to skip lock order
  checking with try locks.
- Remove the ithread list lock spin lock from the order list.
2001-05-17 22:44:56 +00:00
John Baldwin 4d29cb2db9 - Remove the global ithread_list_lock spin lock in favor of per-ithread
sleep locks.
- Delay returning from ithread_remove_handler() until we are certain that
  the interrupt handler being removed has in fact been removed from the
  ithread.
- XXX: There is still a problem in that nothing protects the kernel from
  adding a new handler while the ithread is running, though with our
  current architectures this is not a problem.

Requested by:	gibbs (2)
2001-05-17 22:43:26 +00:00
John Baldwin 7a08bae6ec - Move the setting of bootverbose to a MI SI_SUB_TUNABLES SYSINIT.
- Attach a writable sysctl to bootverbose (debug.bootverbose) so it can be
  toggled after boot.
- Move the printf of the version string to a SI_SUB_COPYRIGHT SYSINIT just
  afer the display of the copyright message instead of doing it by hand in
  three MD places.
2001-05-17 22:28:46 +00:00
John Baldwin 8b7fa31d30 Use NHWI instead of APIC_IMEN_BITS. 2001-05-17 22:24:46 +00:00
John Baldwin ddfbf9d259 - Axe the IMEN_BITS and APIC_IMEN_BITS constants.
- Add back in a definition of NHWI which is preferred over ICU_LEN.

Submitted by:	bde
2001-05-17 22:24:17 +00:00
Duncan Barclay 60453b06de Primary purpose of this commit is to enable support for the Aviator
Pro and Raylink cards with version 5 firmware. Only infra-structure
mode has been tested. Specific changes for this feature are:

        o Add RFC1042 encapsulation of IP datagrams

        o Add authentication and association

        o Decode of the beacon (although not used)

Other changes have been made:

        o Pass command completion status to *_done (in place for
          adding proper error recovery)

	o Move a couple of state variables into the current
	  network parameters structure. This is in prep. for
	  dealing with roaming.

MFC after:	1 week
2001-05-17 22:23:49 +00:00
John Baldwin 8107ed2eda Disable the wi driver locking for now. The driver tries to tsleep with the
driver lock held on detach which can lead to annoying and useless panics.
2001-05-17 22:20:54 +00:00
Robert Watson 6bd1912df4 o Modify access control checks in p_candebug() such that the policy is as
follows: the effective uid of p1 (subject) must equal the real, saved,
  and effective uids of p2 (object), p2 must not have undergone a
  credential downgrade.  A subject with appropriate privilege may override
  these protections.

  In the future, we will extend these checks to require that p1 effective
  group membership must be a superset of p2 effective group membership.

Obtained from:	TrustedBSD Project
2001-05-17 21:48:44 +00:00
Duncan Barclay d22e5c3d89 Add a couple more codes for upcoming raylink driver additions.
MFC after:	3 days
2001-05-17 21:37:41 +00:00
Alfred Perlstein 0fd061c0c4 Cleanup
Remove comment about setting error for reads on EOF, read returns 0 on
EOF so the code should be ok.

Remove non-effective priority boost, PRIO+1 doesn't do anything
(according to McKusick), if a real priority boost is needed it should
have been +4.

Style fixes:
.) return foo -> return (foo)
.) FLAG1|FlAG2 -> FLAG1 | FlAG2
.) wrap long lines
.) unwrap short lines
.) for(i=0;i=foo;i++) -> for (i = 0; i=foo; i++)
.) remove braces for some conditionals with a single statement
.) fix continuation lines.

md5 couldn't verify the binary because some code had to
be shuffled around to address the style issues.
2001-05-17 19:47:09 +00:00
Alfred Perlstein 2deb4a20c3 initialize pipe pointers 2001-05-17 18:22:58 +00:00
Alfred Perlstein 82a283fcf3 pipe_create has to zero out the select record earlier to avoid
returning a half-initialized pipe and causing pipeclose() to follow
a junk pointer.

Discovered by: "Nick S" <snicko@noid.org>
2001-05-17 17:59:28 +00:00
Ruslan Ermilov 268511689c Cosmetics to rev.1.89: removed argument names in a function prototype. 2001-05-17 17:57:35 +00:00
Bruce Evans 4b8db4a299 Backed out rev.1.8. Rev.1.8 was just to support a bogus unused include
in ng_tty.c.
2001-05-17 11:54:30 +00:00
Søren Schmidt 2c68839222 Update to use the changed ioctl interface. 2001-05-17 10:29:30 +00:00
Søren Schmidt ec0801f189 Change the ioctl interface to prepare for new functionality. 2001-05-17 10:28:59 +00:00
Kirk McKusick 24a83a4b3f When a new block is allocated to a directory, an fsync of a file
whose name is within that block must ensure not only that the block
containing the file name has been written, but also that the on-disk
directory inode references that block. When a new directory block
is created, we allocate a newdirblk structure which is linked to
the associated allocdirect (on its ad_newdirblk list). When the
allocdirect has been satisfied, the newdirblk structure is moved
to the inodedep id_bufwait list of its directory to await the inode
being written.  When the inode is written, the directory entries
are fully committed and can be deleted from their pagedep->id_pendinghd
and inodedep->id_pendinghd lists.
2001-05-17 07:24:03 +00:00
Boris Popov f3d1ec67b2 VOP getwritemount() can be invoked on vnodes with VFREE flag set (used in
snapshots code). At this point upper vp may not exist.
2001-05-17 04:58:25 +00:00
Boris Popov 3413421bda Use vop_*vobject() VOPs to get reference to VM object from upper or lower fs. 2001-05-17 04:52:57 +00:00
Boris Popov 9dbd7336ee Do not leave an extra reference on vnode.
PR:		kern/27250
Submitted by:	"Vladimir B. Grebenschikov" <vova@express.ru>
MFC after:	2 weeks
2001-05-17 04:40:01 +00:00
Daniel C. Sobral fa4fd1324a Allocate more memory if necessary. 2001-05-17 04:34:02 +00:00
Brian Somers ad24a43b1e digiModel_t -> enum digi_model
Remove a forgotton and unused structure.
2001-05-17 01:42:18 +00:00
David E. O'Brien 0dfc89c188 Consistently define the rune types.
Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
2001-05-16 22:32:44 +00:00
David E. O'Brien 1123bf8862 Move the int typedefs to the top so they can be used in defining other types.
Ensure every platform has __offsetof.
Make multiple inclusion detection consistent with other
  <platform>/include/*.h files.
2001-05-16 22:21:43 +00:00
Ian Dowse 0864ef1e8a Change the second argument of vflush() to an integer that specifies
the number of references on the filesystem root vnode to be both
expected and released. Many filesystems hold an extra reference on
the filesystem root vnode, which must be accounted for when
determining if the filesystem is busy and then released if it isn't
busy. The old `skipvp' approach required individual filesystem
xxx_unmount functions to re-implement much of vflush()'s logic to
deal with the root vnode.

All 9 filesystems that hold an extra reference on the root vnode
got the logic wrong in the case of forced unmounts, so `umount -f'
would always fail if there were any extra root vnode references.
Fix this issue centrally in vflush(), now that we can.

This commit also fixes a vnode reference leak in devfs, which could
result in idle devfs filesystems that refuse to unmount.

Reviewed by:	phk, bp
2001-05-16 18:04:37 +00:00
Warner Losh 367995aaa2 Catch up with some recent changes:
1) pcic_isa.c
	2) For pc98, add mecia driver and -DPC98 to command line.
	3) pcic_p.c -> pcic_pci.c
2001-05-16 07:35:54 +00:00
Warner Losh 5a695e4878 Separate out isa attachment to its own file. The pci attachment will
soon attach directly to pcic rather than the kludge pci-pcic device we
have now.

In some ways, this is similar to the work PAO3 did to try to support
cardbus bridges.  In some ways different.  This and future commits
will be taking from the spirit of many of those changes.  pcicvar.h is
completely different from the pcicvar.h that appeared in PAO3, but
similar in concept.
2001-05-16 07:32:04 +00:00
Warner Losh 6693a65f68 This file is now obsolete. The #defines in it have never been used
and the pcic_devclass no longer is used by pccard.c.
2001-05-16 06:14:51 +00:00
Alfred Perlstein a428c5ffef remove include of ipl.h because it no longer exists 2001-05-16 02:52:06 +00:00
John Baldwin f0ba29575d Lock the procfs functions for doing a single step and reading/writing
registers better.  Hold sched_lock not only for checking the flag but
also while performing the actual operation to ensure the process doesn't
get swapped out by another CPU while we the operation is being performed.
2001-05-16 00:47:27 +00:00
Warner Losh 3dce60fd35 pcic98reg.h is now contained in meciareg.h. 2001-05-15 23:53:18 +00:00
Warner Losh fae3b4e989 The mecia support has moved to the mecia driver, so remove the copy of
it here.
2001-05-15 23:50:58 +00:00
Warner Losh 0732016b23 Add mecia driver definitions. 2001-05-15 23:47:17 +00:00
Warner Losh 821257e1db This code touches MD code inappropriately. So we have to include pc98
specific file for pc98.
2001-05-15 23:43:02 +00:00
Warner Losh 54570134fe A new driver for the MECIA. This is the NEC Original PCMCIA
controller found in many of the early NOTE98 machines that were
produced.  This controller is completely unlike the intel 82365, so
I've separated it out from the main pcic driver.
2001-05-15 23:34:42 +00:00
John Baldwin dec54ac5b5 "Sir, the deorbit burn completed succesfully."
RIP {sys/machine}/ipl.h.
2001-05-15 23:30:37 +00:00
John Baldwin 8bd57f8fc2 Remove unneeded includes of sys/ipl.h and machine/ipl.h. 2001-05-15 23:22:29 +00:00
John Baldwin d58f6ddef7 Add a PROC_TRYLOCK() macro to perform a mtx_trylock() on the process lock. 2001-05-15 23:19:52 +00:00
John Baldwin f5d325c599 Remove unneeded includes in the i386 case. 2001-05-15 23:16:18 +00:00
John Baldwin 74fc745594 - Remove unneeded include of sys/ipl.h.
- Lock the process before calling killproc() to kill it for exceeding the
  maximum CPU limit.
2001-05-15 23:15:06 +00:00
John Baldwin 9081e5e826 - Remove unneeded include of sys/ipl.h.
- Require the proc lock be held for killproc() to allow for the vmdaemon to
  kill a process when memory is exhausted while holding the lock of the
  process to kill.
2001-05-15 23:13:58 +00:00
John Baldwin 4966b0e91c Move the definition of HWI_MASK to the i386/isa/icu.h header right next to
the definition of ICU_LEN.
2001-05-15 23:11:48 +00:00
John Baldwin d008c720b6 - Use ICU_LEN rather than NHWI for the size of the array of ithreads.
- Remove unneeded include of sys/ipl.h.
2001-05-15 22:31:08 +00:00
John Baldwin c96d52a913 - Use PROC_LOCK_ASSERT instead of a direct mtx_assert.
- Don't hold Giant in the swapper daemon while we walk the list of
  processes looking for a process to swap back in.
- Don't bother grabbing the sched_lock while checking a process' sleep
  time in swapout_procs() to ensure that a process has been idle for at
  least swap_idle_threshold2 before swapping it out.  If we lose the race
  we just let a process stay in memory until the next call of
  swapout_procs().
- Remove some unneeded spl's, sched_lock does all the locking needed in
  this case.
2001-05-15 22:20:44 +00:00
Bill Paul 065a7922df Fix instance of (struct ti_softc *) that should have been
(struct nge_softc *), which the compiler never complained about.
I guess it doesn't matter, a pointer is a pointer, but looked weird
to me.
2001-05-15 22:19:50 +00:00
John Baldwin 87fae0c142 Include sys/lock.h and sys/mutex.h so that this compiles. 2001-05-15 22:02:46 +00:00
Bill Paul ddde4ea967 Adjust the descriptor structures a little by making the software parts
be unions with enough padding to make sure they always end up being
a multiple of 8 bytes in size, since the 83820/83821 chips require
descriptors to be aligned on 64-bit boundaries. I happened to get it
right for the 32-bit descriptor/x86 case, but botched everything else.
Things should work properle on 32-bit/64-bit platforms now.

Note that the 64-bit descriptor format isn't being used currently.
2001-05-15 21:42:43 +00:00
George C A Reid 94d79d6dea Remove a bogus comment which I forgot to get rid of after testing 2001-05-15 20:05:19 +00:00
Justin T. Gibbs 58fb7d8e0b ahc_eisa.c:
ahc_pci.c:
	Prepare for making ahc a module by adding module dependency
	and version info.

aic7770.c:
	Remove linux header ifdefs.  The headers are handled differently
	in Linux where local includes (those using "'s instead of <>'s)
	are allowed.

	Don't map our interrupt until after we are fully setup to
	handle interrupts.  Our interrupt line may be shared so
	an interrupt could occur at any time.

aic7xxx.c:
	Remove linux header ifdefs.

	current->curr to avoid Linux's use of current as a
	#define for the current task on some architectures.

	Add a helper function, ahc_assert_atn(), for use in
	message phases we handle manually.  This hides the fact
	that U160 chips with the expected phase matching disabled
	need to have SCSISIGO updated differently.

	if (ahc_check_residual(scb) != 0)
		ahc_calc_residual(scb);
	else
		ahc_set_residual(scb, 0);

       	becomes:

	ahc_update_residual(scb);

	Modify scsi parity error (or CRC error) handling to
	reflect expected phase being disabled on U160 chips.

	Move SELTO handling above BUSFREE handling so we can
	use the new busfree interrupt behavior on U160 chips.

	In ahc_build_transfer_msg() filter the period and ppr_options
	prior to deciding whether a PPR message is required.
	ppr_options may be forced to zero which will effect our
	decision.

	Correct a long standing but latent bug in ahc_find_syncrate().
	We could choose a DT only rate even though DT transfers were
	disabled.  In the CAM environment this was unlikely as CAM
	filters our rate to a non-DT value if the device does not
	support such rates.

	When displaing controller characteristics, include the
	speed of the chip.  This way we can modify the transfer
	speed based on optional features that are enabled/disabled
	in a particular application.

	Add support for switching from fully blown tagged queing
	to just using simple queue tags should the device reject
	an ordered tag.

	Remove per-target "current" disconnect and tag queuing
	enable flags.  These should be per-device and are not
	referenced internally be the driver, so we let the OSM
	track this state if it needs to.

	Use SCSI-3 message terminology.

aic7xxx.h:
	The real 7850 does not support Ultra modes, but there are
	several cards that use the generic 7850 PCI ID even though
	they are using an Ultra capable chip (7859/7860).  We start
	out with the AHC_ULTRA feature set and then check the
	DEVSTATUS register to determine if the capability is really
	present.

	current -> curr

	ahc_calc_residual() is no longer static allowing it to
	be called from ahc_update_residual() in aic7xxx_inline.h.

	Update some serial eeprom definitions for the latest
	BIOS versions.

aic7xxx.reg:
	Add a combined DATA_PHASE mask to the SCSIPHASE register
	definition to simplify some sequencer code.

aic7xxx.seq:
	Take advantage of some performance features available only
	on the U160 chips.  The auto-ack feature allows us to ack
	data-in phases up to the data-fifo size while the sequencer
	is still setting up the DMA engine.  This greatly reduces
	read transfer latency and simplifies testing for transfer
	complete (check SCSIEN only).  We also disable the expected
	phase feature, and enable the new bus free interrupt behavior,
	to avoid a few instructions.

	Re-arrange the Ultra2+ data phase handling to allow us to
	do more work in parallel with the data fifo flushing on a
	read.

	On an SDTR, ack the message immediately so the target can
	prepare the next phase or message byte in parallel with
	our work to honor the message.

aic7xxx_93cx6.c:
	Remove linux header ifdefs.

aic7xxx_freebsd.c:
	current -> curr

	Add a module event handler.

	Handle tag downgrades in our ahc_send_async() handler.
	We won't be able to downgrade to "basic queuing" until
	CAM is made aware of this queuing type.

aic7xxx_freebsd.h:
	Include cleanups.

	Define offsetof if required.

	Correct a few comments.

	Update prototype of ahc_send_async().

aic7xxx_inline.h:
	Implement ahc_update_residual().

aic7xxx_pci.c:
	Remove linux header ifdefs.

	Correct a few product strings.

	Enable several U160 performance enhancing features.

	Modify Ultra capability determination so we will enable
	Ultra speeds on devices with a 7850 PCI id that happen
	to really be a 7859 or 7860.

	Don't map our interrupt until after we are fully setup to
	handle interrupts.  Our interrupt line may be shared so
	an interrupt could occur at any time.
2001-05-15 19:41:12 +00:00
Jonathan Lemon dedabebf33 Use " |= " to enable special media handling for fxp with no MII, instead
of " &= ".  Also change the MII PHY device mask to check the correct bits.

Cookie to:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Pointy hat to:	me
2001-05-15 18:52:40 +00:00
Brian Somers eeee064735 Support /dev/ctty again
Submitted by:	peter
2001-05-15 18:12:38 +00:00
Seigo Tanimura 1b36970495 Back out scanning file descriptors with holding a process lock.
selrecord() requires allproc sx in pfind(), resulting in lock order
reversal between allproc and a process lock.
2001-05-15 10:19:57 +00:00
KATO Takenori 31cf5cec8b Merged from sys/isa/fd.c revision 1.197. 2001-05-15 08:55:30 +00:00
KATO Takenori 55ffce7e4f Merged from sys/i386/i386/machdep.c revision 1.450. 2001-05-15 08:32:01 +00:00
Warner Losh ca4d6d4f8c {G,S}ET_UNIT are now unused, gc them 2001-05-15 03:32:45 +00:00
Warner Losh f81f90ff95 It turns out that pcic_slot::slotnum was really unused, so don't set
it.
2001-05-14 23:14:23 +00:00
Warner Losh 12d6689ccd Remove static array of slots. We now have state information for each
slot in a softc for each unit that we probe.  Also remove validunits
static, since it is no longer necessary.
2001-05-14 23:08:58 +00:00
Warner Losh 07e0ca29b5 Fix the so called "static bug" in polling mode. Some desktop cards
have bad grounding characteristics which allow small static discharges
(or sunspots, we're not 100% sure which) to reach the bridge chip.
This causes the bridge chip to wedge/reset itself.  There's no known
cure short of rebooting.

The bug manifests itself by the STAT_CHG return 0xff when read.  This
is impossible because the upper bits are reserved (and therefore
zero).  In addition, some of the lower bits are one only for memory
cards, which OLDCARD doesn't support, so if they are set, something
seriously foobar'd is going on.

So far we've seen this in exactly one brand of pcmcia <-> isa bridge
which plug and play identifies only as "VIA PCMCIA CARD".  This card
just has buffers on the isa card and the actual bridge chip on the
remote slot, which is connected by long ribbon cables.  We think this
long cable run, coupled with the lack of coupling capacitors is a
major reason why it is so static sensitive while its bretheren aren't.

Work Supported by: Timing Solutions, Inc.

MFC After: 3 days
2001-05-14 21:08:20 +00:00
Joerg Wunsch 2995d1100c Implement a few more floppy ioctl commands and IO options, namely:
. FD_CLRERR clears the error counter, thus re-enables kernel error
  printf()s,

. FD_GSTAT obtains the last FDC operation state, if any,

. FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy
  error logging,

. FDOPT_NOERROR makes the kernel ignore an FDC error, thus can
  enable the transfer of an erroneous sector to the user application

All options are being cleared on (last) close.

Prime consumer of the last features will be fdread(1), to be committed
shortly.

(FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8)
needs a major rewrite anyway.)
2001-05-14 20:20:11 +00:00
Bill Paul 11c2ec4153 Close PR 22208: bring chip out of suspend mode, because Windows might
have put the chip to sleep at shutdown. This is really only for the
VT6102, but it doesn't hurt the older chips.
2001-05-14 19:13:02 +00:00
Søren Schmidt ef9988d058 Add support for the AMD 766 southbridge incl ATA100 support
Fix ATA66 mode for the AMD756, the timing was way to slow
2001-05-14 18:38:22 +00:00
Kirk McKusick 7389126d9a Further fixes for deadlock in the presence of multiple snapshots.
There are still more to find, but this fix should cover the
common cases that folks are hitting.
2001-05-14 17:16:49 +00:00
Jonathan Lemon 97f6754ff1 When calling poll() on a fd associated with a filesystem, let POLLIN/POLLOUT
behave identically to POLLRDNORM/POLLWRNORM.

Submitted by: bde
PR: 27287
merge after: 1 week
2001-05-14 14:37:25 +00:00
Poul-Henning Kamp 241e77c8a5 Use the new ability to avoid practically all the gunk in this file.
When people access /dev/tty, locate their controlling tty and return
the dev_t of it to them.  This basically makes /dev/tty act like
a variant symlink sort of thing which is much simpler than all the
mucking about with vnodes.
2001-05-14 08:22:56 +00:00
Poul-Henning Kamp f73cbde4cf After a successfull poll of the cloning functions, match on the
returned dev_t rather than the original name.

This allows cloning from one name to another which is useful for
/dev/tty and later for the pty's.
2001-05-14 08:20:46 +00:00
Warner Losh 510937db3c Minor style(9) changes:
return (VALUE);
2001-05-14 06:15:24 +00:00
Warner Losh 09536319d6 Take a stab at making this less dependent on having pcic as a parent.
For memory for the pccard attribute/common memory mapping allocate on
the pccard.  For other allocations, use whatever is the parent of this
device.  There's no doubt other issues lurking, but this should make
things closer to being independent.
2001-05-14 06:04:29 +00:00
Warner Losh 9058c0858a Change machdep.pccard.pcic_mem_{start,end} to machdep.pccard.mem_{start,end}
since they have nothing to do with pcic and it makes grepping for pcic
infection in pccard harder.

MFC after:	3 days
2001-05-14 05:56:12 +00:00
Seigo Tanimura 265fc98f36 - Convert msleep(9) in select(2) and poll(2) to cv_*wait*(9).
- Since polling should not involve sleeping, keep holding a
  process lock upon scanning file descriptors.

- Hold a reference to every file descriptor prior to entering
  polling loop in order to avoid lock order reversal between
  lockmgr and p_mtx upon calling fdrop() in fo_poll().
  (NOTE: this work has not been done for netncp and netsmb
  yet because a socket itself has no reference counts.)

Reviewed by:	jhb
2001-05-14 05:26:48 +00:00
Warner Losh 3ad72a92eb When activating or deactivating a resource, only attempt to deal with
the resource activation if we're dealing with our grandchild.
Otherwise, we run into two problems.  One, if the pccard layer wanted
to allocate and activate something, we'd wind up trying to do the
wrong thing twice: the ivars are wrong and we don't want the bridge to
map the resource to the slot.  If we're more than a grandchild, then
who knows what kind of ivar is present.  In either of these cases, we
just pass it up the food chain.
2001-05-14 04:53:02 +00:00
Kirk McKusick 0b04113700 If the effective link count is zero when an NFS file handle request
comes in for it, the file is really gone, so return ESTALE.

The problem arises when the last reference to an FFS file is
released because soft-updates may delay the actual freeing of the
inode for some time. Since there are no filesystem links or open
file descriptors referencing the inode, from the point of view of
the system, the file is inaccessible. However, if the filesystem
is NFS exported, then the remote client can still access the inode
via ufs_fhtovp() until the inode really goes away. To prevent this
anomoly, it is necessary to begin returning ESTALE at the same time
that the file ceases to be accessible to the local filesystem.

Obtained from:	Ian Dowse <iedowse@maths.tcd.ie>
2001-05-13 23:30:45 +00:00
Poul-Henning Kamp ab9f3b292e Convert DEVFS from an "opt-in" to an "opt-out" option.
If for some reason DEVFS is undesired, the "NODEVFS" option is
needed now.

Pending any significant issues, DEVFS will be made mandatory in
-current on july 1st so that we can start reaping the full
benefits of having it.
2001-05-13 20:52:40 +00:00
Bruce Evans a4b8c657a3 Use a critical region to protect pushing of the parent's npx state to the
pcb for fork().  It was possible for the state to be saved twice when an
interrupt handler saved it concurrently.  This corrupted (reset) the state
because fnsave has the (in)convenient side effect of doing an implicit
fninit.  Mundane null pointer bugs were not possible, because we save to
an "arbitrary" process's pcb and not to the "right" place (npxproc).

Push the parent's %gs to the pcb for fork().  Changes to %gs before
fork() were not preserved in the child unless an accidental context
switch did the pushing.  Updated the list of pcb contents which is
supposed to inhibit bugs like this.  pcb_dr*, pcb_gs and pcb_ext were
missing.  Copying is correct for pcb_dr*, and pcb_ext is already
handled specially (although XXX'ly).

Reducing the savectx() call to an npxsave() call in rev.1.80 was a
mistake.  The above bugs are duplicated in many places, including in
savectx() itself.

The arbitraryness of the parent process pointer for the fork()
subroutines, the pcb pointer for savectx(), and the save87 pointer
for npxsave(), is illusory.  These functions don't work "right" unless
the pointers are precisely curproc, curpcb, and the address of npxproc's
save87 area, respectively, although the special context in which they
are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy)
to work.  cpu_fork() just doesn't work unless the parent process
pointer is curproc, or the caller has pushed %gs to the pcb, or %gs
happens to already be in the pcb.
2001-05-13 07:44:14 +00:00
Jonathan Lemon db1e093307 Remove safety belt that checks for miibus in the config file. This
was only intended for -stable, not -current.
2001-05-13 05:38:59 +00:00
Warner Losh 180c9afb62 Return errors for unsupported operations on pcic_get_res_flags rather
than 0.
2001-05-13 04:44:45 +00:00
Warner Losh 87c53da12e Change #ifdef PC98 to #ifdef MECIA_SUPPORT and define MECIA_SUPPORT
when PC98 is defined.  This is in perparation for a mecia driver
separate from pcic, assuming that all goes well with that effort.
MECIA_SUPPORT won't be removed until after that support is working.
2001-05-13 04:16:09 +00:00
Warner Losh e7c00509d5 I'll be making some rather substantial changes to the pci attachment
of the pcic class of devices.  Go ahead and move it to the "usual"
place.  I say "usual" in quotes since it isn't exactly right (not in
dev/blah), but it is closer than before.
2001-05-13 01:52:55 +00:00
Warner Losh 804e80065b o Get rid of static array of slots in pccard layer. Move this to the
softc.
o Store pointers to softc in dev_t in si_drv1.
o Change 'kludge version' to 'classic version' since things are getting less
  kludgy.
o Minor code shuffling so that we probe and attach the pccard slots.
o Minor style(9) changes.
2001-05-13 01:44:27 +00:00
Jonathan Lemon 336f51412c Update makefile to reflect vlan support. 2001-05-13 00:04:02 +00:00
Jonathan Lemon e8c8b728c7 Add few cosmetic style fixes, and some debug information for SCB timeouts.
Add VLAN support, obtained from Pedro J. Lobo (through Mike Tancsa).
2001-05-13 00:03:39 +00:00
Jonathan Lemon e310a419c0 Add a few more register definitions. 2001-05-12 23:59:48 +00:00
Daniel Eischen 10c90bba3b Revert part of last commit. Instead of using %fs for KSD/TSD, we'll
follow Linux' convention and use %gs.  This adds back the setting of
%fs to a sane value in sendsig().  The value of %gs remains preserved
to whatever it was in user context.
2001-05-12 22:54:53 +00:00
Bill Paul 5da751e46c Unbreak release. *sigh* 2001-05-12 19:51:40 +00:00
Warner Losh f6056f14ec Th -> The in a comment 2001-05-12 06:04:02 +00:00
Daniel Eischen b85c313a62 Preserve the state of the %gs register when setting up the signal
handler in Linux emulation.  According to bde, this is what Linux
does.

Recent versions of linuxthreads use %gs for thread-specific data,
while FreeBSD uses %fs (mostly because WINE uses %gs).

Tested by: drew
2001-05-12 03:23:10 +00:00
John Baldwin 1efb92b7ca Simplify the vm fault trap handling code a bit by using if-else instead of
duplicating code in the then case and then using a goto to jump around
the else case.
2001-05-11 23:50:08 +00:00
John Baldwin b012b205a7 GC prototype for procfs_bmap() missed during a previous commit. 2001-05-11 23:37:37 +00:00
John Baldwin dd094a2d17 Simply the vm fault trap handling code a bit by using if-else instead of
duplicating code in the then case and then using a goto to jump around
the else case.
2001-05-11 23:17:54 +00:00
John Baldwin 87e2d38376 Allow sendsig() to hand the proc lock off to osendsig() rather than having
sendsig() release the lock just so it can call osendsig() and have
osendsig() acquire the lock.
2001-05-11 23:17:05 +00:00
John Baldwin b88cd712a7 Add a new macro to test if a process' proc lock is held by the current
thread: PROC_LOCKED().
2001-05-11 21:28:37 +00:00
Bill Paul e39cd3b251 It's vlan.h, not opt_vlan.h. 2001-05-11 20:55:31 +00:00
Ian Dowse 1feb7a6efa In vrele() and vput(), avoid triggering the confusing "missed vn_close"
KASSERT when vp->v_usecount is zero or negative. In this case, the
"v*: negative ref cnt" panic that follows is much more appropriate.

Reviewed by:	mckusick
2001-05-11 20:42:41 +00:00
Jonathan Lemon fae4825cdf Regenerate. 2001-05-11 20:41:20 +00:00
Jonathan Lemon dafdd7777b Correctly recognize the i82562{EM} PHYs.
Obtained from: OpenBSD
2001-05-11 20:34:38 +00:00
Bill Paul b680c0ae8b Regenerate 2001-05-11 20:27:39 +00:00
John Baldwin 9e5620599e Check witness_dead in more functions to avoid panic'ing when assertions
fail due to witness exhausting its internal resources and shutting down.

Reported by:	Szilveszter Adam <sziszi@petra.hos.u-szeged.hu>
Tested by:	David Wolfskill <david@catwhisker.org>
2001-05-11 20:25:29 +00:00
Bill Paul 84b86890ae Disable the 'stats counter overflow' interrupts since they can happen
much more often that expected and negatively impact performance when
running at 100mbps. I need to figure out if there's a better way to
handle this, but for now this shouldn't hurt anything.
2001-05-11 20:15:41 +00:00
Bill Paul ce4946daa5 Add support for gigabit ethernet cards based on the NatSemi DP83820
and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000
copper PHY. There are a whole bunch of very low cost cards available with
this chipset selling for $150USD or less. This includes the SMC9462TX,
D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards
from Addtron.

This chip supports TCP/IP checksum offload, VLAN tagging/insertion.
2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs.
I have not done serious performance testing with this driver. I know
it works, and I want it under CVS control so I can keep tabs on it.
Note that there's no serious mutex stuff in here yet either: I need
to talk more with jhb to figure out the right way to do this. That
said, I don't think there will be any problems.

This driver should also work on the alpha. It's not turned on in
GENERIC.
2001-05-11 19:56:39 +00:00
Tor Egge dd1c45f3ca Regenerate. 2001-05-11 17:05:47 +00:00
Tor Egge b4b469e6bb gettimeofday() is MP safe on both -current and -stable. 2001-05-11 17:05:12 +00:00
Ruslan Ermilov 9185426827 In in_ifadown(), differentiate between whether the interface goes
down or interface address is deleted.  Only delete static routes
in the latter case.

Reported by:	Alexander Leidinger <Alexander@leidinger.net>
2001-05-11 14:37:34 +00:00
Kirk McKusick 9b35c30cf7 Remove yet another deadlock case. 2001-05-11 07:12:03 +00:00
Greg Lehey e6d1172096 Fix world-breaking typo in previous commit. 2001-05-11 07:06:06 +00:00
Mike Smith 85fab96387 Un-swap irq/link byte values so that printf works. 2001-05-11 04:52:29 +00:00
John Baldwin f2909e6cd8 Trim lots of stuff that is now in MI code along with MD alpha code. 2001-05-10 17:58:35 +00:00
John Baldwin ba228f6d96 - Split out the support for per-CPU data from the SMP code. UP kernels
have per-CPU data and gdb on the i386 at least needs access to it.
- Clean up includes in kern_idle.c and subr_smp.c.

Reviewed by:	jake
2001-05-10 17:45:49 +00:00
Bill Paul d639723b88 Try to read the station address twice during the probe. I've seen
a LinkSys card here in the office where reading the station address
fails the first time, but works find afterwards. Without this, the
probe fails. I don't think this will negatively impact any existing
cards, but I want to confirm this before MFC'ing.
2001-05-10 17:17:24 +00:00
John Baldwin df4d012b9a - Use sched_lock and critical regions to ensure that LDT updates are thread
safe from preemption and concurrent access to the LDT.
- Move the prototype for i386_extend_pcb() to <machine/pcb_ext.h>.

Reviewed by:	silence on -hackers
2001-05-10 17:03:03 +00:00
Matt Jacob 5532b9f61e The new order of things is that dwlpxN is now called pcibN- so hack around
*that* whilst we ponder the best way to decide how to register dwlpx interrupts
with TLSB.
2001-05-10 07:08:03 +00:00
Warner Losh f40d7afa05 Fix the panics for real this time. When something can't be allocated,
we need to delete the info from the list as well as zero out the res
pointer we saved in the code.

Also made a few style(9) changes while I was at it.  Don't use if
(ptr) or if (!ptr), but compare against NULL.  Compare against NULL
rather than 0.  Don't have useless blocks.

There are likely other problems as well, but at least the wi based
wireless card with memory listed in its cis doesn't panic the system
when the card is inserted.
2001-05-10 06:55:39 +00:00
Matt Jacob fd5fcd7c1a add alpha_pci_route_interrupt method 2001-05-10 06:52:56 +00:00
Matt Jacob d18bc19f87 Quick hack to reintroduce the notion that there might be alpha platforms
without an i8254 timer/counter. This really needs to be cleaned up.
2001-05-10 05:23:58 +00:00
Daniel C. Sobral ec10295143 FICL 2.05 has a flawed definition of BASE. Fix it.
Spotted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-05-10 05:13:09 +00:00
John Baldwin 221897cddb Include sys/lock.h for witness_list_locks() and axe unneeded sys/mutex.h
include.
2001-05-09 22:08:28 +00:00
John Baldwin 0142c72785 Add in commented out entries for NEWCARD so that they are at least
documented.  They cannot be turned on by default due to conflicting
symbols at link time between OLDCARD and NEWCARD.

Approved by:	imp
2001-05-09 19:37:25 +00:00
Bill Paul 68e691b2ab The sk driver developed a bug when the multicast code was changed to
use TAILQ macros. The sk_attach_xmac() routine calls sk_init_xmac()
before doing the transceiver probe, but *before* ether_ifattach()
is called. This causes sk_init_xmac() to call sk_setmulti(), which
tries to do a TAILQ_FOREACH(), which it can't do because ether_ifattach()
hasn't done a TAILQ_INIT() yet. This causes a NULL pointer dereference
and panic in sk_setmulti() at driver load/initialization time.

Fixed by calling ether_ifattach() before the MII probe.

The code in RELENG_4 still uses the old way of enumerating the
multicast list and doesn't have this problem. Yet.
2001-05-09 18:22:42 +00:00
John Baldwin 28a24ae515 Add include of sys/mutex.h and resort include of sys/lock.h. 2001-05-09 16:56:48 +00:00
John Baldwin d90b453427 Add needed sys/lock.h include. 2001-05-09 16:55:59 +00:00
Søren Schmidt 63e45b51b0 Remove the error var, it hides the real one.
PR 27213.

BTW the CDIOCREADAUDIO ioctl is deprecated, its not longer needed
and was an ugly hack from start on.
2001-05-09 13:01:10 +00:00
Dag-Erling Smørgrav ee72cb740e Avoid overflow when converting ticks to jiffies.
PR:		27215
Submitted by:	Jim Pirzyk <Jim.Pirzyk@disney.com>
2001-05-09 11:41:54 +00:00
Duncan Barclay 3f36f543ff Eliminate some panics for errors we can recover from.
Reduce the verbose memory map setup reports and work with pccardd to
set the common memory map up.

Use enumeration values for CARD_SET_RES_FLAGS.

Use DELAY when spinning waiting for the card to come free instead of a loop.

MFC:	after 1 week
2001-05-09 00:03:19 +00:00
Duncan Barclay 7b8ec2c952 Use enumeration values for CARD_SET_RES_FLAGS.
Remove panic on out of range io window and return ENXIO. Add a similar
check for memory windows.

Approved by:	imp
2001-05-08 23:59:13 +00:00
Duncan Barclay 1fcaa98da5 Use enumeration types for CARD_SET_RES_FLAGS.
Approved by:	imp
2001-05-08 23:57:32 +00:00
Duncan Barclay 0a177c3dca Add additional enumeration types for CARD_SET_RES_FLAGS.
Approved by:	imp
MFC:	after 1 week
2001-05-08 23:56:47 +00:00
Duncan Barclay a31957707a Add a sysctl pair for the pcic memory allocation range
machdep.pccard.pcic_mem_start
	machdep.pccard.pcic_mem_end
and default the range to IOM_BEGIN/IOM_END.

This may prove useful to if_ray users (and others) on more modern
hardware that maps BIOS stuff into 0xd000-0xdffff.

MFC: after 1 week

Approved by:	imp
2001-05-08 22:51:05 +00:00
Seigo Tanimura 9d68b59376 - Eliminate locks in functions called only during probe and attach.
- Finish transmitting data to mpu when a buffer gets empty.

Submitted by:	KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
2001-05-08 12:15:26 +00:00
Poul-Henning Kamp 724682d233 Polish error handling with biofinish(). 2001-05-08 09:10:27 +00:00
Poul-Henning Kamp d4e6d409ca Polish error handling code using biofinish() 2001-05-08 09:09:32 +00:00
Alfred Perlstein 97d4578662 Remove an 'optimization' I hope to never see again.
The pipe code could not handle running out of kva, it would panic
if that happened.  Instead return ENFILE to the application which
is an acceptable error return from pipe(2).

There was some slightly tricky things that needed to be worked on,
namely that the pipe code can 'realloc' the size of the buffer if
it detects that the pipe could use a bit more room.  However if it
failed the reallocation it could not cope and would panic.  Fix
this by attempting to grow the pipe while holding onto our old
resources.  If all goes well free the old resources and use the
new ones, otherwise continue to use the smaller buffer already
allocated.

While I'm here add a few blank lines for style(9) and remove
'register'.
2001-05-08 09:09:18 +00:00
Poul-Henning Kamp b63170f870 Exploit recent improvements in the disk minilayer to simplify error
handling a bit.

Dogmatic lingupurists can celebrate that a number of gotos got removed.

Reviewed by:	mjacob, ken
2001-05-08 08:30:48 +00:00
Poul-Henning Kamp e0e0b6610e Always initialize bio_resid from bio_bcount in the disk mini-layer so
that the drivers don't have to do it umpteen times.
2001-05-08 08:24:54 +00:00
Brian Somers f80704eff1 Remove all the mutex stuff - suggested by jhb
Tidy up includes, credit Slawa Olhovchenkov, John Prince and Eric Hernes
for their efforts and add a couple of missing parenthesis around return
expressions.
2001-05-08 07:55:33 +00:00
Kirk McKusick 9ccb939ef0 When running with soft updates, track the number of blocks and files
that are committed to being freed and reflect these blocks in the
counts returned by statfs (and thus also by the `df' command). This
change allows programs such as those that do news expiration to
know when to stop if they are trying to create a certain percentage
of free space. Note that this change does not solve the much harder
problem of making this to-be-freed space available to applications
that want it (thus on a nearly full filesystem, you may still
encounter out-of-space conditions even though the free space will
show up eventually). Hopefully this harder problem will be the
subject of a future enhancement.
2001-05-08 07:42:20 +00:00
Kirk McKusick 27b047acf0 Several fixes for units errors:
1) Do not assume that the superblock will be of size fs->fs_bsize.
   This fixes a panic when taking a snapshot on a filesystem with
   a block size bigger than 8K.
2) Properly calculate the number of fragments that follow the
   superblock summary information. This fixes a bug with inconsistent
   snapshots.
3) When cleaning up a snapshot that is about to be removed, properly
   calculate the number of blocks that need to be checked. This fixes
   a bug that created partially allocated inodes.
4) When moving blocks from a snapshot that is about to be removed
   to another snapshot, properly account for the reduced number of
   blocks in the snapshot from which they are taken. This fixes a
   bug in which the number of blocks released from a snapshot did not
   match the number that it claimed to have.
2001-05-08 07:29:03 +00:00
Kirk McKusick 0c6fbff0a5 When syncing out snapshot metadata, we must temporarily allow recursive
buffer locking so as to avoid locking against ourselves if we need to
write filesystem metadata.
2001-05-08 07:13:00 +00:00
Warner Losh 84b00588d8 Ricoh RL5C46x cardbus bridges have the bits for 3E0 and 3E2. The
RL5C47x cards do not.  Only set them for that set of bridges.

Submitted by: shiba (Takeshi Shibagaki-san)
2001-05-08 02:28:41 +00:00
Warner Losh bccfae2270 Add some additional register definitions for some work I have in progress. 2001-05-08 02:06:03 +00:00
Brian Somers 3db1f8d59a sys/mutex.h requires sys/lock.h for LINT
Re-spotted by: phk
2001-05-07 23:52:08 +00:00
Warner Losh bc5797c7de Set the slot pointer in the pc98 case. Correct the name of the bridge
chip to the one that the Japanese use.  Now we get insert/remove
events on my PC-9821Ne.  More work in bus space is needed to make
drivers work.

MFC after: 3 days
2001-05-07 22:28:05 +00:00
Mike Smith 282070b3e8 Minor updates:
- Rework of twe_report_request to use the command status value rather
   than the flags register. (Joel Jacobson @ 3ware)
 - Update to match some changes in -current vs. stable.

MFC in: 1 week
2001-05-07 21:46:44 +00:00
Akinori MUSHA 3b26be6ae1 Properly copy the P_ALTSTACK flag in struct proc::p_flag to the child
process on fork(2).

It is the supposed behavior stated in the manpage of sigaction(2), and
Solaris, NetBSD and FreeBSD 3-STABLE correctly do so.

The previous fix against libc_r/uthread/uthread_fork.c fixed the
problem only for the programs linked with libc_r, so back it out and
fix fork(2) itself to help those not linked with libc_r as well.

PR:		kern/26705
Submitted by:	KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
Tested by:	knu, GOTOU Yuuzou <gotoyuzo@notwork.org>,
		and some other people
Not objected by:	hackers
MFC in:		3 days
2001-05-07 18:07:29 +00:00
Warner Losh a66173abd2 Disable the card after sending the removed event up to the pccard
layer.  This fixes an ordering problem that would cause the ISR for
the device to run with now power applied to the device.  Most cards
failed to deal with this gracefully, and thus would hang on card
eject.

The power down event, for those keeping score, is what causes the
interrupt for the card.

Many folks in the Japanese nomads list have reported this, so I'll be
MFCing quickly for their benefit.

Submitted by: Masayuki FUKUI
MFC after: 2 days
2001-05-07 16:50:34 +00:00