]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 years agoProperly handle failure to allocate isadma bounce buffer
phk [Fri, 22 Oct 2004 19:01:10 +0000 (19:01 +0000)]
Properly handle failure to allocate isadma bounce buffer

19 years agoRemove a "needs Giant" flag from the /dev/apm compat device.
njl [Fri, 22 Oct 2004 17:17:12 +0000 (17:17 +0000)]
Remove a "needs Giant" flag from the /dev/apm compat device.

MFC after: 2 weeks

19 years agoAdd punctuation which appears to have been accidentally removed in
cperciva [Fri, 22 Oct 2004 16:44:39 +0000 (16:44 +0000)]
Add punctuation which appears to have been accidentally removed in
revision 1.6.

19 years agoI'm surprised this one was not here yet.
phk [Fri, 22 Oct 2004 16:18:15 +0000 (16:18 +0000)]
I'm surprised this one was not here yet.

To save you all a trip to CVSWEB:

Experts have correctly predicted nine out of the last five recessions.
               -- Paul Samuelson,  Nobel laureate in economics.

19 years agoRespect _BOOT flag.
simokawa [Fri, 22 Oct 2004 15:39:39 +0000 (15:39 +0000)]
Respect _BOOT flag.

19 years agoCheck _BOOT flag.
simokawa [Fri, 22 Oct 2004 15:03:22 +0000 (15:03 +0000)]
Check _BOOT flag.

19 years agoRespect RB_MULTIPLE flag.
simokawa [Fri, 22 Oct 2004 14:57:28 +0000 (14:57 +0000)]
Respect RB_MULTIPLE flag.

19 years ago- Add FireWire subclass and OHCI interface.
simokawa [Fri, 22 Oct 2004 14:56:23 +0000 (14:56 +0000)]
- Add FireWire subclass and OHCI interface.
- Add some PCI BIOS function calls.
(find_devclass, read_config, write_config)

19 years agoAdd an annotation to the comment for sysv_ipc.c to indicate that the
rwatson [Fri, 22 Oct 2004 12:12:40 +0000 (12:12 +0000)]
Add an annotation to the comment for sysv_ipc.c to indicate that the
MAC Framework doesn't require checks in ipcperm() because checks
relating to System V IPC will be performed in individual IPC
implementations.

19 years agoIn osethostname(), don't need to call suser() directly as
rwatson [Fri, 22 Oct 2004 12:10:50 +0000 (12:10 +0000)]
In osethostname(), don't need to call suser() directly as
userland_sysctl() will perform all necessary privilege checks for
the caller.

19 years agoExpand comments on various sections of the MAC Framework Policy API,
rwatson [Fri, 22 Oct 2004 11:29:30 +0000 (11:29 +0000)]
Expand comments on various sections of the MAC Framework Policy API,
as well as document the properties of the mac_policy_conf structure.
Warn about the ABI risks in changing the structure without careful
consideration.

Obtained from: TrustedBSD Project
Sponsored by: SPAWAR

19 years agoReplace direct reference to kdb_enter() with a DEBUGGER() macro that
rwatson [Fri, 22 Oct 2004 11:24:50 +0000 (11:24 +0000)]
Replace direct reference to kdb_enter() with a  DEBUGGER() macro that
will call printf() if KDB isn't compiled into the kernel.

Obtained from: TrustedBSD Project
Sponsored by: SPAWAR

19 years agoMinor white space synchronization and line wrapping.
rwatson [Fri, 22 Oct 2004 11:15:47 +0000 (11:15 +0000)]
Minor white space synchronization and line wrapping.

19 years agoIn the MAC label zone destructor, assert that the label is only
rwatson [Fri, 22 Oct 2004 11:08:52 +0000 (11:08 +0000)]
In the MAC label zone destructor, assert that the label is only
destroyed in an initialized state.

19 years agoRemove extern declaration of mac_enforce_sysv, as it's not present in
rwatson [Fri, 22 Oct 2004 11:07:18 +0000 (11:07 +0000)]
Remove extern declaration of mac_enforce_sysv, as it's not present in
the CVS version of the MAC Framework.

19 years agoWhen MAC is enabled, warn if getnewvnode() is asked to produce a vnode
rwatson [Fri, 22 Oct 2004 11:04:58 +0000 (11:04 +0000)]
When MAC is enabled, warn if getnewvnode() is asked to produce a vnode
without a mountpoint.  In this scenario, there's no useful source for
a label on the vnode, since we can't query the mountpoint for the
labeling strategy or default label.

