dragonfly.git
18 years agoAdd the ips driver to GENERIC.
Matthew Dillon [Thu, 24 Nov 2005 23:01:58 +0000 (23:01 +0000)]
Add the ips driver to GENERIC.

Requested-by: Tomaz Borstnar <tomaz.borstnar@over.net>
18 years ago- Ansify function definitions.
Sascha Wildner [Thu, 24 Nov 2005 22:23:03 +0000 (22:23 +0000)]
- Ansify function definitions.

- Move function type on a separate line.

18 years agoMove individual parameter comments into the general comment.
Sascha Wildner [Thu, 24 Nov 2005 17:18:30 +0000 (17:18 +0000)]
Move individual parameter comments into the general comment.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years ago- Note that 'make upgrade' not only upgrades /etc but the whole system.
Sascha Wildner [Thu, 24 Nov 2005 16:33:03 +0000 (16:33 +0000)]
- Note that 'make upgrade' not only upgrades /etc but the whole system.

- Add some words of warning about running 'make upgrade' before
  'make installworld'.

18 years agoFix LINT kernel; spin_lock function definitions have been split into
YONETANI Tomokazu [Thu, 24 Nov 2005 02:16:17 +0000 (02:16 +0000)]
Fix LINT kernel; spin_lock function definitions have been split into
<sys/spinlock2.h>, so one has to explicitly #include it to use these
functions now.

18 years agoFix some minor bugs in lwkt_serialize_handler*() which upcoming code will
Matthew Dillon [Wed, 23 Nov 2005 22:54:22 +0000 (22:54 +0000)]
Fix some minor bugs in lwkt_serialize_handler*() which upcoming code will
depend on.

18 years agoRemove forgotten K&R parameter declaration.
Sascha Wildner [Wed, 23 Nov 2005 08:55:59 +0000 (08:55 +0000)]
Remove forgotten K&R parameter declaration.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoAdd an XXX comment to document that the initializations are for silencing
Sascha Wildner [Wed, 23 Nov 2005 08:51:56 +0000 (08:51 +0000)]
Add an XXX comment to document that the initializations are for silencing
GCC warnings.

Requested-by: joerg
Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoRemove prototypes for hidden functions. We'll deal with that later
Sascha Wildner [Wed, 23 Nov 2005 08:50:34 +0000 (08:50 +0000)]
Remove prototypes for hidden functions. We'll deal with that later
appropriately.

Requested-by: joerg
Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoAdd a lwkt_serialize_try() API function.
Matthew Dillon [Wed, 23 Nov 2005 01:27:55 +0000 (01:27 +0000)]
Add a lwkt_serialize_try() API function.

18 years agoMove ef.4 from sys/net/ef to share/man/man4.
Sascha Wildner [Tue, 22 Nov 2005 09:36:58 +0000 (09:36 +0000)]
Move ef.4 from sys/net/ef to share/man/man4.

18 years agoConsolidate the initialization of td_mpcount into lwkt_init_thread().
Matthew Dillon [Tue, 22 Nov 2005 08:41:06 +0000 (08:41 +0000)]
Consolidate the initialization of td_mpcount into lwkt_init_thread().

Fix a bug in kern.trap_mpsafe, the mplock was not being properly released
when operating in vm86 mode (when kern.trap_mpsafe was set to 1).

18 years agoDo not try to set up hardware vectors for software interrupts.
Matthew Dillon [Tue, 22 Nov 2005 06:13:42 +0000 (06:13 +0000)]
Do not try to set up hardware vectors for software interrupts.

18 years agoDocument the fact that the vm86 instruction emulator is MPSAFE.
Matthew Dillon [Tue, 22 Nov 2005 04:09:38 +0000 (04:09 +0000)]
Document the fact that the vm86 instruction emulator is MPSAFE.

18 years agoRemove unused label.
Matthew Dillon [Tue, 22 Nov 2005 03:58:34 +0000 (03:58 +0000)]
Remove unused label.

18 years agoAdd a sysctl and tunable kern.trap_mpsafe which allows some traps to run
Matthew Dillon [Tue, 22 Nov 2005 01:52:25 +0000 (01:52 +0000)]
Add a sysctl and tunable kern.trap_mpsafe which allows some traps to run
without having to hold the MP lock.  The more sophisticated traps, such as
a VM fault, will still obtain the MP lock.  The sysctl is disabled (0)
by default.

