Commit graph

42438 commits

Author SHA1 Message Date
Sam Leffler b140bc1fc8 Correct pfil_run_hooks return handling: if the return value is non-zero
then the mbuf has been consumed by a hook; otherwise beware of a null
mbuf return (gack).  In particular the bridge was doing the wrong thing.
While in the ipv6 code make it's handling of pfil_run_hooks identical
to netbsd.

Pointed out by:	Pyun YongHyeon <yongari@kt-is.co.kr>
2003-09-30 04:46:08 +00:00
Peter Wemm 00f553ed0c Stop this warning:
"Makefile", line 35: warning: "grep DDB opt_ddb.h" returned non-zero status
2003-09-30 03:49:09 +00:00
Sam Leffler 9ffa96777e MFp4: portability work, general cleanup, locking fixes
change 38496
o add ipsec_osdep.h that holds os-specific definitions for portability
o s/KASSERT/IPSEC_ASSERT/ for portability
o s/SPLASSERT/IPSEC_SPLASSERT/ for portability
o remove function names from ASSERT strings since line#+file pinpints
  the location
o use __func__ uniformly to reduce string storage
o convert some random #ifdef DIAGNOSTIC code to assertions
o remove some debuggging assertions no longer needed

change 38498
o replace numerous bogus panic's with equally bogus assertions
  that at least go away on a production system

change 38502 + 38530
o change explicit mtx operations to #defines to simplify
  future changes to a different lock type

change 38531
o hookup ipv4 ctlinput paths to a noop routine; we should be
  handling path mtu changes at least
o correct potential null pointer deref in ipsec4_common_input_cb

chnage 38685
o fix locking for bundled SA's and for when key exchange is required

change 38770
o eliminate recursion on the SAHTREE lock

change 38804
o cleanup some types: long -> time_t
o remove refrence to dead #define

change 38805
o correct some types: long -> time_t
o add scan generation # to secpolicy to deal with locking issues

change 38806
o use LIST_FOREACH_SAFE instead of handrolled code
o change key_flush_spd to drop the sptree lock before purging
  an entry to avoid lock recursion and to avoid holding the lock
  over a long-running operation
o misc cleanups of tangled and twisty code

There is still much to do here but for now things look to be
working again.

Supported by:	FreeBSD Foundation
2003-09-29 22:57:43 +00:00
Sam Leffler 1a920b1142 os dependency glue file for improving portability
Submitted by:	<jonathan@decru.com>
Supported by:	FreeBSD Foundation
Obtained from:	NetBSD
2003-09-29 22:47:45 +00:00
Robert Watson 309cd88432 Add a new column to the procfs map to hold the name of the mapped
file for vnode mappings.  Note that this uses vn_fullpath() and may
be somewhat unreliable, although not too unreliable for shared
libraries.  For non-vnode mappings, just print "-" for the field.

Obtained from:	TrustedBSD Projects
Sponsored by:	DARPA, AFRL, Network Associates Laboratories
2003-09-29 20:53:19 +00:00
Robert Watson cc7b13bfe0 If the struct mac copied into the kernel has a negative length, return
EINVAL rather than failing the following malloc due to the value being
too large.
2003-09-29 18:35:17 +00:00
Scott Long 5dfa218a11 Remove the static reservations for the raid and raidctl devices. 2003-09-29 14:15:57 +00:00
Scott Long 9f099823a1 Use a dynamic major assignment for the raidctl device. 2003-09-29 14:14:35 +00:00
Scott Long ca0ef5374f aac no longer uses a static major number. 2003-09-29 14:11:23 +00:00
Scott Long c567467af2 Eliminate the use of a statically assign major number for the aac device. 2003-09-29 14:10:04 +00:00
Greg Lehey be0dabc1bc If we fail to complete configuring a subdisk because of some error,
make sure we return any allocated space to the drive.  This should get
rid of a number of inconsistencies (hopefully all) that have been seen
after configuration errors.
2003-09-29 08:50:03 +00:00
Greg Lehey 692db2e5c9 Revert last commit. It built the kernel module just fine, but broke
world in /sbin.

Reported by:	erwin
Pointy hat to:	grog
2003-09-29 08:19:06 +00:00
Poul-Henning Kamp 5774cead7a Return ENODEV in case the driver has no dump routine. 2003-09-29 07:44:23 +00:00
Nate Lawson b22df41bbd If asked to stall for more than 100 us (which is specified as the max in
the ACPI standard), call sleep instead since that is probably what the
caller meant.

Mentioned by:		peter
2003-09-29 07:29:26 +00:00
Greg Lehey 2b0761b360 Remove calls to makedev. They were never needed.
Requested by:	phk
Explained by:	rwatson
2003-09-29 03:16:20 +00:00
Mike Silbersack 43e68b5333 Add a tiny bit more delay in the xl_mii_sync function; this is necessary
for proper intialization in certain 905B + old system combinations.

