Commit Graph

39654 Commits

Author SHA1 Message Date
Alan Cox
01dfc1deae Finish the vm_object locking for this file, including holding the vm_object
lock when accessing the vm_object's flags or calling vm_page_lookup().
2003-04-28 05:40:45 +00:00
Alan Cox
ed6a786313 - Define VM_OBJECT_LOCK_INIT().
- Avoid repeatedly mtx_init()ing and mtx_destroy()ing the vm_object's lock
   using UMA's uminit callback, in this case, vm_object_zinit().
2003-04-28 03:45:35 +00:00
Hidetoshi Shimokawa
70b400a813 Make compiled on RELEGN_4 2003-04-28 03:12:16 +00:00
Warner Losh
c14b840a2b Initialize error. 2003-04-27 23:44:05 +00:00
Nate Lawson
edae7ea680 SCSI Quirks for:
Casio QV-R3 USB camera, which appears to use a Pentax chipset
    M-Systems DiskOnKey USB flash key
    Feiya "slider" dual-slot flash reader
    SmartDisk (Mitsumi) USB floppy drive

PR:		kern/46545, kern/47793, kern/50020, kern/50226
2003-04-27 20:47:06 +00:00
Alan Cox
c9917419ef - Tell witness that holding two or more vm_object locks is okay.
- In vm_object_deallocate(), lock the child when removing the parent
   from the child's shadow list.
2003-04-27 20:07:57 +00:00
Warner Losh
a4da74c1d9 Make 2/3 of my symbol cards work again. The 3rd symbol card card has
firmware 1.50.12, but 2.20.1 and 3.10.4 work.  The 1.50.12 card gets
past doing dhclient, but hangs on transmit a little after the ip
address is set.  The 1.50.12 card has always been 'cranky' and Bill
Paul's tearing it apart at FreeBSD '99 hasn't helped.

sc_reset and sc_enable are subtlely different things.  sc_reset means
exactly "WI_CMD_INI has happened."  sc_enabled means "WI_CMD_ENABLE
has been sent to the card without a WI_CMD_DISABLE following."  This
is a little different than what they mean on NetBSD (where both of
these concepts are comingled).  NetBSD will try to only enable symbol
cards once, while FreeBSD only sends the WI_CMD_INI once.

Also, only try once to reset the card on a symbol.

This makes the lucent cards no worse than before, but apparently not
much better either.  I got fewer hangs in my testing than I have in
the past, but I don't know if it is statistically significant or not.
2003-04-27 15:56:05 +00:00
Alan Cox
570a2f4ac5 Various changes to vm_object_shadow(): (1) update the vm_object locking,
(2) remove a pointless assertion, and (3) make a trivial change to a
comment.
2003-04-27 05:43:03 +00:00
Warner Losh
02aa843a15 Update to reflect tw removal.
Approved by: re@ (scottl)
2003-04-27 05:40:53 +00:00
Warner Losh
1ba3f9e2da Update to reflect tw removal. 2003-04-27 05:35:10 +00:00
Warner Losh
5899148189 After careful review of this driver, I'm pretty sure it would take a
lot of work to make this driver work under current.  In the past when
people wanted to remove xten, I was the only one in the way.  After
talking to fsmp@ (last person to make real changes to this driver)
about this, I'm convinced it is better left in the dust-bin of history

Approved by: re@ (scottl)
2003-04-27 05:30:52 +00:00
David Xu
5073e68fa3 unlock sched_lock at right time. 2003-04-27 04:32:40 +00:00
Sam Leffler
5adbdf5429 recognize the Sun Crypto 5821 and Crypto 1K cards;
they both use the Broadcom 5821

Submitted by:	Panagiotis Astithas
MFC after:	1 day
2003-04-27 04:26:22 +00:00
Warner Losh
7110005e4b Add generic OEM1 PRISM3 card.
Submitted by: mwlucas
2003-04-27 03:34:05 +00:00
Warner Losh
103cef9fdd Sync to 1.50 2003-04-27 03:32:09 +00:00
Warner Losh
0cb2efde14 Mystery OEM #1: A really no-name prism3 card that wi supports.
Submitted by: mwlucas
2003-04-27 03:31:47 +00:00
Jake Burkholder
06c31b7a89 Remove some debug options that are no longer needed. 2003-04-27 01:52:32 +00:00
Warner Losh
914beb056b Sync to 1.49 2003-04-27 00:26:19 +00:00
Alan Cox
ecde4b3218 Various changes to vm_object_page_remove():
- Eliminate an odd, special-case feature:
   if start == end == 0 then all pages are removed.  Only one caller
   used this feature and that caller can trivially pass the object's
   size.
 - Assert that the vm_object is locked on entry; don't bother testing
   for a NULL vm_object.
 - Style: Fix lines that are longer than 80 characters.
2003-04-26 23:41:30 +00:00
Warner Losh
03988eea4d MF-p4:
"Ian gave me this patch"  I assume this is iadowse@.

Also, pull in a few devices NetBSD's table.  More are there, but I need
to properly move them to pccarddev before including them here.
2003-04-26 22:19:02 +00:00
Warner Losh
57bf268890 Add a generic cdrom. 2003-04-26 22:13:51 +00:00
Poul-Henning Kamp
c08c56e02a Bail as soon as the first write request has failed, there is no point
in trying the second write if the first one went nowhere.
2003-04-26 21:40:26 +00:00
Poul-Henning Kamp
54d2011343 Appearantly UFS no longer issues BIO_DELETE requests correctly, and
consequently trashes data.  Disable BIO_DELETE handling in gbde for now.
2003-04-26 21:39:33 +00:00
David E. O'Brien
4bee32ae9c I was wrong, the ENTRY bits in asm.h did have a purpose -- for userland.
Restore the bits and remove them from asmacros.h.  *.S will now be asm.h
consumers.

