Commit Graph

53305 Commits

Author SHA1 Message Date
Nate Lawson
a44732323f maxunit is actually one higher than the greatest currently-allocated unit
in a devclass.  All the other uses of maxunit are correct and this one was
safe since it checks the return value of devclass_get_device(), which would
always say that the highest unit device doesn't exist.

Reviewed by:	dfr
MFC after:	3 days
2005-04-03 22:23:18 +00:00
Warner Losh
523ab3b440 With pc98/include, we can have pc98 and i386 specific bus space
implementations in their own files named $MACHINE/include/bus.h.  Copy
the contents appropriately.
2005-04-03 17:47:03 +00:00
Pawel Jakub Dawidek
7e0b3120e7 - Add a missing g_io_deliver() in case of allocation failure - we didn't
completed I/O requests here.
- First allocate all needed bios, so if any of allocations fail, we can
  free memory before sending any I/O requests down.

Reported by:	Pawel Malachowski
MFC after:	3 days
2005-04-03 14:55:49 +00:00
Søren Schmidt
fa13a39e3c Fix a buglet that caused slaves to be nondetected. 2005-04-03 13:03:53 +00:00
Jeff Roberson
bcc8f66c8b - Use M_ZERO rather than explicitly calling bzero().
- Don't intermingle direct calls to lockmgr and indirect calls through
   VOPs.  This will be important in the future.
 - Dont lock the devvp's interlock just to release it on the next line by
   passing LK_INTERLOCK to lockmgr.
 - Restructure ffs_snapshot_unmount so we don't call free() with the
   devvp's interlock locked.
2005-04-03 12:03:44 +00:00
Jeff Roberson
20728d8f63 - Slightly restructure acquire() so I can add more ktr information and
an assert to help find two strange bugs.
 - Remove some nearby spls.
2005-04-03 11:49:02 +00:00
Jeff Roberson
41d4783d49 - In ffs_sync we need to pass LK_SLEEPFAIL in when we lock the vnode
because it may change identities while we're sleeping on the lock.
   Otherwise we may bail out of ffs_sync() early due to an error from
   deadfs.
 - Collapse a VOP_UNLOCK, vrele into a single vput().
2005-04-03 10:38:18 +00:00
Jeff Roberson
153910e0f5 - Move the contents of softdep_disk_prewrite into ffs_geom_strategy to fix
two bugs.
 - ffs_disk_prewrite was pulling the vp from the buf and checking for
   COPYONWRITE, when really it wanted the vp from the bufobj that we're
   writing to, which is the devvp.  This lead to us skipping the copy on
   write to all file data, which significantly broke snapshots for the
   last few months.
 - When the SOFTUPDATES option was not included in the kernel config we
   would also skip the copy on write check, which would effectively disable
   snapshots.
 - Remove an invalid mp_fixme().

Debugging tips from:	mckusick
Reported by:		iedowse, others
Discussed with:		phk
2005-04-03 10:29:55 +00:00
Jeff Roberson
f0ddc75ed0 - Now that writes to character devices supporting softupdates can
generate dirty bufs even with a locked vnode, 100 retries is not that
   many.  This should probably change from a retry count to an abort when
   we are no longer cleaning any buffers.
 - Don't call vprint() while we still hold the vnode locked.  Move the call
   to later in the function.
 - Clean up a comment.
2005-04-03 10:24:03 +00:00
Alan Cox
9f65fb13aa Remove GIANT_REQUIRED from elfN_load_section(). 2005-04-03 07:57:47 +00:00
Brooks Davis
6d9a161274 Don't init ifp->if_addrhead, if_attach() does it for us. 2005-04-03 05:21:29 +00:00
Warner Losh
722cb08d74 Fix buidling of boot blocks for pc98 with new links.
Submitted by: nyan@
2005-04-03 04:58:15 +00:00
Warner Losh
df3a103dc6 Don't forget to create new-style links for module builds.
Forgotten by: imp@
Reminded by: nyan@
2005-04-03 04:56:05 +00:00
Warner Losh
cfaacd7f0f Now that we have proper links, no need to fake up ones as part of
depend.  Now that we no longer need this hack, remove it.