Tested by:	Jakub Miziolek <jxm@obta.uw.edu.pl>
2003-09-29 02:14:04 +00:00
Poul-Henning Kamp 431021789f Retire revoke_and_destroy_dev() with extreme prejudice. 2003-09-28 20:50:36 +00:00
Poul-Henning Kamp ed692400eb I don't know from where the notion that device driver should or
even could call VOP_REVOKE() on vnodes associated with its dev_t's
has originated, but it stops right here.

If there are things people belive destroy_dev() needs to learn how to
do, please tell me about it, preferably with a reproducible test case.

Include <sys/uio.h> in bluetooth code rather than rely on <sys/vnode.h>
to do so.

The fact that some of the USB code needs to include <sys/vnode.h>
still disturbs me greatly, but I do not have time to chase that.
2003-09-28 20:48:13 +00:00
Marcel Moolenaar 6dcf0a53d2 Don't explicitly initialize d_maj in the cdevsw with MAJOR_AUTO, as
per the intentions of conf.h, rev 1.176. This change is a no-op as
MAJOR_AUTO equals to 0.
2003-09-28 18:20:42 +00:00
Poul-Henning Kamp 47a42c7aed Note change to cdevsw open/close default change. 2003-09-28 16:25:35 +00:00
Bruce Evans 90796c0860 Removed some nearly dead code in comparam(). We don't need to recover
from fiddling with CS_TTGO since fiddling with CS_TTGO was removed in
rev.1.218 of the i386/isa version (which was merged with loss of history
in rev.1.223 of this version).
2003-09-28 13:12:26 +00:00
Jake Burkholder 2eaa495767 Set the baud rate to 1200 if the device is a keyboard. 2003-09-28 07:06:34 +00:00
Jake Burkholder 278667afab Only create the ofwcons device nodes if it has been initialized, not
just probed.
2003-09-28 06:51:47 +00:00
Bruce Evans f8191f94aa Reworked rev.1.14. Use the ELF symbol type again to summarily reject
some symbols in X_db_search_symbol().  Reject the same symbols that
rev.1.13 did (all except STT_OBJECT and STT_FUNC), except don't reject
typeless symbols.  This keeps the typeless symbols in non-verbosely
written assembler code visible, but makes file symbols invisible.  ELF
file symbols have type STT_FILE and value 0, so this stops small values
and offsets sometimes being displayed in terms of the first file symbol
in the kernel (usually device_if.c).  I think it rejects some other
unwanted symbols (small absolute symbols for things like struct offsets).
It may reject some wanted symbols (large absolute symbols for addresses
like PTmap).
2003-09-28 06:02:33 +00:00
Jake Burkholder 5dbb062210 Make ofw_console a low priority console device, so that uart will be
preferred in all cases, even if the "remote" bit is not set.
2003-09-28 05:38:37 +00:00
Jake Burkholder 9ed151b5ec Add a "low" console priority. This specifies that the console device
may have limited functionality and should only be used as a last resort,
perhaps only to tell the user that they should be using something else.
2003-09-28 05:36:30 +00:00
Marcel Moolenaar c0e56dc2c3 Drop any and all support for varargs. There's no history to worry
about because we're still tier 2 and our current compiler, as well
as future compilers will not support varargs. This is mostly a
no-op in practice, because <sys/varargs.h> should already cause
compile failures.
2003-09-28 05:34:07 +00:00
Alan Cox 50028aa7d2 In vm_page_remove(), assert that the vm object is locked, unless an Alpha.
(The Alpha still requires updates to its pmap.)
2003-09-28 04:50:48 +00:00
Paul Saab 786a9b65a9 Typo when setting wirespeed. || != |
Found by:	jake
2003-09-28 04:16:16 +00:00
Alan Cox 79fa677d99 Add vm object locking to pmap_release(). 2003-09-28 00:11:15 +00:00
Marcel Moolenaar c31f2280ed Remove the regstkpages sysctl variable. We have a growable register
stack now.
2003-09-27 23:07:47 +00:00
Marcel Moolenaar fd75d71049 Part 2 of implementing rstacks: add the ability to create rstacks and
use the ability on ia64 to map the register stack. The orientation of
the stack (i.e. its grow direction) is passed to vm_map_stack() in the
overloaded cow argument. Since the grow direction is represented by
bits, it is possible and allowed to create bi-directional stacks.
This is not an advertised feature, more of a side-effect.

Fix a bug in vm_map_growstack() that's specific to rstacks and which
we could only find by having the ability to create rstacks: when
the mapped stack ends at the faulting address, we have not actually
mapped the faulting address. we need to include or cover the faulting
address.

Note that at this time mmap(2) has not been extended to allow the
creation of rstacks by processes. If such a need arises, this can
be done.