Approved by:	jake
2003-04-26 20:54:45 +00:00
Alan Cox
c829b9d0fc - Lock the vm_object on entry to vm_object_terminate(). 2003-04-26 19:36:19 +00:00
Alan Cox
1ca5895341 - Convert vm_object_pip_wait() from using tsleep() to msleep().
- Make vm_object_pip_sleep() static.
 - Lock the vm_object when performing vm_object_pip_wait().
2003-04-26 18:33:18 +00:00
Paul Saab
fa22802086 Update the mbuf watermark settings to match the latest documentation
from Broadcom.  These values are strongly encouraged for proper operation.

MFC after:	3 days
2003-04-26 18:26:29 +00:00
David E. O'Brien
ef7b1f2f0f The ENTRY bits were in two places. Remove the one not used (asm.h), but
presurve the nice comment by adding it to asmacros.h.
2003-04-26 17:17:45 +00:00
David E. O'Brien
9cd8976ea9 Two tokens that don't together form a vaid preprocssor token cannot be
pasted together using ANSI-C token concatinatation.  GCC's cpp, at least,
produces the desired result w/o using "##".
2003-04-26 17:00:10 +00:00
Hidetoshi Shimokawa
5e286c3211 - Improve configuration ROM parser for multiple unit directory.
- Remove getcsrdata().
- Don't print device type, this can be obtained by fwcontrol.

Tested with: Maxtor 5000XT
Tested by: Daniel O'Connor <doconnor@gsoft.com.au>
2003-04-26 16:45:40 +00:00
Alan Cox
adf4e1d58a Remove an unused declaration. 2003-04-26 08:36:06 +00:00
Alan Cox
af3e0bb202 - Lock the vm_object when performing vm_page_alloc() in allocbuf(). 2003-04-26 07:42:24 +00:00
Eric Anholt
d2c47a2151 Merge from DRI CVS: Disable MTRRs on FreeBSD-stable to work around hangs with
SMP machines. and use i386 asm for atomic_cmpset_int on -stable.  This is in
preparation for MFCing the DRM.
2003-04-26 06:59:38 +00:00
Alan Cox
155080d31e - Extend the scope of two existing vm_object locks to cover
swap_pager_freespace().
2003-04-26 05:30:56 +00:00
Alan Cox
5103186c8c Remove an XXX comment. It is no longer a problem. 2003-04-26 05:00:56 +00:00
Johan Karlsson
00ffb51ea5 Add nodevice axe, since usb isn't supported by PAE.
Submitted by:	harti@
Approved by:	jake@
2003-04-25 21:49:35 +00:00
Poul-Henning Kamp
3f6ee876c1 Update the "last malloc failure timestamp" also for simulated
malloc errors.
2003-04-25 21:49:24 +00:00
Poul-Henning Kamp
9b99e39d61 Do an explicit retry after we have dumped the cache, rather than a
(potential) tail recursion.
2003-04-25 21:43:11 +00:00
Poul-Henning Kamp
e8e0742ef4 If on a BIO_READ request, we failed to allocate the bio for reading
our key-sector, we would end up returning the read without an error,
despite the fact that the data was not correctly decrypted.

This would result in data corruption on read, but intact data still
on the media.
2003-04-25 21:28:28 +00:00
Poul-Henning Kamp
37f5e4a6c2 Fix a problem and slightly improve the ENOMEM handling:
Give up the entire bio as soon as we detect a problem.

When we detect a problem, give up the bio by contributing the
remainder with ENOMEM, rather than kicking the bio back right
away.

If we failed on a non-first iteration we previously could end up
modifying fields in the bio after we delivered it.  This could
account for memory corruption (none directly reported) on machines
with GBDE.
2003-04-25 21:20:57 +00:00
Poul-Henning Kamp
af6b9f17f9 Don't count a sector in the cache unless we manage to create it. 2003-04-25 20:56:27 +00:00
Poul-Henning Kamp
f2314b445d Rename g_bde_release_sector() to g_bde_release_keysector() and pick up
the sector from the work item.
2003-04-25 20:35:34 +00:00
Poul-Henning Kamp
195d573278 Rename g_bde_read_sector() to g_bde_read_keysector() pick up the offset
in the work structure.
2003-04-25 20:16:59 +00:00
John Baldwin
a70a2b741b Remove Giant from getpgid() and getsid() and tweak the logic to more
closely match that of 4.x.
2003-04-25 20:09:31 +00:00
John Baldwin
8f88740381 - Don't bother using the proc lock to test just P_SYSTEM as that is set in
fork1() and never changes.
- The proc lock is enough to cover reading p_state, so push down sched_lock
  into the PRS_NORMAL case of the switch on p_state.
2003-04-25 20:06:30 +00:00
John Baldwin
7ff022c485 - Push down Giant into the sysarch() calls that still need Giant.
- Standardize on EINVAL rather than EOPNOTSUPP if the sysarch op value is
  invalid.
2003-04-25 20:04:02 +00:00
John Baldwin
17b8a8a77a Push down Giant around calls to proc_rwmem() in kern_ptrace. kern_ptrace()
should now be MP safe.
2003-04-25 20:02:16 +00:00
John Baldwin
25d6dc0606 Push Giant down into kern_sigaction() instead of locking it around calls
to kern_sigaction() in the various callers of the function.
2003-04-25 20:01:19 +00:00
John Baldwin
64cc6a13e7 - Push down Giant around vnode operations in ktrace().
- Mark the ktrace() and utrace() syscalls as being MP safe.
- Validate the facs argument to ktrace() prior to doing any vnode
  operations or acquiring any locks.
- Share lock the proctree lock over the entire section that calls
  ktrsetchildren() and ktrops().  We already did this for process groups.
  Doing it for the process case closes a small race where a process might
  go away after we look it up.  As a result of this, ktrstchildren() now
  just asserts that the proctree lock is locked rather than acquiring the
  lock itself.