The main thing effected by turning this on is T_ASTFLT, which is used to
switch away from a user process to either a kernel thread (non preemptively)
or another user process.  When enabled, switching from a user process to
a kernel thread and back again will not require the MP lock.  However, the
real benefit will not be realized until more kernel threads run without the
MP lock.

18 years agoWrap psignal() and a few other places that require the MP lock when
Matthew Dillon [Tue, 22 Nov 2005 00:49:18 +0000 (00:49 +0000)]
Wrap psignal() and a few other places that require the MP lock when
events occur while returning from a system call.

18 years agoFix the design of ifq_dequeue/altq_dequeue by adding an mbuf pointer and
Matthew Dillon [Tue, 22 Nov 2005 00:24:35 +0000 (00:24 +0000)]
Fix the design of ifq_dequeue/altq_dequeue by adding an mbuf pointer and
requiring that a polled mbuf be passed as an argument to the dequeue
function.  Assert that the passed argument matches the mbuf that is actually
dequeued.  Also remove assignments of the return value from ifq_dequeue()
in such cases which implied that the mbuf might be different when, in fact,
it had better not be.

18 years agoFollowup to last commit, cleanup some SMP/UP conditionals.
Matthew Dillon [Mon, 21 Nov 2005 22:54:16 +0000 (22:54 +0000)]
Followup to last commit, cleanup some SMP/UP conditionals.

18 years agoAdd a sysctl and tunable kern.syscall_mpsafe which allows system calls
Matthew Dillon [Mon, 21 Nov 2005 21:59:52 +0000 (21:59 +0000)]
Add a sysctl and tunable kern.syscall_mpsafe which allows system calls
marked MPSAFE in syscalls.master to run without the MP lock.  This sysctl
is disabled (0) by default.

To make this work the userland scheduler's passive release / acquire code
had to be made MPSAFE.  The release code accomplishes this by using
atomic_*() ops to manipulate curprocmask and rdyprocmask.  The acquisition
code currently obtains the MP lock unconditionally.  The userland scheduler
really need to be rewritten to be cpu-localized.

Only a few system calls, such as getuid(), are currently marked MPSAFE.
No matter how a system call is marked, the MP lock is obtained
unconditionally when ktracing or signaling.

18 years agoStart working on making the printf() path MPSAFE, because it isn't at the
Matthew Dillon [Mon, 21 Nov 2005 21:56:14 +0000 (21:56 +0000)]
Start working on making the printf() path MPSAFE, because it isn't at the
moment.  Ensure that index computations on the message buffer cannot cause
a crash if multiple cpus are writing to the message buffer at the same time.

18 years agoAdd a sysctl and tunable kern.intr_mpsafe which allows threaded interrupts
Matthew Dillon [Mon, 21 Nov 2005 21:50:26 +0000 (21:50 +0000)]
Add a sysctl and tunable kern.intr_mpsafe which allows threaded interrupts
marked INTR_MPSAFE to run without the MP lock.  This sysctl is disabled (0)
by default.

18 years agoAdd a thread flag, TDF_MPSAFE, which is used during thread creation to
Matthew Dillon [Mon, 21 Nov 2005 18:49:27 +0000 (18:49 +0000)]
Add a thread flag, TDF_MPSAFE, which is used during thread creation to
determine whether the thread should initially be holding the MP lock or not.

18 years agoRemove inthand_add() and inthand_remove(). Instead, register_int() and
Matthew Dillon [Mon, 21 Nov 2005 18:02:46 +0000 (18:02 +0000)]
Remove inthand_add() and inthand_remove().  Instead, register_int() and
unregister_int() are called directly and the machine level vector setup and
teardown ABI calls are made from register_int() and unregister_int().

18 years agoThere are two possible causes which will make vr(4) stall:
Sepherosa Ziehau [Mon, 21 Nov 2005 13:20:29 +0000 (13:20 +0000)]
There are two possible causes which will make vr(4) stall:
in vr_start(), if vr_encap() fails:
1) vr_start() will set IFF_OACTIVE.  If the packet causing vr_encap() to fail
   is the only packet pending to be downloaded to device, vr(4) will stall,
   since:
   * No more packets can be transfered, because IFF_OACTIVE is turned on
   * Except for vr_{init, stop}(), vr_txeoc() is the only function that can
     turn off IFF_OACTIVE.  It is triggered by "frame download completing"
     interrupt.  But this kind of interrupt will not be generated here, since
     there are no other packets pending to be downloaded.