Tested on: alpha, i386, ia64, sparc64
2003-09-27 22:28:14 +00:00
Poul-Henning Kamp 98c469d484 Make life a little bit easier for cloning device drivers. 2003-09-27 21:50:00 +00:00
Poul-Henning Kamp 370d48ebe4 Add an explanation why MAJOR_AUTO should not be specified explicitly. 2003-09-27 21:49:35 +00:00
Poul-Henning Kamp 2853ad7d60 Correctly name r_unit member tun_unit.
Remove unused tun_wsel member.
2003-09-27 21:43:16 +00:00
Poul-Henning Kamp e0f86251a7 Provide a bit more help with "memory overwritten after free" style bugs. 2003-09-27 21:33:13 +00:00
Alan Cox 9060731130 Eliminate the pte object. 2003-09-27 20:53:01 +00:00
Poul-Henning Kamp b294143142 Introduce no_poll() default method for device drivers. Have it
do exactly the same as vop_nopoll() for consistency and put a
comment in the two pointing at each other.

Retire seltrue() in favour of no_poll().

Create private default functions in kern_conf.c instead of public
ones.

Change default strategy to return the bio with ENODEV instead of
doing nothing which would lead the bio stranded.

Retire public nullopen() and nullclose() as well as the entire band
of public no{read,write,ioctl,mmap,kqfilter,strategy,poll,dump}
funtions, they are the default actions now.

Move the final two trivial functions from subr_xxx.c to kern_conf.c
and retire the now empty subr_xxx.c
2003-09-27 12:53:33 +00:00
Poul-Henning Kamp 41cbb0b237 Don't use seltrue when that is not really what we mean. 2003-09-27 12:44:06 +00:00
Bruce Evans fa2e26c437 MFsio (sio.c 1.413: cleaned up and fixed setting of speeds in comparam()).
This is just a cleanup here (modulo rev.1.108 of kern/tty.c), since the
input speed can be different from to output speed and extra code to
handle both speeds naturally handled all cases.
2003-09-27 12:40:23 +00:00
Poul-Henning Kamp 25d6da1b5e forgot to remove static declaration of fdesc_poll() 2003-09-27 12:34:41 +00:00
Poul-Henning Kamp 36449dc48e Return ENOIOCTL for unknown ioctls, don't use noioctl to return ENODEV. 2003-09-27 12:27:23 +00:00
Poul-Henning Kamp f1cf3def78 fdesc_poll() called seltrue() to do the default thing, this is pointlessly
wrong when we have a default in vop_nopoll() which does the right thing.
2003-09-27 12:24:42 +00:00
Poul-Henning Kamp 04825a77a7 noopen() and noclose() is now no longer used. 2003-09-27 12:09:25 +00:00
Poul-Henning Kamp 4e5f06873f nopsize is no longer used. 2003-09-27 12:05:26 +00:00
Poul-Henning Kamp 70cd771337 The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.
2003-09-27 12:01:01 +00:00
Bruce Evans 5da172697f Cleaned up and fixed setting of speeds in comparam():
- Removed conversion of a zero input speed to the output speed.  This
  has been done better in ttioctl() since rev.1.108 of kern/tty.c
  almost 5 years ago.  comparam() did the conversion incompletely for
  the case where the output speed is also zero.  It had complications
  to avoid using zero speeds, but would still have used a zero input
  speed for setting watermarks if kern/tty.c had passed one.
- Never permit the input speed to be different from the output speed.
  There was no validity check on the input speed for the case of a zero
  output speed.  Then we didn't change the physical speeds, but we used
  the unvalidated input speed for setting watermarks and didn't return
  an error, so ttioctl() stored the unvalidated input speed in the tty
  struct where it could cause problems later.
- Removed complications that were to avoid using a divisor of 0.  The
  divisor is now always valid if the speed is accepted.
2003-09-27 11:13:59 +00:00
Bruce Evans 7872ac5542 Quick fix for bitrot in locking in the SMP case. cd_getreg() and
cd_setreg() were still using !(read_eflags() & PSL_I) as the condition
for the lock hidden by COM_LOCK() (if any) being held.  This worked
when spin mutexes and/or critical_enter() used hard interrupt disablement,
but it has caused recursion on the non-recursive mutex com_mtx since
all relevant interrupt disablement became soft.  The recursion is
harmless unless there are other bugs, but it breaks an invariant so
it is fatal if spinlocks are witnessed.
2003-09-27 10:30:03 +00:00
Max Khon 5192cc9469 Bump __FreeBSD_version for kiconv(3). 2003-09-27 09:16:18 +00:00
Poul-Henning Kamp 25ae11f8d4 Fix dev_t handling to avoid needless makedev() call. 2003-09-27 08:29:58 +00:00