- Add some missing comments to #else and #endif.
2003-04-25 19:59:35 +00:00
John Baldwin
fdbaa60278 Lock Giant around calls to useracc() in osf1_sigreturn() so that the
function is MP safe.
2003-04-25 19:52:30 +00:00
John Baldwin
b11c8f53dc Lock Giant around userland_sysctl() to get the hostname in osf1_sysinfo()
so that the function is MP safe.  The rest of the function doesn't need
Giant.
2003-04-25 19:51:41 +00:00
John Baldwin
19dde5cd3b Use a switch to convert the Linux sigprocmask flags to the equivalent
FreeBSD flags instead of just adding one to the Linux flags.  This should
be identical to the previous version except that I have at least one report
of this patch fixing problems people were having with Linux apps after my
last commit to this file.  It is safer to use the switch then to make
assumptions about the flag values anyways, esp. since we currently use
MD defines for the values of the flags and this is MI code.

Tested by:	Michael Class <michael_class@gmx.net>
2003-04-25 19:26:18 +00:00
Alan Cox
6a07e90d63 - Lock the vm_object when iterating over its list of resident pages. 2003-04-25 16:30:02 +00:00
Hartmut Brandt
33cfde03bc Convert the midway driver to use busdma. Except for this conversion the
following changes have been done:

- stylify. The original code was too hard to read.
- get rid of a number of compilation options (Adaptec-only, Eni-only, no-DMA).
- more debugging features.
- locking. This is not correct yet in the absence of interface layer locking,
  but is correct enough to not to cause lock order reversals.
- remove RAW mode. There are no users of this in the tree and I doubt that
  there are any.
- remove NetBSD compatibility code. There was no way to keep NetBSD non-busdma
  and FreeBSD busdma code together.
- if_en now buildable as a module.

This has been actively tested on sparc64 and i386 with ENI server and
client cards and an Adaptec card (thanks to kjc).

Reviewed by:	mdodd, arr
2003-04-25 16:14:03 +00:00
John Baldwin
d8ca78d02f Regen. 2003-04-25 15:59:44 +00:00
John Baldwin
9fb3809a3a Oops, the thr_* and jail_attach() syscall entries should be NOPROTO rather
than STD.
2003-04-25 15:59:18 +00:00
Jake Burkholder
ffad008fcd Remove harmless invalid cast.
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-25 15:07:58 +00:00
Nate Lawson
4953bccacf Make fxp(4) INTR_MPSAFE (but do not enable MPSAFE just yet):
- Add fxp_start_body() and change fxp_start() to just acquire locks and
  then call fxp_start_body().  Places that would call fxp_start() with
  locks held (mutex recursion) now call fxp_start_body() directly.
  Remove MTX_RECURSE flag from sc_mtx. [gallatin]
- Change fxp_attach() to work without the softc lock, saving interrupt
  hooking until the head of fxp_attach().
- Call ether_ifattach() before overriding ifp parameters. This reverts
  part of 1.155.
- Remove multiple error paths in fxp_attach().
- Teardown interrupt in fxp_detach() before unlocking the softc.
- Make sure mutex is not held in fxp_release()
- Delete the miibus instance and/or self in fxp_release(), not in
  fxp_detach().  This can happen if attach fails partway through.
- Move ifmedia_removeall to fxp_release() since attach may fail after
  media have been allocated.
- Add locking to fxp_suspend, fxp_resume, fxp_start, fxp_intr,
  fxp_poll, fxp_tick, fxp_ioctl, fxp_watchdog.
- Pass in ifp to fxp_intr_body since its callers sometimes already use
  it.
- Add compatibility define for INTR_MPSAFE for 4.x. [gallatin]
- You don't need to bzero softc.

Ideas from:	gallatin, mux
Tested by:	>400M packets of dd/ssh, NFS, ping on i386 UP
2003-04-25 09:01:54 +00:00
Alan Cox
5299887de5 - Relax the Giant required in vm_page_remove().
- Remove the Giant required from vm_page_free_toq().  (Any locking
   errors will be caught by vm_page_remove().)

This remedies a panic that occurred when kmem_malloc(NOWAIT) performed
without Giant failed to allocate the necessary pages.

Reported by:	phk
2003-04-25 06:35:05 +00:00
Scott Long
1374b663e8 Import latest changes from the vendor. This also is reported to fix the
driver at long last!
Many thanks to vaidas.damosevicius@if.lt for keeping this issue alive
and pursuing Intel for a fix, Intel/ICP for working on the driver, and
Sergey Osokin for bringing the original patches up to 5-CURRENT.
2003-04-25 05:37:04 +00:00
Daniel Eischen
1328e1c4be Add an argument to get_mcontext() which specified whether the
syscall return values should be cleared.  The system calls
getcontext() and swapcontext() want to return 0 on success
but these contexts can be switched to at a later time so
the return values need to be cleared in the saved register
sets.  Other callers of get_mcontext() would normally want
the context without clearing the return values.

Remove the i386-specific context saving from the KSE code.
get_mcontext() is not i386-specific any more.

Fix a bad pointer in the alpha get_mcontext() code.  The
context was being bcopy()'d from &td->tf_frame, but tf_frame
is itself a pointer, so the thread was being copied instead.
Spotted by jake.

Glanced at by:  jake
Reviewed by:    bde (months ago)
2003-04-25 01:50:30 +00:00
Eric Anholt
42da33c444 Update the DRM to the latest from DRI CVS. Includes some bugfixes and removal
of the infrastructure for the gamma driver which was removed a while back.
The DRM_LINUX option is removed because the handler is now provided by the
linux compat code itself.
2003-04-25 01:18:47 +00:00
Tim J. Robbins
913fc94d2b Include altkstack pages in the RSS regardless of whether the process
is swapped out. Pointed out by jhb.
2003-04-25 00:20:40 +00:00
Eric Anholt
caa18809df Add an ioctl handler for the DRM. This removes the need for the DRM_LINUX
option, which has been a source of frustration for many users.
2003-04-24 23:36:35 +00:00
John Baldwin
9bc65d35f2 Regen. 2003-04-24 20:50:57 +00:00
John Baldwin
d46b3412dc Fix the thr_create() entry by adding a trailing \. Also, sync up the
MP safe flag for thr_* with the main table.
2003-04-24 20:49:46 +00:00
Don Lewis
78b0aaefb5 VOP_FSYNC() expects to be called with the vnode locked, so lock fvp in
nfs_rename() before calling VOP_FSYNC() and unlock fvp immediately after.