2) vr_start() will skip TX head and tail pointer updating, which leaks all
   previous successfully encapsulated TX chains.

Following fixes are applied:
- Allocate chunk of memory in vr_attch() to reduce the failure chance of
  vr_encap().  This will also reduce the load of mbuf allocation system
- Use indexes instead of pointers for TX chain processing.  This can save us
  some spaces in every vr_chain
- Update Tx head and tail indexes when there are successfully encapsultaed
  packets pending to be downloaded to device, even if vr_encap() fails for
  some packets
- Cache TX buffer and next TX descriptor's physical address in vr_chain, since
  these addresses are fixed during the life time of vr(4)

Other stuffs:
- Use M_ZERO flag in memory allocation instead of calling bzero() later
- Remove (char *) cast in bzero()
- Minor style changes

Reported-by: corecode
With-helps-form: joerg
Reviewed-by: joerg, submit@
18 years agoAdd XXX comments to document dubious random number acquisition technique.
Sascha Wildner [Sun, 20 Nov 2005 14:58:40 +0000 (14:58 +0000)]
Add XXX comments to document dubious random number acquisition technique.

18 years ago- Ansify function definitions.
Sascha Wildner [Sun, 20 Nov 2005 13:24:36 +0000 (13:24 +0000)]
- Ansify function definitions.

- Add prototypes.

- Fix some warnings.

In-collaboration-with: Alexey Slynko <slynko@tronet.ru>

18 years agoPrefer m_getcl() to EPIC_MGETCLUSTER() which uses MGETHDR()+MCLGET()
Sepherosa Ziehau [Sun, 20 Nov 2005 13:08:35 +0000 (13:08 +0000)]
Prefer m_getcl() to EPIC_MGETCLUSTER() which uses MGETHDR()+MCLGET()

18 years ago- Ansify function definitions.
Sascha Wildner [Sun, 20 Nov 2005 12:37:49 +0000 (12:37 +0000)]
- Ansify function definitions.

- Fix some warnings.

- In function definitions, move the type on a line of its own.

- Perform some style(9) cleanup.

- Remove (void) casts for discarded return values.

- Remove parameter names from function prototypes.

In-collaboration-with: Alexey Slynko <slynko@tronet.ru>

18 years ago- Remove unnecessary ETHER_* macros
Sepherosa Ziehau [Sun, 20 Nov 2005 11:59:54 +0000 (11:59 +0000)]
- Remove unnecessary ETHER_* macros
- Utilize pcidevs.h for PCI device id and vendor id
- Prefer PCIR_BAR() macro to PCIR_MAPS
- Use common device probing style, epic_devtype() is merged
- Nuke epic_softc_t.cardvend, since it is only used in epic_common_attach().
  Move epic_softc_t.cardid to the end of the struct
- Minor style changes

18 years ago- Ansify function definitions.
Sascha Wildner [Sun, 20 Nov 2005 11:07:30 +0000 (11:07 +0000)]
- Ansify function definitions.

- Fix some warnings.

- In function definitions, move the type on a line of its own.

- Remove (void) casts for discarded return values.

- Use va_copy() where appropriate.

In-collaboration-with: Alexey Slynko <slynko@tronet.ru>

18 years agoSync with FreeBSD's rev. 1.15. This brings in documentation for va_copy().
Sascha Wildner [Sun, 20 Nov 2005 11:05:44 +0000 (11:05 +0000)]
Sync with FreeBSD's rev. 1.15. This brings in documentation for va_copy().

18 years agoSync with FreeBSD dev/xe
Sepherosa Ziehau [Sun, 20 Nov 2005 10:16:56 +0000 (10:16 +0000)]
Sync with FreeBSD dev/xe

if_xe.c 1.39
if_xe_pccard 1.11
if_xereg.h 1.6
if_xevar.h 1.4
Major update to xe driver: (*)
- Make multicast work
- Fix (some of) the watchdog timeouts after card reset
- Add support for CE2, CEM28 and CEM33 cards
- General code cleanup

if_xe.c 1.42
if_xe_pccard.c 1.14
- Add hw.xe.debug sysctl node, set it to 1 by default
- Turn XE_DEBUG on by default

(*) This update was submitted to FreeBSD by
    Scott Mitchell <scott+freebsd at fishballoon.org>