19 years agoAlas, poor SPECFS! -- I knew him, Horatio; A filesystem of infinite
phk [Fri, 22 Oct 2004 09:59:37 +0000 (09:59 +0000)]
Alas, poor SPECFS! -- I knew him, Horatio; A filesystem of infinite
jest, of most excellent fancy: he hath taught me lessons a thousand
times; and now, how abhorred in my imagination it is! my gorge rises
at it.  Here were those hacks that I have curs'd I know not how
oft.  Where be your kludges now? your workarounds? your layering
violations, that were wont to set the table on a roar?

Move the skeleton of specfs into devfs where it now belongs and
bury the rest.

19 years agoAdd NO_BLUETOOTH and NO_AUTHPF variables. [1]
blackend [Fri, 22 Oct 2004 08:49:54 +0000 (08:49 +0000)]
Add NO_BLUETOOTH and NO_AUTHPF variables. [1]
While I'm there use lowercase "yes" for consistency.

Approved by: phk [1]

19 years agoAdd b_bufobj to struct buf which eventually will eliminate the need for b_vp.
phk [Fri, 22 Oct 2004 08:47:20 +0000 (08:47 +0000)]
Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.

Initialize b_bufobj for all buffers.

Make incore() and gbincore() take a bufobj instead of a vnode.

Make inmem() local to vfs_bio.c

Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj)
also VI_MTX() to BO_MTX(),

Make buf_vlist_add() take a bufobj instead of a vnode.

Eliminate other uses of bp->b_vp where bp->b_bufobj will do.

Various minor polishing: remove "register", turn panic into KASSERT,
use new function declarations, TAILQ_FOREACH_SAFE() etc.

19 years agoSort NO* variables.
blackend [Fri, 22 Oct 2004 08:45:34 +0000 (08:45 +0000)]
Sort NO* variables.

Approved by: phk

19 years agoUse bioq_takefirst()
phk [Fri, 22 Oct 2004 08:12:49 +0000 (08:12 +0000)]
Use bioq_takefirst()

19 years agoremoved compilation warning
suz [Fri, 22 Oct 2004 07:31:12 +0000 (07:31 +0000)]
removed compilation warning

PR: bin/71624

19 years agoCorrect and clarify some very incorrect text.
scottl [Fri, 22 Oct 2004 05:21:20 +0000 (05:21 +0000)]
Correct and clarify some very incorrect text.

19 years agoSeperate ia64 from the pack. The disc1 is overflowing to such extend
marcel [Fri, 22 Oct 2004 04:49:09 +0000 (04:49 +0000)]
Seperate ia64 from the pack. The disc1 is overflowing to such extend
that most packages can not be included. It's much easier to list those
that we do want on disc1 for ia64. We only need to list 11 of them.

Apply proper indentation for better readability.

19 years agoDocument the 21610SA card.
scottl [Fri, 22 Oct 2004 04:17:28 +0000 (04:17 +0000)]
Document the 21610SA card.

19 years agoMerge files peter takes off the vendor branch
ache [Thu, 21 Oct 2004 23:45:57 +0000 (23:45 +0000)]
Merge files peter takes off the vendor branch

19 years agoFix some more files that got butchered to appear to be back on the
peter [Thu, 21 Oct 2004 20:10:14 +0000 (20:10 +0000)]
Fix some more files that got butchered to appear to be back on the
vendor branch again.  (These will need a readline import merge too)