Reviewed by:	bde
2003-04-24 20:39:40 +00:00
Peter Wemm
d76f16de39 Fix a bug with df on large (>1TB) nfsv3 file servers on 32 bit client
machines where the 'long' number of blocks in struct statfs wont fit.
Instead of chosing an artificial 512 byte block size, simply scale it up
until we avoid an overflow.  NFSv3 reports the sizes in bytes, and the
blocksize is a figment of nfsclient's imagination.
2003-04-24 20:36:32 +00:00
John Baldwin
696f22f04f Fail to mount a device if the bytes per sector in the BPB is less than
DEV_BSIZE or if the number of FAT sectors is zero.
2003-04-24 18:19:19 +00:00
Wes Peters
943927683f Make P_PROTECTED not conflict with P_STOPPED_SIG. Replace
P_UNUSED100000 which is *truly* unused, until now.

Submitted by:	Robert Drehmel <robert@zoot.drehmel.com>
2003-04-24 16:20:14 +00:00
Hidetoshi Shimokawa
a2da26fc1d Fix printf warnings for i386 with PAE.
Submitted by: harti
2003-04-24 15:27:06 +00:00
Alexander Kabaev
5c352f0e5a Fix a typo in UINT_MAX definition. 2003-04-24 14:25:38 +00:00
Dag-Erling Smørgrav
013466aa50 It seems that 1 was not a magic value as I thought, but a coincidence.
Instead of applying the adjustment to processes with a start time of 1,
apply it to all processes with a start time of less than 3600.

None of this would be necessary if the start times were recorded in ticks
instead of seconds and microseconds.
2003-04-24 12:12:06 +00:00
Tim J. Robbins
ceff7f2a48 Do a better job of calculating the RSS for swapped-out processes:
don't include the kernel stacks of swapped-out threads in the page count,
but do include the alternate kernel stack. jhb provided some helpful
comments on this.

PR:		49102
2003-04-24 11:03:04 +00:00
Hidetoshi Shimokawa
6c1acd010e Fix printf warning for RELENG_4. 2003-04-24 09:27:17 +00:00
Tim J. Robbins
38dd7dee8a Free mount credentials (mnt_cred) when freeing the mount struct
in failure cases to avoid leaking struct ucreds, and ultimately
leaking struct uidinfo references.
2003-04-24 08:16:06 +00:00
Hidetoshi Shimokawa
8fd36d4aa6 Add some IEEE 1394 OHCI chips.
Partially submitted by: Tetsuya Ryuchi <ryuchi@ryuchi.org>
PR: misc/51336
2003-04-24 07:29:52 +00:00
Alan Cox
875791f63d - Move swap_pager_isswapped()'s prototype to a more logical place. 2003-04-24 05:29:27 +00:00
Alan Cox
b6e48e0372 - Acquire the vm_object's lock when performing vm_object_page_clean().
- Add a parameter to vm_pageout_flush() that tells vm_pageout_flush()
   whether its caller has locked the vm_object.  (This is a temporary
   measure to bootstrap vm_object locking.)
2003-04-24 04:31:25 +00:00
Dag-Erling Smørgrav
1f7440d9f6 When filling out a kinfo_proc structure, if we come across a process
whose p_stats->p_start has the magic value 1, replace it with boottime.
Some users were apparently confused by the fact that ps(1) reported a
start time in early 1970 for system processes.
2003-04-24 03:37:59 +00:00
David Xu
e63c419732 Don't print anything for fault at cpu_switch_load_gs, just like other
code to recover fault in doreti because of invalid segment registers,
silently push error to userland.
2003-04-24 01:48:59 +00:00
Archie Cobbs
c1404dc060 Tweak to previous commit: increment ifp->if_iqdrops if the m_copy() fails.
Suggested by:	Neelkanth Natu <neelnatu@yahoo.com>
2003-04-23 23:45:57 +00:00
Warner Losh
9598fb9322 1. Allow drivers to query CIS strings from OLDCARD.
2. Include backwards compatibility good for the moment (eventually will
   be turned off in current, but allow for a short transition period).

PR:	51333
Submited by: Scott Mitchell (1)
MFC after:	2 weeks
2003-04-23 23:39:21 +00:00
Warner Losh
d6b4602222 Add accessor for cis4 string. Neither OLDCARD nor NEWCARD support
this yet, but that will change soon.

Pr: 51333
Submited by: Scott Mitchell
2003-04-23 23:32:53 +00:00
Alexander Kabaev
6fd839f9c7 Add a new sys/limits.h file which in turn depends on machine/_limits.h
to get actual constant values. This is in preparation for machine/limits.h
retirement.