18 years agoANSIfy
Sepherosa Ziehau [Sun, 20 Nov 2005 09:46:31 +0000 (09:46 +0000)]
ANSIfy

Submitted-by: Matthias Schmidt <schmidtm at mathematik.uni-marburg.de>
18 years ago- Fix some warnings.
Sascha Wildner [Sun, 20 Nov 2005 09:18:37 +0000 (09:18 +0000)]
- Fix some warnings.

- Include missing header files.

- Add prototypes.

- Put individual function parameter comments into a general comment
  to make the definition look better.

- Perform some style(9) cleanup.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoFix a bug in the last commit. The proc pointer can be NULL at the
Matthew Dillon [Sun, 20 Nov 2005 02:23:59 +0000 (02:23 +0000)]
Fix a bug in the last commit.  The proc pointer can be NULL at the
point where we PHOLD it, conditionalize the hold/rele.

Reported-by: Sascha Wildner <saw@online.de>
18 years ago- Document ttyname_r().
Sascha Wildner [Sat, 19 Nov 2005 22:32:53 +0000 (22:32 +0000)]
- Document ttyname_r().

- Fix several compilation warnings.

- Perform some style(9) cleanup.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoAdd missing prototypes.
Sascha Wildner [Sat, 19 Nov 2005 22:26:54 +0000 (22:26 +0000)]
Add missing prototypes.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoHonor NOFSCHG.
Joerg Sonnenberger [Sat, 19 Nov 2005 22:00:20 +0000 (22:00 +0000)]
Honor NOFSCHG.

18 years agoAdd removal of etc/rc.d/network[123] to 'make upgrade'.
Sascha Wildner [Sat, 19 Nov 2005 21:55:46 +0000 (21:55 +0000)]
Add removal of etc/rc.d/network[123] to 'make upgrade'.

18 years agoRemove unused network[123] scripts.
Sascha Wildner [Sat, 19 Nov 2005 21:52:09 +0000 (21:52 +0000)]
Remove unused network[123] scripts.

18 years ago- Remove unused "network" and "network[123]" scripts.
Sascha Wildner [Sat, 19 Nov 2005 21:47:32 +0000 (21:47 +0000)]
- Remove unused "network" and "network[123]" scripts.

- Remove obsolete "DragonFly" keyword.

18 years ago- Fix several compilation warnings.
Sascha Wildner [Sat, 19 Nov 2005 20:46:32 +0000 (20:46 +0000)]
- Fix several compilation warnings.

- Put individual function parameter comments into a general comment
  to make the definition look better.

Submitted-by: Alexey Slynko <slynko@tronet.ru>
18 years agoDon't depend on DragonFly keyword for shutdown scripts as well.
Joerg Sonnenberger [Sat, 19 Nov 2005 19:59:47 +0000 (19:59 +0000)]
Don't depend on DragonFly keyword for shutdown scripts as well.

Reminded-by: swildner
18 years agoDon't depend on the DragonFly keyword anymore, all unsupported scripts
Joerg Sonnenberger [Sat, 19 Nov 2005 18:34:02 +0000 (18:34 +0000)]
Don't depend on the DragonFly keyword anymore, all unsupported scripts
have been removed a while ago.

This has the additional advantage that pkgsrc rc scripts can be linked
directly under /etc/rc.d and be used as part of normal dependency
tracking.

18 years agoProtect allproc scans with PHOLD/PRELE, in particular to support the
Matthew Dillon [Sat, 19 Nov 2005 17:58:33 +0000 (17:58 +0000)]
Protect allproc scans with PHOLD/PRELE, in particular to support the
sysctl that fstat uses.

Add an additional wait state in exit1() when p_lock is non-zero.  Do not
remove the process from the allproc list until p_lock is zero in order to
protect allproc scans.

Remove a spurious PHOLD in the NFS code.  Generally clean up uses of PHOLD
that no longer apply.

Fstat problems reported by: Stefan Krueger <skrueger@meinberlikomm.de>

18 years agoConvert the lockmgr interlock from a token to a spinlock. This fixes a
Matthew Dillon [Sat, 19 Nov 2005 17:19:52 +0000 (17:19 +0000)]
Convert the lockmgr interlock from a token to a spinlock.  This fixes a
problem on SMP boxes where the MP lock would unexpectedly lose atomicy for
a short period of time due to token acquisition.