19 years agoForce these files back off the vendor branch. They should NEVER have been
peter [Thu, 21 Oct 2004 20:02:02 +0000 (20:02 +0000)]
Force these files back off the vendor branch.  They should NEVER have been
put back on there in the first place. :-(

Note that complete.c will need a readline 5.0 merge.

19 years agoAdd support for the 21610SA 16-channel SATA card. Thanks to Adaptec for
scottl [Thu, 21 Oct 2004 19:14:32 +0000 (19:14 +0000)]
Add support for the 21610SA 16-channel SATA card.  Thanks to Adaptec for
providing hardware for testing.

19 years agoAdd KTR_GEOM, which allows tracing of basic GEOM I/O events occuring
rwatson [Thu, 21 Oct 2004 18:35:24 +0000 (18:35 +0000)]
Add KTR_GEOM, which allows tracing of basic GEOM I/O events occuring
in the g_up and g_down threads.  Each time a bio is propelled up and
down the stack, an event is generating showing the provider, offset,
and length, as well as thread wakeup and work status information.

19 years agoMove the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAIT
phk [Thu, 21 Oct 2004 15:53:54 +0000 (15:53 +0000)]
Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAIT

Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write
count on a bufobj.  Bufobj_wdrop() replaces vwakeup().

Use these functions all relevant places except in ffs_softdep.c where
the use if interlocked_sleep() makes this impossible.

Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.

19 years agoAdd BO_* macros parallel to VI_* macros for manipulating the bo_mtx.
phk [Thu, 21 Oct 2004 14:42:31 +0000 (14:42 +0000)]
Add BO_* macros parallel to VI_* macros for manipulating the bo_mtx.

Initialize the bo_mtx when we allocate a vnode i getnewvnode() For
now we point to the vnodes interlock mutex, that retains the exact
same locking sematics.

Move v_numoutput from vnode to bufobj.  Add renaming macro to
postpone code sweep.

19 years agoPolish vtruncbuf() to improve readability and style a bit.
phk [Thu, 21 Oct 2004 14:13:54 +0000 (14:13 +0000)]
Polish vtruncbuf() to improve readability and style a bit.

19 years agoRemove NOLIBPTHREAD=yes since BIND related binaries (dig etc.) require
blackend [Thu, 21 Oct 2004 13:56:24 +0000 (13:56 +0000)]
Remove NOLIBPTHREAD=yes since BIND related binaries (dig etc.) require
LIBPTHREAD.

Approved by: phk

19 years agoSimplify buf_vlist_remove().
phk [Thu, 21 Oct 2004 13:48:50 +0000 (13:48 +0000)]
Simplify buf_vlist_remove().

Now that we have encapsulated the splaytree related information
into a structure we can eliminate the half of this function.

19 years agoForced commit to get the right commit message:
phk [Thu, 21 Oct 2004 12:51:36 +0000 (12:51 +0000)]
Forced commit to get the right commit message:

Add new include file <sys/bufobj.h> which will contain the gory
details on the new buffer-cache object. (see comments in file
about the direction this is moving).

Include it from <sys/vnode.h> for now to avoid munging a lot of files
which can later be munged back.

Embed a bufobj in vnode.

Move the buf splay trees from the vnode to the bufobj.

Alias the fields to avoid sweeping code yet.

Hide vnode and bufobj behind

#if defined(_KERNEL) || defined(_KVM_VNODE)

to discourage userland voyeurism.

19 years agoAdd new function ttyinitmode() which sets our systemwide default
phk [Thu, 21 Oct 2004 12:24:38 +0000 (12:24 +0000)]
Add new function ttyinitmode() which sets our systemwide default
modes on a tty structure.  Both the ".init" and the current settings
are initialized allowing the function to be used both at attach and
open time.

The function takes an argument to decide if echoing should be enabled
by default.  Echoing should not be enabled for regular physical
serial ports unless they are consoles, in which case they should
be configured by ttyconsolemode() instead.

Use the new function throughout.

19 years agoAdd -D_KVM_VNODE to indicate that despite being a userland program,
phk [Thu, 21 Oct 2004 12:09:45 +0000 (12:09 +0000)]
Add -D_KVM_VNODE to indicate that despite being a userland program,
we want to know the vnode structures internals.

19 years agoWe want to ignore BUS_DMASYNC_POSTWRITE, not BUS_DMASYNC_POSTREAD.
cognet [Thu, 21 Oct 2004 11:59:33 +0000 (11:59 +0000)]
We want to ignore BUS_DMASYNC_POSTWRITE, not BUS_DMASYNC_POSTREAD.
Spotted out by: mux
Pointy hat to: cognet

19 years agoBump copyright dates for NETA on these files.
rwatson [Thu, 21 Oct 2004 11:29:56 +0000 (11:29 +0000)]
Bump copyright dates for NETA on these files.

19 years agoRemove unnecessary include of vnode.h.
rwatson [Thu, 21 Oct 2004 11:22:07 +0000 (11:22 +0000)]
Remove unnecessary include of vnode.h.

Requested by: phk

19 years agoModify libugidfw(3) to use MBI_* permission flags from mac_bsdextended.h
rwatson [Thu, 21 Oct 2004 11:21:13 +0000 (11:21 +0000)]
Modify libugidfw(3) to use MBI_* permission flags from mac_bsdextended.h
instead of using the V* permission flags from vnode.h.  Remove include
of vnode.h.

Requested by: phk

19 years agoModify mac_bsdextended policy so that it defines its own vnode access
rwatson [Thu, 21 Oct 2004 11:19:02 +0000 (11:19 +0000)]
Modify mac_bsdextended policy so that it defines its own vnode access
right bits rather than piggy-backing on the V* rights defined in
vnode.h.  The mac_bsdextended bits are given the same values as the V*
bits to make the new kernel module binary compatible with the old
version of libugidfw that uses V* bits.  This avoids leaking kernel
API/ABI to user management tools, and in particular should remove the
need for libugidfw to include vnode.h.

Requested by: phk

19 years agoPass WORLD_FLAGS down to the distributeworld target, so it's
ru [Thu, 21 Oct 2004 08:54:10 +0000 (08:54 +0000)]
Pass WORLD_FLAGS down to the distributeworld target, so it's
possible to build releases with customizations such as with
NOPROFILE.

Problem found and fix tested by Roman Neuhauser.

19 years agoDecrease reference count if we won't use the thread, this avoids memory
davidxu [Thu, 21 Oct 2004 03:42:24 +0000 (03:42 +0000)]
Decrease reference count if we won't use the thread, this avoids memory
leak under some cases.

19 years agoZero terminate empty sting in kdb_sysctl_available.
ups [Thu, 21 Oct 2004 01:11:25 +0000 (01:11 +0000)]
Zero terminate empty sting in kdb_sysctl_available.

Approved by:    sam (mentor)
MFC after: 1 week

19 years agoBump the document date, s/filesystem/file system/ and add missing word.
keramida [Wed, 20 Oct 2004 19:05:50 +0000 (19:05 +0000)]
Bump the document date, s/filesystem/file system/ and add missing word.

Noticed by: ru

19 years agoModify the vm object locking in do_sendfile() so that the containing object
alc [Wed, 20 Oct 2004 17:44:40 +0000 (17:44 +0000)]
Modify the vm object locking in do_sendfile() so that the containing object
is locked when vm_page_io_finish() is called on a page.  This is to satisfy
a new, post-RELENG_5 assertion in vm_page_io_finish().  (I am in the
process of transitioning the responsibility for synchronizing access to
various fields/flags on the page from the global page queues lock to the
per-object lock.)

Tripped over by: obrien@

19 years agoIntroduce root_rw_mount as a new variable in defaults/rc.conf to
keramida [Wed, 20 Oct 2004 16:58:28 +0000 (16:58 +0000)]
Introduce root_rw_mount as a new variable in defaults/rc.conf to
unbreak /etc/rc.d/root for diskless systems that get their root
filesystem from a read-only NFS mount.

PR: conf/72927
Submitted by: Ralf Wenk <RZ-FreeBSD1004@fh-karlsruhe.de>
Reviewed by: brooks

19 years agoFix a typo so that this compiles.
jhb [Wed, 20 Oct 2004 16:22:53 +0000 (16:22 +0000)]
Fix a typo so that this compiles.

19 years agoFix a typo so that this compiles again.
jhb [Wed, 20 Oct 2004 16:22:00 +0000 (16:22 +0000)]
Fix a typo so that this compiles again.

19 years ago-c flag (cache stats) was killed in rev. 1.68. Fix getopt(3) and
maxim [Wed, 20 Oct 2004 11:18:31 +0000 (11:18 +0000)]
-c flag (cache stats) was killed in rev. 1.68.  Fix getopt(3) and
usage() accordingly.

Submitted by: Pawel Worach

19 years agoFix typo.
simon [Wed, 20 Oct 2004 10:11:12 +0000 (10:11 +0000)]
Fix typo.

Submitted by: Patrick Oonk <patrick@cookie.monster.org>
PR: docs/72912
MFC after: 1 week

19 years agoDo not retry on requests that has lost thier device during reinit.
sos [Wed, 20 Oct 2004 10:11:05 +0000 (10:11 +0000)]
Do not retry on requests that has lost thier device during reinit.

Should fix hangs on IBM's etc with the fake slave problem.

MFC:
asap

19 years agoExplicitly break out NETA license from Berkeley license to clearly
rwatson [Wed, 20 Oct 2004 08:05:02 +0000 (08:05 +0000)]
Explicitly break out NETA license from Berkeley license to clearly
indicate license grant, as well as to indicate that NETA is asserting
only two clauses, not four clauses.

Requested by: imp

19 years agoDon't prepend "/dev" if an argument given is an absolute pathname.
ru [Wed, 20 Oct 2004 05:43:45 +0000 (05:43 +0000)]
Don't prepend "/dev" if an argument given is an absolute pathname.

Reviewed by: jhb

19 years agoRumor has it that ACCTON EN2216 is also an ne2000 compatible. Make it so.
imp [Wed, 20 Oct 2004 04:54:50 +0000 (04:54 +0000)]
Rumor has it that ACCTON EN2216 is also an ne2000 compatible.  Make it so.

19 years agoAdd missing bus_dmamap_sync() calls. If you are using an architecture
mux [Tue, 19 Oct 2004 23:31:44 +0000 (23:31 +0000)]
Add missing bus_dmamap_sync() calls.  If you are using an architecture
with a weak memory model or x86 + PAE (or more specifically, your
driver is using bounce pages) and you have had problems with em(4),
this may fix it.  At least this is needed to have em(4) work properly
on FreeBSD/arm.

Original version by: cognet
Reviewed by: tackerman
Tested by: cognet

19 years agoDestroy the UMA zone on unload.
andre [Tue, 19 Oct 2004 22:51:20 +0000 (22:51 +0000)]
Destroy the UMA zone on unload.

19 years agoSlightly extend the locking during unload to fully cover the protocol
andre [Tue, 19 Oct 2004 22:08:13 +0000 (22:08 +0000)]
Slightly extend the locking during unload to fully cover the protocol
deregistration.  This does not entirely close the race but narrows the
even previously extremely small chance of a race some more.

19 years agoAnnotate a newly introduced race present due to the unloading of
rwatson [Tue, 19 Oct 2004 21:35:42 +0000 (21:35 +0000)]
Annotate a newly introduced race present due to the unloading of
protocols: it is possible for sockets to be created and attached
to the divert protocol between the test for sockets present and
successful unload of the registration handler.  We will need to
explore more mature APIs for unregistering the protocol and then
draining consumers, or an atomic test-and-unregister mechanism.

19 years agoConvert IPDIVERT into a loadable module. This makes use of the dynamic loadability
andre [Tue, 19 Oct 2004 21:14:57 +0000 (21:14 +0000)]
Convert IPDIVERT into a loadable module.  This makes use of the dynamic loadability
of protocols.  The call to divert_packet() is done through a function pointer.  All
semantics of IPDIVERT remain intact.  If IPDIVERT is not loaded ipfw will refuse to
install divert rules and  natd will complain about 'protocol not supported'.  Once
it is loaded both will work and accept rules and open the divert socket.  The module
can only be unloaded if no divert sockets are open.  It does not close any divert
sockets when an unload is requested but will return EBUSY instead.

19 years agoProperly declare the "net.inet" sysctl subtree.
andre [Tue, 19 Oct 2004 21:06:14 +0000 (21:06 +0000)]
Properly declare the "net.inet" sysctl subtree.

19 years agoPre-emptively define IPPROTO_SPACER to 32767, the same value as PROTO_SPACER
andre [Tue, 19 Oct 2004 20:59:01 +0000 (20:59 +0000)]
Pre-emptively define IPPROTO_SPACER to 32767, the same value as PROTO_SPACER
to document that this value is globally assigned for a special purpose and
may not be reused within the IPPROTO number space.

19 years agoaic7xxx.h:
gibbs [Tue, 19 Oct 2004 20:48:06 +0000 (20:48 +0000)]
aic7xxx.h:
Add constants for SPI protocol delays that are needed for
target mode.

aic7xxx.c:
Correct a target mode issue that caused an occassional
spurious REQ to be seen on the bus when performing manual
message processing (e.g. transfer rate negotiation).

Enforce phase change bus settle rules with explicit
delays when performing manual message processing in
target mode.  The sequencer already did this for
"fast-path", target mode message processing.

19 years ago- Removed the .CURDIR/.OBJDIR magic, it is not necessary here.
ru [Tue, 19 Oct 2004 20:38:49 +0000 (20:38 +0000)]
- Removed the .CURDIR/.OBJDIR magic, it is not necessary here.
- Let the built-in sys.mk rule produce the "yearistype" script.
- Install zone files with mode 444 (now that the -m option of
  zic(8) has been fixed).

19 years agoMake the -m option actually work.
ru [Tue, 19 Oct 2004 20:30:09 +0000 (20:30 +0000)]
Make the -m option actually work.

19 years agoIdle the channel earlier in reinit().
sos [Tue, 19 Oct 2004 20:13:38 +0000 (20:13 +0000)]
Idle the channel earlier in reinit().
Cosmetic change to suspend, dont call tsleep an extra time at exit.

19 years agoCosmetics
sos [Tue, 19 Oct 2004 20:11:23 +0000 (20:11 +0000)]
Cosmetics

19 years agoReally really fix typo this time.
bms [Tue, 19 Oct 2004 20:02:07 +0000 (20:02 +0000)]
Really really fix typo this time.

19 years agoDefine IFF_LOCKGIANT() and IFF_UNLOCKGIANT() macros, which conditionally
rwatson [Tue, 19 Oct 2004 18:11:55 +0000 (18:11 +0000)]
Define IFF_LOCKGIANT() and IFF_UNLOCKGIANT() macros, which conditionally
acquire Giant if the passed interface has IFF_NEEDSGIANT set on it.
Modify calls into (ifp)->if_ioctl() in if.c to use these macros in order
to ensure that Giant is held.

MFC after: 3 days
Bumped into by: jmg

19 years agoThis is now WARNS 6 clean on 64-bit platforms.
obrien [Tue, 19 Oct 2004 18:09:29 +0000 (18:09 +0000)]
This is now WARNS 6 clean on 64-bit platforms.

19 years agolibsmb is now WARNS 2 clean on 64-bit platforms.
obrien [Tue, 19 Oct 2004 18:07:26 +0000 (18:07 +0000)]
libsmb is now WARNS 2 clean on 64-bit platforms.

19 years agostyle.Makefile(5)
obrien [Tue, 19 Oct 2004 18:06:29 +0000 (18:06 +0000)]
style.Makefile(5)

19 years ago+ Get prototypes for libc functions.
obrien [Tue, 19 Oct 2004 17:44:31 +0000 (17:44 +0000)]
+ Get prototypes for libc functions.
+ Use the correct printf format for size_t.

19 years agoSize matters. Correctly use a size_t so 64-bit hosts can mount SMB FS's
obrien [Tue, 19 Oct 2004 17:39:15 +0000 (17:39 +0000)]
Size matters.  Correctly use a size_t so 64-bit hosts can mount SMB FS's
when using character set conversions.
Also include POSIX <string.h> vs. BSD <strings.h> now that we've broken
traditional BSD behavior [and compatibility with our BSD brethren].

PR: 72445
Submitted by: Vladimir Nechitailo <nechit@lpi.ru>
Patch by: Stasys Smailys <ssmailys@komvista.lt>

19 years agoApply README guidelines (no tabs).
ru [Tue, 19 Oct 2004 17:32:56 +0000 (17:32 +0000)]
Apply README guidelines (no tabs).

19 years agoDefine "I386_CPU" if CPUTYPE is 'i386'. Userland bits can check for "I386_CPU"
obrien [Tue, 19 Oct 2004 17:25:33 +0000 (17:25 +0000)]
Define "I386_CPU" if CPUTYPE is 'i386'.  Userland bits can check for "I386_CPU"
to determine if they should select code paths suitable for the 80386 CPU.

Suggested by: ru

19 years agoFix typo sc -> dev.
bms [Tue, 19 Oct 2004 16:47:53 +0000 (16:47 +0000)]
Fix typo sc -> dev.

19 years agoMake use of the PROTO_SPACER functionality for dynamically loadable
andre [Tue, 19 Oct 2004 15:58:22 +0000 (15:58 +0000)]
Make use of the PROTO_SPACER functionality for dynamically loadable
protocols in inetsw[] and define initially eight spacer slots.

Remove conflicting declaration 'struct pr_usrreqs nousrreqs'.  It is
now declared and initialized in kern/uipc_domain.c.

19 years agoSupport for dynamically loadable and unloadable IP protocols in the ipmux.
andre [Tue, 19 Oct 2004 15:45:57 +0000 (15:45 +0000)]
Support for dynamically loadable and unloadable IP protocols in the ipmux.

With pr_proto_register() it has become possible to dynamically load protocols
within the PF_INET domain.  However the PF_INET domain has a second important
structure called ip_protox[] that is derived from the 'struct protosw inetsw[]'
and takes care of the de-multiplexing of the various protocols that ride on
top of IP packets.

The functions ipproto_[un]register() allow to dynamically adjust the ip_protox[]
array mux in a consistent and easy way.  To register a protocol within
ip_protox[] the existence of a corresponding and matching protocol definition
in inetsw[] is required.  The function does not allow to overwrite an already
registered protocol.  The unregister function simply replaces the mux slot with
the default index pointer to IPPROTO_RAW as it was previously.

19 years agoDetach the Rhine completely on shutdown, rather than merely stopping it
bms [Tue, 19 Oct 2004 15:30:47 +0000 (15:30 +0000)]
Detach the Rhine completely on shutdown, rather than merely stopping it
as the original logic did. This fixes a race with vr_intr() which was
masked on UP systems and manifested on SMP systems.

PR: kern/62889
MFC after: 1 day

19 years agoSupport for dynamically loadable and unloadable protocols within existing protocol
andre [Tue, 19 Oct 2004 15:13:30 +0000 (15:13 +0000)]
Support for dynamically loadable and unloadable protocols within existing protocol
families.

The protosw[] array of any particular protocol family ("domain") is of fixed size
defined at compile time.  This made it impossible to dynamically add or remove any
protocols to or from it.  We work around this by introducing so called SPACER's
which are embedded into the protosw[] array at compile time.  The SPACER's have
a special protocol number (32767) to indicate the fact that they are SPACER's but
are otherwise NULL.  Only as many protocols can be dynamically loaded as SPACER's
are provided in the protosw[] structure.

The pr_usrreqs structure is treated more special and contains pointers to dummy
functions only returning EOPNOTSUPP.  This is needed because the use of those
functions pointers is usually not checked within the kernel because until now it
was assumed to be a valid function pointer.  Instead of fixing all potential
callers we just return a proper error code.

Two new functions provide a clean API to register and unregister a protocol.  The
register function expects a pointer to a valid and complete struct protosw including
a pointer to struct pru_usrreqs provided by the caller.  Upon successful registration
the pr_init() function will be called to finish initialization of the protocol.  The
unregister function restores the SPACER in place of the protocol again.  It is the
responseability of the caller to ensure proper closing of all sockets and freeing
of memory allocation by the unloading protocol.

 sys/protosw.h

  o Define generic PROTO_SPACER to be 32767
  o Prototypes for all pru_*_notsupp() functions
  o Prototypes for pf_proto_[un]register() functions

 kern/uipc_domain.c

  o Global struct pr_usrreqs nousrreqs containing valid pointers to the
    pru_*_notsupp() functions
  o New functions pf_proto_[un]register()

 kern/uipc_socket2.c

  o New functions bodies for all pru_*_notsupp() functions

19 years agoAdd a macro for the destruction of INP_INFO_LOCK's used by loadable modules.
andre [Tue, 19 Oct 2004 14:34:13 +0000 (14:34 +0000)]
Add a macro for the destruction of INP_INFO_LOCK's used by loadable modules.

19 years agoMake comments more clear. Change the order of one if() statement to check the
andre [Tue, 19 Oct 2004 14:31:56 +0000 (14:31 +0000)]
Make comments more clear.  Change the order of one if() statement to check the
more likely variable first.

19 years agoBe more careful to only index valid IP protocols and be more verbose with
andre [Tue, 19 Oct 2004 14:26:44 +0000 (14:26 +0000)]
Be more careful to only index valid IP protocols and be more verbose with
comments.

19 years agoReturn the unit number of a channel instead of a hardcoded '1' from
le [Tue, 19 Oct 2004 10:29:00 +0000 (10:29 +0000)]
Return the unit number of a channel instead of a hardcoded '1' from
the ATA pccard locking function.  This makes pccard devices like
Compact Flash cards work again.

PR:             kern/72805
Submitted by:   James E. Flemer <jflemer@alum.rpi.edu>
MFC in:         2 days

19 years agoForced commit to note that the previous change also elimates calls to
scottl [Tue, 19 Oct 2004 02:44:38 +0000 (02:44 +0000)]
Forced commit to note that the previous change also elimates calls to
bus_dmamap_create|destroy for the rx and tx descriptor buffers.  Since these
buffers are created with bus_dmamem_alloc(), there is no reason to also
create a map, and doing so just wastes memory.

19 years agoUse and alignment of 1 instead of ETHER_ALIGN for rx and tx buffers and jumbo
scottl [Tue, 19 Oct 2004 02:42:49 +0000 (02:42 +0000)]
Use and alignment of 1 instead of ETHER_ALIGN for rx and tx buffers and jumbo
frames.  BGE hardware with the rx alignment bug will still be handled by the
calls to m_adj() that already exist.  m_adj() is probably better suited for
this task anyways.  Just as with if_em, this saves a malloc + several locks
per packet and prevents unneeded data copying within busdma.

19 years agoUse an alignment of 1 instead of PAGE_SIZE for the rx and tx buffer tags.
scottl [Tue, 19 Oct 2004 02:39:27 +0000 (02:39 +0000)]
Use an alignment of 1 instead of PAGE_SIZE for the rx and tx buffer tags.
Since the e1000 DMA engines hava no constraints on the alignment of buffer
transfers, there is no reason to tell busdma that there is.  This save a
minimum of 1 malloc call per packet, which translates to eliminating 4 locks.
It also means that buffers are not needlessly bounced when transfered.  The
end result is a 38% improvement in pps in a 4 way bridging environment.

Obtained from: Sandvine, Inc.

19 years agoWhen dumpdev is set to 'auto', and a suitable swap device is found,
thomas [Mon, 18 Oct 2004 23:40:13 +0000 (23:40 +0000)]
When dumpdev is set to 'auto', and a suitable swap device is found,
create a symbolic link /dev/dumpdev designating that device so
savecore can find and save a previous kernel dump.

19 years agofix (for me) the problems where if_de gets really slow after time
jmg [Mon, 18 Oct 2004 23:06:12 +0000 (23:06 +0000)]
fix (for me) the problems where if_de gets really slow after time
(usually taking 20 seconds to transmit a packet).. no longer fall back
to only transmitting one packet (instead of the entire queue) after we
have processed the entire send queue...  I have no idea why we didn't
start seeing this problem ~6 years ago when this code was introduced...

19 years agoPush acquisition of the accept mutex out of sofree() into the caller
rwatson [Mon, 18 Oct 2004 22:19:43 +0000 (22:19 +0000)]
Push acquisition of the accept mutex out of sofree() into the caller
(sorele()/sotryfree()):

- This permits the caller to acquire the accept mutex before the socket
  mutex, avoiding sofree() having to drop the socket mutex and re-order,
  which could lead to races permitting more than one thread to enter
  sofree() after a socket is ready to be free'd.

- This also covers clearing of the so_pcb weak socket reference from
  the protocol to the socket, preventing races in clearing and
  evaluation of the reference such that sofree() might be called more
  than once on the same socket.

This appears to close a race I was able to easily trigger by repeatedly
opening and resetting TCP connections to a host, in which the
tcp_close() code called as a result of the RST raced with the close()
of the accepted socket in the user process resulting in simultaneous
attempts to de-allocate the same socket.  The new locking increases
the overhead for operations that may potentially free the socket, so we
will want to revise the synchronization strategy here as we normalize
the reference counting model for sockets.  The use of the accept mutex
in freeing of sockets that are not listen sockets is primarily
motivated by the potential need to remove the socket from the
incomplete connection queue on its parent (listen) socket, so cleaning
up the reference model here may allow us to substantially weaken the
synchronization requirements.

RELENG_5_3 candidate.

MFC after: 3 days
Reviewed by: dwhite
Discussed with: gnn, dwhite, green
Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de>
Reported by: Vlad <marchenko at gmail dot com>

19 years agouniq(1) is not an install tool, and using it was causing
ru [Mon, 18 Oct 2004 22:18:23 +0000 (22:18 +0000)]
uniq(1) is not an install tool, and using it was causing
"uniq: not found" during the installworld.

Spotted by: Roman Neuhauser

19 years agoAdd new function ttyinitmode() which sets our systemwide default
phk [Mon, 18 Oct 2004 21:51:27 +0000 (21:51 +0000)]
Add new function ttyinitmode() which sets our systemwide default
modes on a tty structure.

Both the ".init" and the current settings are initialized allowing
the function to be used both at attach and open time.

The function takes an argument to decide if echoing should be enabled.
Echoing should not be enabled for regular physical serial ports
unless they are consoles, in which case they should be configured
by ttyconsolemode() instead.

Use the new function throughout.

19 years agoUtilize SCRIPTS.
ru [Mon, 18 Oct 2004 21:44:17 +0000 (21:44 +0000)]
Utilize SCRIPTS.

19 years agoUtilize FILES, SCRIPTS, and SYMLINKS. While here, fixed a bug in
ru [Mon, 18 Oct 2004 21:42:15 +0000 (21:42 +0000)]
Utilize FILES, SCRIPTS, and SYMLINKS.  While here, fixed a bug in
the implementation of the following feature in revision 1.4:

- Install Makefile.yp as /var/yp/Makefile.dist and link it to
  /var/yp/Makefile only if /var/yp/Makefile doesn't already exist.
  Suggested by Peter Wemm.

The actual code was only symlinking when no /var/yp/Makefile.dist
existed, i.e., never.

19 years agoDrop the NDIS lock before returning from ndis_start().
le [Mon, 18 Oct 2004 21:33:56 +0000 (21:33 +0000)]
Drop the NDIS lock before returning from ndis_start().

PR:             i386/72795
Submitted by:   Frank Mayhar <frank@exit.com>
MFC in:         3 days

19 years agoCatch up with PHK's sio(4) rework [sys/dev/sio/sio.c rev. 1.456].
obrien [Mon, 18 Oct 2004 21:31:05 +0000 (21:31 +0000)]
Catch up with PHK's sio(4) rework [sys/dev/sio/sio.c rev. 1.456].
Also catch up with RCng.

Reviewed by: phk

19 years agoUtilize SCRIPTS.
ru [Mon, 18 Oct 2004 21:29:20 +0000 (21:29 +0000)]
Utilize SCRIPTS.