Discussed on:	standards@
Submitted by:	Craig Rodrigues <rodrigc@attbi.com>  (*)
Modified by:	kan
2003-04-23 21:41:59 +00:00
Poul-Henning Kamp
0a9c130c06 Introduce a g_waitfor_event() function which posts an event and waits for
it to be run (or cancelled) and use this instead of home-rolled versions.
2003-04-23 21:28:27 +00:00
Poul-Henning Kamp
a974614b05 More of the event stuff can now be private to geom_event.c 2003-04-23 20:54:42 +00:00
Poul-Henning Kamp
8cd1535a24 Rename g_call_me() to g_post_event(), and give it a flag
argument to determine if we can M_WAITOK in malloc.
2003-04-23 20:46:12 +00:00
Poul-Henning Kamp
d98777f8db Remove the now unused hardcoded g_post_event() event support. 2003-04-23 20:25:33 +00:00
John Hay
d8422795fa Use bus_space*() instead of in*() and out*(). 2003-04-23 20:22:32 +00:00
Poul-Henning Kamp
9ab3ea7841 Turn EV_NEW_PROVIDER into a g_call_me() event. 2003-04-23 20:16:13 +00:00
Poul-Henning Kamp
f2e9a09494 Convert EV_SPOILED event to use g_call_me(). 2003-04-23 20:06:38 +00:00
John Baldwin
cf60731b01 Remove Giant from osigblock(), osigsetmask(), and kern_sigaltstack(). 2003-04-23 19:49:18 +00:00
Poul-Henning Kamp
9972896c00 Turn the hardwired NEW_CLASS event into a g_call_me() event. 2003-04-23 19:34:38 +00:00
Poul-Henning Kamp
b5cba4167f Move the shutdown eventhandler stuff to a more logical place. 2003-04-23 19:15:27 +00:00
John Baldwin
48fdefd188 Update many of the locking notes and comments for struct
thread/kse/ksegroup/proc.
2003-04-23 18:54:30 +00:00
John Baldwin
5eac9e2dcb The signotify() sanity check in userret() doesn't need Giant anymore. 2003-04-23 18:51:55 +00:00
John Baldwin
2056d0a168 Add lock assertions for various proc/thread/kse/ksegroup fields to the
scheduler functions.
2003-04-23 18:51:05 +00:00
John Baldwin
5afe0c9947 - Reorganize osigstack() to do the copyin first, grab the proc lock once,
do all the various sigstack dances, unlock the proc lock, and finally do
  the copyout.  This more closely resembles the behavior of
  kern_sigaltstack() and closes a small race.
- Remove Giant from osigstack as it is no longer needed.
2003-04-23 18:50:25 +00:00
John Baldwin
4d923fe3f5 Remove Giant from [gs]etpriority(). 2003-04-23 18:48:55 +00:00
John Baldwin
112afcb232 - Protect p_numthreads with the sched_lock.
- Protect p_singlethread with both the sched_lock and the proc lock.
- Protect p_suspcount with the proc lock.
2003-04-23 18:46:51 +00:00
Archie Cobbs
79db6ff316 Fix a case where the return value from m_copy() was not being checked
for NULL before proceeding, causing a crash if mbufs were exhausted.

MFC after:	3 days
Reported by:	Mark Gooderum <mark@verniernetworks.com>
2003-04-23 18:35:40 +00:00
John Baldwin
11edc1e0d7 Fix compiling in the NO_SWAPPING case.
Submitted by:	bde (partially)
2003-04-23 18:21:41 +00:00
John Baldwin
c6004a6202 Fix a lock order reversal. Unlock the proc before calling fget().
Reported by:	kris
2003-04-23 18:13:26 +00:00
John Baldwin
6faa2f6d6e Comment out the mixer entry for igain for the mic 20dB boost for now since
it can cause feedback problems on some laptops.

Reviewed by:	orion
2003-04-23 16:49:53 +00:00
Dag-Erling Smørgrav
bd9155712b Add constants for USB programming interfaces. These are already defined
(with other names) in the USB driver sources, but I felt that pcireg.h
should have a complete list - at least of classes and interfaces that we
know about and use.
2003-04-23 15:51:36 +00:00
John Hay
e37d1c1488 Get rid of kvtop().
Change inb() and outb() to use bus_space*().
2003-04-23 15:40:11 +00:00
Poul-Henning Kamp
bf9ab27afb Implement CONFIG_GEOM verbs "write label" and "write bootcode". 2003-04-23 08:23:01 +00:00
Poul-Henning Kamp
a357555867 Introduce a #define for the length of the bootloader code. 2003-04-23 08:04:30 +00:00
Poul-Henning Kamp
ca3d750e73 Introduce gctl_get_paraml() which gets a parameter only if it has the
right length.
2003-04-23 08:03:47 +00:00
Poul-Henning Kamp
fb9483af54 Make gctl_error() take printfline varargs. 2003-04-23 07:50:01 +00:00
Poul-Henning Kamp
668ae29c71 Remove unused event pointers in object structures.
Remove KASSERTS which checked that they were unused.
2003-04-23 06:54:44 +00:00
David E. O'Brien
2603007ace Add /dev to the Alpha manual mount root example. 2003-04-23 05:02:40 +00:00
Don Lewis
8b3182e212 Release the vnode interlock in nfs_flush() before calling nfs_sigintr(),
and grab it again later if necessary.  This prevents a lock order reversal
because nfs_sigintr() calls PROC_LOCK().
2003-04-23 02:58:26 +00:00
Poul-Henning Kamp
b874183561 Change the locking so that the _modify function is called with topology
held.

The only place where we want to not hold topology is when we read
(or write) the label to disk: in the case of a disk error with a
long recovery time, holding topology would prevent open/close of
any disk device.
2003-04-22 21:29:58 +00:00
Poul-Henning Kamp
b09d72daf8 We don't need to have a slice->start() function. 2003-04-22 21:24:37 +00:00
Poul-Henning Kamp
d3a1a13766 Do not mandate that slicers have a private ->start(), they may not need
one.  KASSERT() that they have one if G_SLICE_HOT_START is used.
2003-04-22 21:19:17 +00:00
Poul-Henning Kamp
ea9ab6bed2 Implement handling of CONFIG_GEOM OAM request. 2003-04-22 21:01:46 +00:00
Poul-Henning Kamp
2c30da600e Add "CONFIG_GEOM" operation to the OAM API. 2003-04-22 21:00:49 +00:00
John Baldwin
9752f794c7 - Move PS_PROFIL and its new cousin PS_STOPPROF back over to p_flag and
rename them appropriately.  Protect both flags with both the proc lock
  and the sched_lock.
- Protect p_profthreads with the proc lock.
- Remove Giant from profil(2).
2003-04-22 20:54:04 +00:00
John Baldwin
0b5318c81a - Assert that the proc lock and sched_lock are held in sched_nice().
- For the 4BSD scheduler, this means that all callers of the static
  function resetpriority() now always hold sched_lock, so don't lock
  sched_lock explicitly in that function.