Add a tsleep_interlock() call which takes advantage of tsleep()'s cpu
locality of reference to provide a helper function which allows us to
atomically spin_unlock() and tsleep() in an MP safe manner with only
a critical section.  Basically all it does is set a cpumask bit for the
ident hash index to cause other cpu's issuing a wakeup to notify our cpu.
Any actual wakeup occuring during the race period after the spin_unlock
but before the tsleep() call will be delayed by the critical section
until after the tsleep has queued the thread.

Cleanup some unused junk in vm_map.h.

18 years agoMake the syslog message string static const, saves the copy.
Joerg Sonnenberger [Sat, 19 Nov 2005 15:19:03 +0000 (15:19 +0000)]
Make the syslog message string static const, saves the copy.
Noticed by Valeriy E. Ushakov.
Include some more headers, use __unused in the function declaration,
not in the protorype. This fixes most warnings.

18 years ago- Constify betting instructions.
Sascha Wildner [Sat, 19 Nov 2005 09:50:30 +0000 (09:50 +0000)]
- Constify betting instructions.
- Rename some local variables.
- Add __unused for unused parameters.
- Raise WARNS to 6.

Submitted-by: Peter Avalos <pavalos@theshell.com>
18 years agoDo a better job formatting vmstat -i output. Output entries that look like
Matthew Dillon [Thu, 17 Nov 2005 21:43:10 +0000 (21:43 +0000)]
Do a better job formatting vmstat -i output.  Output entries that look like
installed interrupt handlers even if no interrupts have occured.

18 years agoRemove ancient interrupt handler hacks that are no longer needed.
Matthew Dillon [Thu, 17 Nov 2005 21:29:45 +0000 (21:29 +0000)]
Remove ancient interrupt handler hacks that are no longer needed.

18 years agoIf a /dev/<disk> device node is fsynced at the same time the related
Matthew Dillon [Wed, 16 Nov 2005 17:55:22 +0000 (17:55 +0000)]
If a /dev/<disk> device node is fsynced at the same time the related
softupdates filesystem is fscyned, a self-referential D_BMSAFEMAP dependancy
can wind up being created from the /dev/<disk> vnode to the device vnode.
Catch and ignore the case.

Reported-by: Xin LI <delphij@frontfree.net>, David Beck <dbeck@beckground.hu>
Original-FreeBSD-bugreport: PR/66781 by John-Mark Gurney

18 years agoContinue work on our pluggable scheduler abstraction. Implement a system
Matthew Dillon [Wed, 16 Nov 2005 02:24:33 +0000 (02:24 +0000)]
Continue work on our pluggable scheduler abstraction.  Implement a system
call to set the scheduler for the current process (and future children),
and add an abstraction for scheduler registration.

Submitted-by: Sergey Glushchenko <deen@smz.com.ua>
18 years agoTemporarily check for and correct a race in getnewbuf() that exists due
Matthew Dillon [Mon, 14 Nov 2005 19:14:05 +0000 (19:14 +0000)]
Temporarily check for and correct a race in getnewbuf() that exists due
to the fact that lockmgr locks use tokens for their interlock.  The use
of a token can cause the atomicy of the big giant lock to be temporarily
lost and wind up breaking the assumed atomicy of higher level operations that
believed themselves to be safe making lockmgr calls with the LK_NOWAIT flag.

The general problem will soon be fixed by changing the lockmgr interlock
from a token to one of Jeffrey Hsu's spin locks.  Fortunately there are
only a few places left in DragonFly where LK_INTERLOCK is used.

18 years agoMake tsleep/wakeup() MP SAFE for kernel threads and get us closer to
Matthew Dillon [Mon, 14 Nov 2005 18:50:18 +0000 (18:50 +0000)]
Make tsleep/wakeup() MP SAFE for kernel threads and get us closer to
making it MP SAFE for user processes.  Currently the code is operating
under the rule that access to a thread structure requires cpu locality of
reference, and access to a proc structure requires the Big Giant Lock.  The
two are not mutually exclusive so, for example, tsleep/wakeup on a proc
needs both cpu locality of reference *AND* the BGL.  This was true with the
old tsleep/wakeup and has now been documented.

The new tsleep/wakeup algorithm is quite simple in concept.  Each cpu has its
own ident based hash table and each hash slot has a cpu mask which tells
wakeup() which cpu's might have the ident.  A wakeup iterates through all
candidate cpus simply by chaining the IPI message through them until either
all candidate cpus have been serviced, or (with wakeup_one()) the requested
number of threads have been woken up.