Forgotten by: imp
Reminded by: nyan
2005-04-03 04:33:42 +00:00
Sam Leffler
15f139756b fix size_to_bin
Obtained from:	madwifi
2005-04-02 18:56:50 +00:00
Sam Leffler
a4d8dd103e nuke unintentional use of HAL_BOOL type 2005-04-02 18:54:30 +00:00
David Schultz
f0ceb98f93 Replace the current strspn() and strcspn() with significantly faster
implementations inspired by the ones in DragonFly.  Unlike the
DragonFly versions, these have a small data cache footprint, and my
tests show that they're never slower than the old code except when the
charset or the span is 0 or 1 characters.  This implementation is
generally faster than DragonFly until either the charset or the span
gets in the ballpark of 32 to 64 characters.
2005-04-02 18:52:44 +00:00
Alexander Leidinger
3df129097b The file machine/ieeefp.h needs sys/cdefs.h on amd64 and i386 after my
compiler features tests. This is ok, since machine/ieeefp.h is an internal
interface. But floatingpoint.h is a public interface and some ports use it,
so include sys/cdefs.h in the amd64 and i386 version of floatingpoint.h.

Note: some architectures don't provide recursive inclusion protection in
floatingpoint.h, namely alpha and ia64. Except for this part and now the
include of sys/cdefs.h, all those files are equal (from a compiler POV),
so they could be moved to only one version in src/include/.

Approved by:	joerg
2005-04-02 17:31:42 +00:00
David Schultz
0d892b4ac4 This header is supposed to declare pid_t, size_t, and time_t. 2005-04-02 12:33:36 +00:00
David Schultz
e616f979b8 Namespace issues. 2005-04-02 12:33:31 +00:00
David Schultz
5e9b87a863 Add some missing errnos from POSIX. Nothing in FreeBSD generates
these at the moment, but applications that test for them will now
have a better chance of compiling.

I have intentionally omitted errnos that are only good for STREAMS,
since apps that use STREAMS won't compile anyway.  The exception is
EPROTO, which was apparently intended for STREAMS, but worth having
anyway because Linux (mis)uses it for other things.
2005-04-02 12:33:28 +00:00
David Schultz
6d2f64c103 Define CLOCK_* and TIMER_* in time.h, where they are supposed to be. 2005-04-02 12:33:27 +00:00
David E. O'Brien
824a5e96dc nVidia AGP chipsets beyond nForce2 are AMD64-specific.
So move the AGP support to there.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
2005-04-02 01:10:09 +00:00
Warner Losh
4dd0942599 Add reach-over include files to read i386/foo.h. In time, the pc98
specific code will migrate to these files to augment or replace the
version in i386/include and/or i386/linux.  This should, in the
fullness of time, allow many of the #ifdef PC98 in the tree.

# These files are in the public domain because there is insufficient
# creative content in them.  When you customize them, please add a
# copyright notice and license.

OK'd in principle by: nyan@
2005-04-01 23:19:43 +00:00
Warner Losh
5cc3e8555f Add i386 to machine lines 2005-04-01 22:59:25 +00:00
John-Mark Gurney
0e49742d03 fix misspelling of 0x30...
Spotted by:	reviewing MFC commit
2005-04-01 22:56:37 +00:00
Warner Losh
5abe8537a0 Update version number for latest config version bump 2005-04-01 22:56:10 +00:00
Scott Long
e5bd0ae156 Make life easier on those trying to use the asr utilities by automatically
creating the /dev/dpti%d entry that the software expects.  This is just
a band-aid until either someone (hopefully) rewrites the utilities, or all
asr/dpt cards in existance get blasted into the sun.
2005-04-01 22:12:53 +00:00
John Baldwin
98df9218da - Change the vm_mmap() function to accept an objtype_t parameter specifying
the type of object represented by the handle argument.
- Allow vm_mmap() to map device memory via cdev objects in addition to
  vnodes and anonymous memory.  Note that mmaping a cdev directly does not
  currently perform any MAC checks like mapping a vnode does.
- Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the
  cdev the ioctl is acting on rather than trying to find a suitable vnode
  to map from.