2003-04-22 20:50:38 +00:00
John Baldwin
a15cc35909 Lock both the proc lock and sched_lock when calling sched_nice since
kg_nice is now protected by both.  Being protected by both means that
other places in the kernel that want to read kg_nice only need one of the
two locks.
2003-04-22 20:45:38 +00:00
John Baldwin
897ecacd64 Lock the proc to check p_flag and several other related tests in
vm_daemon().  We don't need to hold sched_lock as long now as a result.
2003-04-22 20:03:08 +00:00
John Baldwin
eeec6bab2e Prefer the proc lock to sched_lock when testing PS_INMEM now that it is
safe to do so.
2003-04-22 20:01:56 +00:00
John Baldwin
664f718ba1 - Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a
race where a thread could assume that a process was swapped in by
  PHOLD() when it actually wasn't fully swapped in yet.
- In faultin(), always msleep() if PS_SWAPPINGIN is set instead of doing
  this check after bumping p_lock in the PS_INMEM == 0 case.  Also,
  sched_lock is only needed for setting and clearning swapping PS_*
  flags and the swap thread inhibitor.
- Don't set and clear the thread swap inhibitor in the same loops as the
  pmap_swapin/out_thread() since we have to do it under sched_lock.
  Instead, mimic the treatment of the PS_INMEM flag and use separate loops
  to set the inhibitors when clearing PS_INMEM and clear the inhibitors
  when setting PS_INMEM.
- swapout() now returns with the proc lock held as it holds the lock
  while adjusting the swapping-related PS_* flags so that the proc lock
  can be used to test those flags.
- Only use the proc lock to check the swapping-related PS_* flags in
  several places.
- faultin() no longer requires sched_lock to be held by callers.
- Rename PS_SWAPPING to PS_SWAPPINGOUT to be less ambiguous now that we
  have PS_SWAPPINGIN.
2003-04-22 20:00:26 +00:00
John Baldwin
828e7683bf Protect p_swtime with the sched_lock. 2003-04-22 19:48:25 +00:00
John Baldwin
a6f37ac9d6 - Mark the kse_purge_group() and kse_purge() definitions static to match
their prototypes.
- Remove sched_lock locking from kse_purge() as all callers already lock
  the sched_lock before calling it.
- Hold the proc lock slightly longer to protect P_SHOULDSTOP().
2003-04-22 19:47:55 +00:00
John Baldwin
7b5e3e1239 Keep the proc locked while we set PS_INMEM so that either of the proc lock
or sched_lock are sufficient to test this flag.

XXX: vinum should really be using a kernel process via kthread_create()
instead of this hack.  I'm not even sure PS_INMEM can be clear at this
point anyways.
2003-04-22 19:45:26 +00:00
Poul-Henning Kamp
70b4ddbb09 Collapse meta arguments into regular arguments, the distinction is
more trouble than it is worth.
2003-04-22 19:42:05 +00:00
John Baldwin
fe8cdcae87 - Replace inline implementations of sigprocmask() with calls to
kern_sigprocmask() in the various binary compatibility emulators.
- Replace calls to sigsuspend(), sigaltstack(), sigaction(), and
  sigprocmask() that used the stackgap with calls to the corresponding
  kern_sig*() functions instead without using the stackgap.
2003-04-22 18:23:49 +00:00
Alan Cox
2e9d00a15d Revision 1.246 should have also included
- Weaken the assertion in vm_page_insert() to require Giant only if the
   vm_object isn't locked.

Reported by:	 "Ilmar S. Habibulin" <ilmar@watson.org>
2003-04-22 14:26:02 +00:00
Yoshihiro Takahashi
2f4f42d484 Comment out firewire devices. 2003-04-22 12:14:19 +00:00
David Xu
97637bcfb2 Move down intr level testing code a bit, cpu_switch_load_gs fault can be at
interrupt nested time.
2003-04-22 08:12:03 +00:00
David Xu
5515888875 Fix some problems for cpu_switch_load_gs. when fault address is at
cpu_switch_load_gs, cpu is in context switch, so don't enable interrupt.
because it is in context switch, it is expected sched_lock was held,
so don't PROC_LOCK(p) and psignal, it is LOR, probably we can
set a P_XSIGBUS like flag in p_sflags, and set TDF_ASTPENDING in
td_flags, in ast(), post a SIGBUS to process if P_XSIGBUS was set.
2003-04-22 07:45:47 +00:00
Alan Cox
26da32cc73 Remove unused declarations. 2003-04-22 06:26:42 +00:00
Alan Cox
03d4c1e644 Revision 1.52 of vm/uma_core.c has led to UMA's obj_alloc() being
called without Giant; and obj_alloc() in turn calls vm_page_alloc()
without Giant.  This causes an assertion failure in vm_page_alloc().
Fortunately, obj_alloc() is now MPSAFE.  So, we need only clean up
some assertions.

 - Weaken the assertion in vm_page_lookup() to require Giant only
   if the vm_object isn't locked.
 - Remove an assertion from vm_page_alloc() that duplicates a check
   performed in vm_page_lookup().

In collaboration with:	gallatin, jake, jeff
2003-04-22 05:36:14 +00:00
Alan Cox
1c067f7ebc Add VM_OBJECT_LOCKED(). 2003-04-22 04:47:29 +00:00
Hidetoshi Shimokawa
f73a5a7f66 add scbus for FireWire. 2003-04-22 04:39:20 +00:00
David Xu
5b70587b8a Remove single threading detecting code, these code really should be
replaced by thread_user_enter(), but current we don't want to enable
this in trap.
2003-04-22 03:17:41 +00:00
Hidetoshi Shimokawa
85b2d114c0 Set the local bus address in xfer->dst.
Submitted by: Buzz Slye <buzz@gaia.arc.nasa.gov>
2003-04-22 02:31:31 +00:00
Marcel Moolenaar
148eac48f1 Don't use the tpa instruction to implement pmap_kextract. The tpa
instruction requires that a translation is present in the TC. This
may trigger a TLB miss and a subsequent call to vm_fault().
This implementation is deliberately non-inline for debugging and
profiling purposes. Partial or full inlining should eventually be
done.