Other changes made in this patch set:

* The sense of P_INMEM has been reversed.  It is now P_SWAPPEDOUT.  Also,
  P_SWAPPING, P_SWAPINREQ are not longer relevant and have been removed.

* The swapping code has been cleaned up and seriously revamped.  The new
  swapin code staggers swapins to give the VM system a chance to respond
  to new conditions.  Also some lwp-related fixes were made (more
  p_rtprio vs lwp_rtprio confusion).

* As mentioned above, tsleep/wakeup have been rewritten.  The process
  p_stat no longer does crazy transitions from SSLEEP to SSTOP.  There is
  now only SSLEEP and SSTOP is synthesized from P_SWAPPEDOUT for userland
  consumpion.  Additionally, tsleep() with PCATCH will NO LONGER STOP THE
  PROCESS IN THE TSLEEP CALL.  Instead, the actual stop is deferred until
  the process tries to return to userland.  This removes all remaining cases
  where a stopped process can hold a locked kernel resource.

* A P_BREAKTSLEEP flag has been added.  This flag indicates when an event
  occurs that is allowed to break a tsleep with PCATCH.  All the weird
  undocumented setrunnable() rules have been removed and replaced with a
  very simple algorithm based on this flag.

* Since the UAREA is no longer swapped, we no longer faultin() on PHOLD().
  This also incidently fixes the 'ps' command's tendancy to try to swap
  all processes back into memory.

* speedup_syncer() no longer does hackish checks on proc0's tsleep channel
  (td_wchan).

* Userland scheduler acquisition and release has now been tightened up and
  KKASSERT's have been added (one of the bugs Stefan found was related
  to an improper lwkt_schedule() that was found by one of the new assertions).
  We also have added other assertions related to expected conditions.

* A serious race in pmap_release_free_page() has been corrected.  We
  no longer couple the object generation check with a failed
  pmap_release_free_page() call.  Instead the two conditions are checked
  independantly.  We no longer loop when pmap_release_free_page() succeeds
  (it is unclear how that could ever have worked properly).

Major testing by: Stefan Krueger <skrueger@meinberlikomm.de>

18 years agoFix a broken array lookup in the old 4.3 BSD mmap compatibility code
Matthew Dillon [Mon, 14 Nov 2005 18:07:13 +0000 (18:07 +0000)]
Fix a broken array lookup in the old 4.3 BSD mmap compatibility code
that could crash the kernel.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 12:27:04 +0000 (12:27 +0000)]
Cleanup:

- Add $DragonFly$.
- Ansify function definitions.
- Change pmap_set()'s 'port' parameter from int to u_short.
- In function definitions, move the type on a line of its own.
- Remove (void) casts for discarded return values.
- Remove 'register' storage class specifiers.

18 years agoSwitch to NetBSD's ftp client.
Simon Schubert [Sun, 13 Nov 2005 11:59:03 +0000 (11:59 +0000)]
Switch to NetBSD's ftp client.

18 years agoUpdate libedit from NetBSD.
Simon Schubert [Sun, 13 Nov 2005 11:58:31 +0000 (11:58 +0000)]
Update libedit from NetBSD.

libedit update by: Ben Woolley <tautolog@gmail.com>
consumers update by: corecode

18 years agoMerge from vendor branch LUKEMFTP:
Simon Schubert [Sun, 13 Nov 2005 11:28:53 +0000 (11:28 +0000)]
Merge from vendor branch LUKEMFTP:
Import NetBSD's ftp client as of 2005-11-12.

18 years agoImport NetBSD's ftp client as of 2005-11-12. vendor/LUKEMFTP
Simon Schubert [Sun, 13 Nov 2005 11:28:53 +0000 (11:28 +0000)]
Import NetBSD's ftp client as of 2005-11-12.

18 years agoDon't close the toplevel makefile.
Simon Schubert [Sun, 13 Nov 2005 10:55:36 +0000 (10:55 +0000)]
Don't close the toplevel makefile.

Submitted-by: Eric Jacobs <eric@theeric.com>
18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 02:17:18 +0000 (02:17 +0000)]
Cleanup:

- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 02:13:52 +0000 (02:13 +0000)]
Cleanup:

- Add $DragonFly$.
- Ansify function definitions.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 02:04:47 +0000 (02:04 +0000)]
Cleanup:

- Add $DragonFly$.
- Ansify function definitions.
- In function definitions, move the type on a line of its own.
- Move function's open brace on a line of its own.
- Remove (void) casts for discarded return values.
- Remove unused variables.

18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 01:20:49 +0000 (01:20 +0000)]
Cleanup:

- Ansify function definitions.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 01:19:15 +0000 (01:19 +0000)]
Cleanup:

- Ansify function definitions.

18 years agoCleanup:
Sascha Wildner [Sun, 13 Nov 2005 00:07:42 +0000 (00:07 +0000)]
Cleanup:

- Add $DragonFly$.
- Ansify function definitions.
- Remove (void) casts for discarded return values.
- In function definitions, move the type on a line of its own.
- Remove __P.

18 years agoCleanup:
Sascha Wildner [Sat, 12 Nov 2005 23:01:55 +0000 (23:01 +0000)]
Cleanup:

- Ansify function definitions.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sat, 12 Nov 2005 22:35:01 +0000 (22:35 +0000)]
Cleanup:

- Add $DragonFly$.
- Ansify function definitions.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sat, 12 Nov 2005 22:21:13 +0000 (22:21 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sat, 12 Nov 2005 21:56:11 +0000 (21:56 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.
- Ansify function definitions.

18 years agoUSB mouse fix for certain mice, such as the Logitech LX700. Do not assume
Matthew Dillon [Fri, 11 Nov 2005 19:34:38 +0000 (19:34 +0000)]
USB mouse fix for certain mice, such as the Logitech LX700.  Do not assume
that the last matching item is the one we want.  Save state for the first
item that matched.

Submitted-by: Jonathan Fosburgh
18 years agoAdd missing CPU options and reorder a little bit.
Sascha Wildner [Fri, 11 Nov 2005 16:35:49 +0000 (16:35 +0000)]
Add missing CPU options and reorder a little bit.

18 years agoRename spin_lock()/spin_unlock() to spin_lock_quick()/spin_unlock_quick()
YONETANI Tomokazu [Thu, 10 Nov 2005 00:53:23 +0000 (00:53 +0000)]
Rename spin_lock()/spin_unlock() to spin_lock_quick()/spin_unlock_quick()
for UP kernel, too, or else buildkernel fails with redefinition of these
functions.

18 years agoRevert part of the last commit. We aren't ready for the per-cpu _wakeup
Matthew Dillon [Wed, 9 Nov 2005 03:39:15 +0000 (03:39 +0000)]
Revert part of the last commit.  We aren't ready for the per-cpu _wakeup
code, there are still races which need the BGL.  The code will have to be
merged with stage 2.  It's a big mess but it will be cleaned up soon.

18 years agoCatch up with renaming of macros IRQn -> ICU_IRQn in i386/icu/icu.h,1.7
YONETANI Tomokazu [Wed, 9 Nov 2005 03:07:34 +0000 (03:07 +0000)]
Catch up with renaming of macros IRQn -> ICU_IRQn in i386/icu/icu.h,1.7
to unbreak LINT kernel.

18 years agoTurn around the spinlock code to reduce the chance of programmer error.
Matthew Dillon [Tue, 8 Nov 2005 22:40:01 +0000 (22:40 +0000)]
Turn around the spinlock code to reduce the chance of programmer error.
Remove spin_lock_crit() and spin_unlock_crit().  Instead make the primary
spinlock API, spin_lock() and spin_unlock(), enter and exit a critical
section.  Add two API functions, spin_lock_quick() and spin_unlock_quick()
which assume the caller is already in a critical section or that the spinlock
will never be used by a preempting thread (hardware interrupt or software
interrupt).

18 years agoMake tsleep/wakeup MP SAFE part 1/2.
Matthew Dillon [Tue, 8 Nov 2005 20:47:02 +0000 (20:47 +0000)]
Make tsleep/wakeup MP SAFE part 1/2.

Make most of the tsleep/wakeup core code MP safe.   Convert the global sleep
id hash table to a per-cpu hash table and use cpu-localization for all access
to the hash table.  Note that the timeout code is also per-cpu and will
issue the timeout callback on the correct cpu.

On an SMP box, this code is actually more efficient then the old code.
Instead of having to send multiple IPI messages by calling lwkt_schedule()
on each foreign thread, we now send one IPI message to the target cpu and
lwkt_schedule() is localized only for matching threads on that cpu.

wakeup_one() continues to be supported.  We pass a flag and chain through
the cpus until we exhaust available cpus or locate a match.  Currently we
do not round-robin the cpu mask check, so this could use some improvement.

A global cpumask array has been added so only cpus possibly containing
the sleeping threads are chained.  We chain the IPI rather then broadcast
it to reduce latency on the originating wakeup() and to introduce a
staggered wakeup between cpus that may reduce resource collisions when
multiple threads are blocked on the same resource.

This code uses the same cpu-localization concepts that much of the rest of
DragonFly uses for SMP, which means no mutexes, no locks, and virtually no
added overhead in the same-cpu case, and a simple asynchronous send-and-forget
IPI message for the SMP case.

18 years agoSync with Intel's em(4) driver version 3.2.15
Sepherosa Ziehau [Tue, 8 Nov 2005 12:48:18 +0000 (12:48 +0000)]
Sync with Intel's em(4) driver version 3.2.15
- Add support for 82571EB, 82572EI and 82573E adapters
- Nuke DBG_STATS related code and struct adapter's fields
- Flow control water marks are now calculated from hardware's register value
  instead of using hardwired values(FC_DEFAULT_{LOW, HIGH}_THRESH)
- Flow control pause time is bumped to 512us (old value is 131us) (*)
- In em_detach(), call bus_teardown_intr() if adapter.int_handler_tag != NULL
- Update Intel's LICENSE and README
- Update README to reflect recent changes to device polling
- Minor style changes

(*) Original code misuses 0x1000 (should be 1000) as em_hw.fc_pause_time

18 years agoRemove fakeroot hack, it won't be used with pkgsrc anyways.
Simon Schubert [Mon, 7 Nov 2005 23:21:58 +0000 (23:21 +0000)]
Remove fakeroot hack, it won't be used with pkgsrc anyways.

18 years agoAdjust the globaldata initialization code to accomodate globaldata
Matthew Dillon [Mon, 7 Nov 2005 20:05:53 +0000 (20:05 +0000)]
Adjust the globaldata initialization code to accomodate globaldata
structures which exceed PAGE_SIZE.

18 years agoMinor manual adjustment to add debug.acpi.enabled.
Matthew Dillon [Mon, 7 Nov 2005 18:26:37 +0000 (18:26 +0000)]
Minor manual adjustment to add debug.acpi.enabled.

18 years agoSync with FreeBSD's rev. 1.16:
Sascha Wildner [Mon, 7 Nov 2005 00:44:59 +0000 (00:44 +0000)]
Sync with FreeBSD's rev. 1.16:

- Add {tera,peta,exa,zetta,yotta,kilo}byte and brhundredweight. kilobyte
  was available as kbyte only.

- Fix carat and metriccarat.

- Add radii of Earth, Moon and Sun.

18 years agoDocument CPU_AMD64X2_INTR_SPAM in LINT.
Matthew Dillon [Sun, 6 Nov 2005 19:00:48 +0000 (19:00 +0000)]
Document CPU_AMD64X2_INTR_SPAM in LINT.

18 years agoFix a very, very old bug in the man page, lbl-csam.arpa doesn't
Joerg Sonnenberger [Sun, 6 Nov 2005 17:27:00 +0000 (17:27 +0000)]
Fix a very, very old bug in the man page, lbl-csam.arpa doesn't
exist. Found during discussion in NetBSD.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:51:40 +0000 (12:51 +0000)]
Cleanup:

- Ansify function definitions.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:50:21 +0000 (12:50 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:49:25 +0000 (12:49 +0000)]
Cleanup:

- Ansify function definitions.
- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:45:58 +0000 (12:45 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:44:12 +0000 (12:44 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:36:40 +0000 (12:36 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:34:21 +0000 (12:34 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:32:56 +0000 (12:32 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:29:11 +0000 (12:29 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.
- Ansify function definitions.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:23:40 +0000 (12:23 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:21:42 +0000 (12:21 +0000)]
Cleanup:

- In function definitions, move the type on a line of its own.
- Remove (void) casts for discarded return values.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:19:22 +0000 (12:19 +0000)]
Cleanup:

- Ansify function definitions.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:16:44 +0000 (12:16 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.

18 years agoCleanup:
Sascha Wildner [Sun, 6 Nov 2005 12:13:53 +0000 (12:13 +0000)]
Cleanup:

- Remove 'register' storage class specifiers.
- Ansify function definitions.