Reviewed by:	alc, arch@
2005-04-01 20:00:11 +00:00
Scott Long
5ec8c336e7 FIx a botch with the addition of the arcmsr driver. 2005-04-01 19:32:12 +00:00
Warner Losh
9dd18bb07e Don't build arcmsr on pc98. The card either won't fit/work in the
pc98 machines because (a) it is PCIe or PCI-X (b) there's a BIOS that
must run at boot which assumes IBM-AT compatible boot environment.

Noticed by: scottl
2005-04-01 17:40:39 +00:00
Bill Paul
92b9707e2d Fix another KeInitializeDpc()/amd64 calling convention issue:
ndis_intrhand() has to be wrapped for the same reason as ndis_timercall().
2005-04-01 16:40:22 +00:00
John-Mark Gurney
5da5a253a5 move the statement about switching power states to just before we do it, so
we don't print a false statement if the destination powerstate is
unsupported...
2005-04-01 16:22:50 +00:00
Dag-Erling Smørgrav
8987631f85 MFi386 (1.610): let TUNABLE_ULONG_FETCH handle the suffix. 2005-04-01 10:59:13 +00:00
Warner Losh
8d42a36cf1 arcmsr_make_timespec, and arcmsr_getcmos_time appear to be unused, and
reference functions that don't exist on at least pc98.  #if 0 them
out.  This should fix the pc98 tinderbox breakage.  Tested only on
i386 and pc98.
2005-04-01 07:15:52 +00:00
Peter Grehan
98cbfce5db Introduce channel-level setmode newbus method.
Thanks to sos for the code re-org that allowed this.
2005-04-01 03:28:55 +00:00
John Baldwin
67d1e9191e Use kern_settimeofday() to avoid stackgap use. 2005-03-31 22:58:37 +00:00
John Baldwin
48052f99e7 - Use a custom version of copyinuio() to implement readv/writev using
kern_readv/writev.
- Use kern_settimeofday() and kern_adjtime() rather than stackgapping it.
2005-03-31 22:58:13 +00:00
John Baldwin
3dde27da5e - Use a custom version of copyinuio() to implement readv/writev using
kern_readv/writev.
- Use kern_sched_rr_get_interval() rather than the stackgap.
2005-03-31 22:57:21 +00:00
John Baldwin
50b584201d Use a custom version of copyinuio() to implement osf1_{read,write}v() via
kern_{read,write}v().
2005-03-31 22:56:14 +00:00
John Baldwin
fe24ab5fc5 Actually commit the code for kern_sched_get_rr_interval(). 2005-03-31 22:54:48 +00:00
Peter Wemm
8d2046fa1e Since the question keeps coming up, explain why the -mno-sse etc switches
are there and that it does not have an effect on user applications.
2005-03-31 22:53:58 +00:00
John Baldwin
b88ec951e1 Implement kern_adjtime(), kern_readv(), kern_sched_rr_get_interval(),
kern_settimeofday(), and kern_writev() to allow for further stackgap
reduction in the compat ABIs.
2005-03-31 22:51:18 +00:00
John Baldwin
e392175600 Bring back the WITNESS_WARN() check to _STOPEVENT() as all the callers have
been fixed for quite a while now.
2005-03-31 22:50:14 +00:00
John Baldwin
ea2b9b3e36 - Denote a few places where kobj class references are manipulated without
holding the appropriate lock.
- Add a comment explaining why we bump a driver's kobj class reference
  when loading a module.
2005-03-31 22:49:31 +00:00
John Baldwin
2945387fee Drop a bogus mp_fixme(). Adding a lock would do nothing to reduce userland
races regarding changing of jail-related sysctls.
2005-03-31 22:47:57 +00:00
John Baldwin
db8a98353d - Fix some sign extension problems with implicit 32 to 64 bit conversions.
- Fix the mmap2() wrapper to not truncate high addresses.

Submitted by:	Christian Zander
2005-03-31 22:47:18 +00:00
Sam Leffler
aa083c3dc6 plug resource leak
Submitted by:	mdodd
Noticed by:	Coverity Prevent analysis tool
2005-03-31 21:58:53 +00:00
Sam Leffler
23691262f0 fix potential null ptr deref
Noticed by:	Coverity Prevent analysis tool
2005-03-31 21:55:09 +00:00
Sam Leffler
001ea8fba8 avoid null ptr deref
Noticed by:	Coverity Prevent analysis tool
2005-03-31 21:53:21 +00:00