Valuable insights by: jake
2003-04-22 01:48:43 +00:00
Poul-Henning Kamp
18fdae6bd8 Now that all uses of this file use explicit encoding/decoding, remove
all the bits we do not need, and drop the attempt at "disk-image"
structure definition.

Add idempotency (sp?) #ifdef
2003-04-21 20:40:41 +00:00
Poul-Henning Kamp
989afda211 Implement a hotspot for the sunlabel.
This means that you can no longer trash your opened partitions by writing to
the sunlabel through another partition.  This is similar to the semantics
implemented for BSD labels.
2003-04-21 20:14:36 +00:00
Poul-Henning Kamp
666223979c Update GEOM::SUN to use the decoding functions in geom_sunlabel_enc.c
and #defines from sys/sun_disklabel.h.
2003-04-21 19:54:11 +00:00
Poul-Henning Kamp
9bd6be665d Use #defines from <sys/sun_disklabel.h> instead of private ones. 2003-04-21 19:42:36 +00:00
Poul-Henning Kamp
e268e8c725 Add defines for number of partitions, raw partition index and size of
encoded data structure.
2003-04-21 19:38:33 +00:00
Poul-Henning Kamp
0b60aa467b Add prototypes for sunlabel_dec() and sunlabel_enc().
Assume (for now) that all sun labels are big endian.
2003-04-21 19:31:42 +00:00
Poul-Henning Kamp
941a2f8cb5 Functions to encode and decode Sun Microsystems disk partitioning data
structures.

Mostly by:	jake
2003-04-21 18:41:12 +00:00
Warner Losh
214073e5e4 Use newly minted device_is_attached rather than device_is_alive to see
if attach succeeded.  device_is_alive just tells us that probe
succeeded.  Since we were using it to do things like detach net
interfaces, this caused problems when there were errors in the attach
routine.

Symptoms of problem reported by: martin blapp
2003-04-21 18:34:04 +00:00
Warner Losh
01a9b4348f Create a new function, device_is_attached(), that is like
device_is_alive() that tells us if the device has successfully
attached.  device_is_alive just tells us that the device has
successfully probed.
2003-04-21 18:19:08 +00:00
Takanori Watanabe
1f96e3e8b9 Regen. 2003-04-21 17:36:03 +00:00
Takanori Watanabe
beb4384bf8 Add another product ID for if_axe and correct vendor ID description
for Linksys USB200M.The USB vendor ID list is available from
http://www.usb.org/app/pub/dump/comp_dump/

Reviewed by: wpaul
2003-04-21 17:34:13 +00:00
Hidetoshi Shimokawa
092cd06fcd Add FireWire drivers to GENERIC. 2003-04-21 16:44:05 +00:00
Hidetoshi Shimokawa
e863fbcdb0 Remove unused code. 2003-04-21 16:41:20 +00:00
David E. O'Brien
b67eb8b080 Explicitly declare 'int' parameters. 2003-04-21 16:34:18 +00:00
David E. O'Brien
40373d8796 Assembly files put thru the C preprocessor need to have C style comments. 2003-04-21 16:30:12 +00:00
David E. O'Brien
152385d122 Explicitly declare 'int' parameters. 2003-04-21 16:27:46 +00:00
David Xu
6625036082 Reset pcb_gs and %gs before possibly invalidating it. 2003-04-21 15:05:05 +00:00
David Xu
11b20c685b Fix lock order reversal problem. 2003-04-21 14:42:04 +00:00
David Xu
1ecb38a365 Introduce two flags to control upcall behaviour:
o KMF_NOUPCALL
	Ask kse_release to not return to userland upcall entry, but instead
	direct returns to userland by using current thread's stack and return
	address on stack. This flags is intended to be used by UTS in critical
	region to wait another UTS thread to leave critical region, by using
	kse_release with this flag to avoid spinnng and burning CPU. Also this
	flags can be used by UTS to poll completed context when there is nothing
	to do in userland and needn't restart from its entry like normal upcall.

o KMF_NOCOMPLETED
	Ask kernel to not bring completed thread contexts back to userland when
	doing upcall, this flags is intend to be used with above flag when an
	upcall thread is in critical region and can not process completed contexts
	at that time.

Tested by: deischen
2003-04-21 07:27:59 +00:00
David Xu
bb3578eb65 Add a member field for kse_upcall to cache kse mailbox flags.
Code for this will be committed soon.
2003-04-21 07:02:37 +00:00
Alan Cox
d647a0ed5a - Assert that the vm_object is locked in vm_object_clear_flag(),
vm_object_pip_add() and vm_object_pip_wakeup().
 - Remove GIANT_REQUIRED from vm_object_pip_subtract() and
   vm_object_pip_subtract().
 - Lock the vm_object when performing vm_object_page_remove().
2003-04-21 06:33:52 +00:00
Warner Losh
e22b0bf4b8 Fix /dev/devctl's implementation of poll. We should only be setting
the poll bits when there's actually something in the queue.
Otherwise, select always returned '2' when there were no items to be
read, and '3' when there were.  This would preclude being able to read
in a threaded (libc_r) program, as well as checking to see if there
were pending events or not.
2003-04-21 05:58:51 +00:00
Orion Hodson
61a0da1de5 Add eMicro codec ids. 2003-04-21 04:48:40 +00:00
Orion Hodson
96524a52b6 Use SOUND_MIXER_IGAIN to toggle 20dB mic boost for want of a better
place for it.

Assorted comments.

Submitted by: luigi
2003-04-21 03:47:28 +00:00
Robert Watson
dbf4bdffd9 Remove extraneous reference to intrq.h, which broke the kernel build. 2003-04-21 03:17:27 +00:00
David E. O'Brien
915dbb90f2 This commit was generated by cvs2svn to compensate for changes in r113778,
which included commits to RCS files with non-trunk default branches.
2003-04-21 02:27:52 +00:00
David E. O'Brien
318444e86f Vendor import revision 1.8 of ac97_codec.h (we renamed the file) from
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/emu10k1/emu10k1/ac97_codec.h
2003-04-21 02:27:52 +00:00
Alan Cox
d7a013c320 - Lock the vm_object when performing either vm_object_clear_flag() or
vm_object_pip_wakeup().
2003-04-20 23:23:41 +00:00
Alan Cox
1d284e00b5 - Update the vm_object locking in vm_map_insert(). 2003-04-20 21:56:40 +00:00
Alan Cox
72ba747d16 - Lock the vm_object when performing vm_object_pip_wakeup().
- Merge two identical cases in a switch statement.
2003-04-20 20:37:14 +00:00
Bill Paul
7aeaaee867 Regenerate. 2003-04-20 20:17:10 +00:00
Bill Paul
e5c195da55 Add support for the Netgear FA120 and the D-Link DUBE100 (AX88172-based
devices).
2003-04-20 20:15:42 +00:00
Alan Cox
b009d5a0af - Lock the vm_object when performing vm_object_pip_wakeup(). 2003-04-20 19:25:28 +00:00
Bill Paul
6d179e5b69 Regen usbdevs. 2003-04-20 19:07:51 +00:00
Bill Paul
87b4a25958 Add device driver support for the ASIX Electronics AX88172 USB 2.0
ethernet controller. The driver has been tested with the LinkSys
USB200M adapter. I know for a fact that there are other devices out
there with this chip but don't have all the USB vendor/device IDs.

Note: I'm not sure if this will force the driver to end up in the
install kernel image or not. Special magic needs to be done to exclude
it to keep the boot floppies from bloating again, someone please
advise.
2003-04-20 19:05:33 +00:00
David E. O'Brien
bfd738788b style.Makefile(5) 2003-04-20 18:38:59 +00:00
Maxime Henrion
a4d0f4d116 Convert the tx(4) driver to use the busdma API.
Special thanks to brueffer for sending me such a card so that
I could do this work.
2003-04-20 18:08:00 +00:00
Maxime Henrion
b9403c495e Better comment, more style(9) fixes. 2003-04-20 17:36:26 +00:00
Orion Hodson
6635978f23 Additional malloc failure checks. 2003-04-20 17:08:56 +00:00
Robert Watson
e02fef7adc Use u_int for the struct uidinfo reference count rather than u_short;
while >65534 references is unlikely, it is possible.

Reviewed by:	tjr
2003-04-20 13:54:04 +00:00
David E. O'Brien
82d4d32d65 more style(9) changes. 2003-04-20 09:07:14 +00:00
David E. O'Brien
e3da61d733 more style(9) changes. 2003-04-20 08:37:29 +00:00
David E. O'Brien
ee1ca8b7f5 A few style(9) fixes. 2003-04-20 07:43:09 +00:00
Alan Cox
2b7e071e89 - Lock the vm_object when performing vm_object_pip_add(). 2003-04-20 07:29:50 +00:00
Alan Cox
d68d828b43 - Lock the vm_object when performing vm_object_pip_add().
- Remove an unnecessary variable.
2003-04-20 07:08:30 +00:00
Alan Cox
7d040e3cc5 Update vm_object locking in vm_map_delete(). 2003-04-20 04:35:47 +00:00
Alan Cox
d22bc7101c - Lock the vm_object when performing vm_object_pip_add(). 2003-04-20 03:41:21 +00:00
David Xu
d1fc2022c3 Backout my last commit.
Requested by: bde
2003-04-20 01:35:21 +00:00
Maxime Henrion
2ccf1ce757 style(9). 2003-04-20 01:04:04 +00:00
Alan Cox
097d4338db Lock the vm_object in vfs_busy_pages(). 2003-04-20 00:17:05 +00:00
Alan Cox
0fa05eae77 - Lock the vm_object when performing vm_object_pip_subtract().
- Assert that the vm_object lock is held in vm_object_pip_subtract().
2003-04-19 22:11:41 +00:00
Alan Cox
0d420ad3e6 - Lock the vm_object when performing vm_object_pip_wakeupn().
- Assert that the vm_object lock is held in vm_object_pip_wakeupn().
 - Add a new macro VM_OBJECT_LOCK_ASSERT().
2003-04-19 21:15:44 +00:00
Alan Cox
ea08145b76 Lock the jumbo_vm_object when performing vm_page_alloc(). 2003-04-19 19:13:25 +00:00
Maxime Henrion
6d63c80290 Make this file closer to style(9) paradigm. 2003-04-19 17:24:07 +00:00
Maxime Henrion
3566dff0d9 - Enable interrupts only at the end of epic_attach() when all the
other initializations succeeded.
- Initialize the TX and RX rings in epic_attach() rather than in
  epic_init() where we're not supposed to fail.  Similarly, free
  the TX and RX rings in epic_detach() rather than in epic_stop().
- Change epic_init() to be a void function now that it can't fail.
  Also change its parameter to a void * so that we have a correct
  prototype for if_init.
- Now that epic_init() has a correct prototype, don't cast the
  function pointer when initializing if_init.
- Fix nearby style bugs.
2003-04-19 13:51:24 +00:00
Poul-Henning Kamp
7220a9e779 Make more of the "hotspot" stuff generic:
Give the class a way to specify the necessary action for read/delete/write:
ALLOW, DENY, START or CALL.

Update geom_bsd to use this.
2003-04-19 10:14:39 +00:00
Poul-Henning Kamp
183a45f65e Create a dedicated structure for holding hotspot information rather than
using slice structures for it.
2003-04-19 10:00:22 +00:00
David Xu
95bee4c365 Test next upcall time correctly. 2003-04-19 06:16:04 +00:00
David Xu
06ce69a720 Unbreak sigaltstack syscall. sigonstack is now a function and
want proc lock be held.
2003-04-19 05:04:06 +00:00