dragonfly.git
16 years agoCorrect spelling.
Hiten Pandya [Tue, 23 Nov 2004 02:20:40 +0000 (02:20 +0000)]
Correct spelling.

16 years agoFix the PRI field to not display bogus process priorities for pure
Matthew Dillon [Mon, 22 Nov 2004 06:50:12 +0000 (06:50 +0000)]
Fix the PRI field to not display bogus process priorities for pure
threads.  Add TDPRI (-o tdpri) to display the actual thread priority
and critical section count.

16 years agoThe fp argument to vn_open() is optional but the code wasn't treating it
Matthew Dillon [Mon, 22 Nov 2004 00:53:54 +0000 (00:53 +0000)]
The fp argument to vn_open() is optional but the code wasn't treating it
that way entirely.

16 years agoAdd support for adjusting the interrupt throttling rate via
Matthew Dillon [Mon, 22 Nov 2004 00:46:14 +0000 (00:46 +0000)]
Add support for adjusting the interrupt throttling rate via
hw.emX.int_throttle_ceil, and change the default from 8000hz
to 10000hz to improve throughput with default TCP window sizes
through a GiGE switch in a LAN environment.

Note the following test results using iperf between two machines:

    * Shuttle Athlon 64 3200+ box, EM card in 32 bit PCI slot
    * 2 machines connected through a GiGE switch
    * All other hw.em0 delays set to 0 on both sides
    * throttle settings set on both sides
    * -w option set on iperf client AND server for 63.5KB window
    * software interrupt throttling has been turned off for these tests

    throttle    result          result
    freq        (32.5KB win)    (63.5KB win)
                (default)
    --------    --------------  -----------

  maxrate       481 MBit/s      533 MBit/s      (not sure what's going on here)
  120000        518 MBit/s      558 MBit/s      (not sure what's going on here)
  100000        613 MBit/s      667 MBit/s      (not sure what's going on here)
   70000        679 MBit/s      691 MBit/s
   60000        668 MBit/s      694 MBit/s
   50000        678 MBit/s      684 MBit/s
   40000        694 MBit/s      696 MBit/s
   30000        694 MBit/s      696 MBit/s
   20000        698 MBit/s      703 MBit/s
   10000        707 MBit/s      716 MBit/s
    9000        708 MBit/s      716 MBit/s
    8000        710 MBit/s      717 MBit/s      <--- drop off pt 32.5KB win
    7000        683 MBit/s      716 MBit/s
    6000        680 MBit/s      720 MBit/s
    5000        652 MBit/s      718 MBit/s      <--- drop off pt 63.5KB win
    4000        555 Mbit/s      695 MBit/s
    3000        522 MBit/s      533 MBit/s      <--- GiGE throttling likely
    2000        449 MBit/s      384 MBit/s      (256 ring descriptors =
    1000        260 MBit/s      193 MBit/s        2500 hz minimum)

16 years agoCleanup the 'cache_lock: blocked on..' warning message. Fix a minor
Matthew Dillon [Sun, 21 Nov 2004 19:39:35 +0000 (19:39 +0000)]
Cleanup the 'cache_lock: blocked on..' warning message.  Fix a minor
issue that was causing the message to be bogusly displayed when more then
one process was stuck on the lock.  Plus add a sysctl, debug.nclockwarn,
which allows the warning timeout to be set (in ticks), default one second.

Reported-by: various.
16 years agolwkt_runnable is declared in <sys/thread2.h>
YONETANI Tomokazu [Sun, 21 Nov 2004 09:07:14 +0000 (09:07 +0000)]
lwkt_runnable is declared in <sys/thread2.h>

16 years agoFix a number of SMP issues.
Matthew Dillon [Sat, 20 Nov 2004 20:50:36 +0000 (20:50 +0000)]
Fix a number of SMP issues.

* Add required pause instructions in code paths that skip running "HLT".  This
  occurs when e.g. cpu #1 is running code with the BGL while cpu #2's only
  runnable thread requires the BGL.  cpu #2's LWKT scheduler spins in that
  case.  Similar situations can occur when the only runnable threads on a
  cpu are waiting for a token.

* Add required pause instructions to spin loops.  DragonFly has very few spin
  locks (e.g. things like com_lock()) but its a good idea anyway to avoid
  known livelock issues on Intel cpus.

* Fix a pending interrupt / HLT race.  We were not atomically retiring
  pending interrupts prior to potentially HLTing the cpu.  This could
  result in an SMP machine's network locking up until a key is hit on
  the console, then magically resuming.

Lockups-reported-by: Peter Avalos <pavalos@theshell.com>
16 years agosendfile() was seriously broken. It was calling vm_page_free() without
Matthew Dillon [Sat, 20 Nov 2004 20:35:33 +0000 (20:35 +0000)]
sendfile() was seriously broken.  It was calling vm_page_free() without
busying the underlying page, causing a panic on kernels compiled with
INVARIANTS and potentially corrupting data on kernels compiles without
INVARIANTS.  Change the calls to vm_page_try_to_free().

Symtoms: system crash when Apache2 tries to use sendfile() to send large files.
Reported-by: Jedi/Sector One <j@pureftpd.org>
16 years agoAdd code to the BIOS VM86 emulator to detect writes to the 8254. If a
Matthew Dillon [Sat, 20 Nov 2004 20:25:13 +0000 (20:25 +0000)]
Add code to the BIOS VM86 emulator to detect writes to the 8254.  If a
write is detected the 8254 is reset after the bios call returns and the
event is reported.  Some bioses, in particular video bioses, uses timer 2
for timing things.  We need timer 2 for our master clock.

Remove restoreclocks().  This was causing gd_cpuclock_base to reverse index
and jump the time ahead an hour with a flurry of hardclock interrupts.

Introduce a new systimer API call, systimer_init_periodic_nq(), which
installs a non-queued periodic systimer.  Non-queued means that if multiple
events built-up (due to an 8254 glitch, sleep, or other event), only one
event will be reported.

This should fix the BIOS/8254 glitching, the 'hour jump' problem, and
hopefully other timer jumping issues as well.

Bugs-reported-by: Andreas Hauser <andy@splashground.de>,
Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>,
and others

16 years agoFix a conditional. sdl was not unconditionally being checked for NULL.
Matthew Dillon [Sat, 20 Nov 2004 04:14:29 +0000 (04:14 +0000)]
Fix a conditional.  sdl was not unconditionally being checked for NULL.

Found-by: Mikhail Teterin <mi+kde@aldan.algebra.com>
16 years agoGive init the ability to chroot to a directory based on kernel environment
Matthew Dillon [Sat, 20 Nov 2004 04:09:34 +0000 (04:09 +0000)]
Give init the ability to chroot to a directory based on kernel environment
variable, 'init_chroot'.  This makes building multi-boot DVDs a lot easier.

Submitted-by: Oliver Fromme <olli@haluter.fromme.com>
w/ minor cleanups by Matt

16 years agoMake the code WARNS= 6 clean.
Eirik Nygaard [Fri, 19 Nov 2004 19:01:52 +0000 (19:01 +0000)]
Make the code WARNS= 6 clean.

16 years ago- Add WARNS?= 6
Liam J. Foy [Fri, 19 Nov 2004 18:35:29 +0000 (18:35 +0000)]
- Add WARNS?= 6
- Make signaled volatile sig_atomic_t
- Static functions
- Fix most of the warns

16 years ago- Add $DragonFly$ tag
Liam J. Foy [Fri, 19 Nov 2004 17:46:40 +0000 (17:46 +0000)]
- Add $DragonFly$ tag
- Add WARNS?= 6
- Remove registers
- Static functions

16 years agoRe-enable SACK by default. Jeff fixed the corruption issue reported by
Matthew Dillon [Thu, 18 Nov 2004 20:12:26 +0000 (20:12 +0000)]
Re-enable SACK by default.  Jeff fixed the corruption issue reported by
H.Miyamoto and downloads now test good again.

Originally-reported-by: H.Miyamoto (aka "Yuukis"). <Ys@PixyGarden.net>
Additional-reports/testing: H.Miyamoto,
Joerg Sonnenberger <joerg@britannica.bec.de>,
walt <wa1ter@myrealbox.com>

16 years agoCleanup some dangling issues with cache_inval(). A lot of hard work went
Matthew Dillon [Thu, 18 Nov 2004 20:04:28 +0000 (20:04 +0000)]
Cleanup some dangling issues with cache_inval().  A lot of hard work went
into guarenteeing that the namecache topology would remain connected, but
there were two cases (basically rmdir and rename-over-empty-target-dir)
which disconnected a portion of the hierarchy.

This fixes the remaining cases by having cache_inval() simply mark the
namecache entry as destroyed without actually disconnecting it from the
topology.  The flag tells cache_nlookup() and ".." handlers that a node has
been destroyed and is no longer connected to any parent directory.

The new cache_inval() also now has the ability to mark an entire subhierarchy
as being unresolved, which can be a useful feature to have.

In-discussion-with: Richard Nyberg <rnyberg@it.su.se>

16 years agoReplace lvalue cast.
Joerg Sonnenberger [Thu, 18 Nov 2004 15:53:40 +0000 (15:53 +0000)]
Replace lvalue cast.

16 years agoUse kinfo_get_vfs_bufspace instead of kvm.
Joerg Sonnenberger [Thu, 18 Nov 2004 14:35:08 +0000 (14:35 +0000)]
Use kinfo_get_vfs_bufspace instead of kvm.

16 years agoAdd kinfo_get_vfs_bufspace(). Remove some junk from Makefile.
Joerg Sonnenberger [Thu, 18 Nov 2004 14:33:01 +0000 (14:33 +0000)]
Add kinfo_get_vfs_bufspace(). Remove some junk from Makefile.

16 years agoInclude Makefile
Joerg Sonnenberger [Thu, 18 Nov 2004 13:57:35 +0000 (13:57 +0000)]
Include Makefile

16 years agoAdd a new system library, libkinfo. It is intended to replace libkvm for
Joerg Sonnenberger [Thu, 18 Nov 2004 13:56:56 +0000 (13:56 +0000)]
Add a new system library, libkinfo. It is intended to replace libkvm for
most userland tools, which want to deal with a living kernel, not
post-mortem analysation.

Change the kern.file backing from a struct file array to a struct kinfo_file
array. The later is an independent structure, which includes the information
useful for userland. This allows changing the kernel-internals without
having to recompile libkinfo and derived programs. This is inspired by the
changes DES did in FreeBSD 5 (struct xfile).

Partly-obtained-from: FreeBSD (kern_descrip.c changes)

16 years agoRevert a part of the last commit. The changes to use sysctl interface
Joerg Sonnenberger [Thu, 18 Nov 2004 13:35:52 +0000 (13:35 +0000)]
Revert a part of the last commit. The changes to use sysctl interface
wasn't meant for the repository and will be superseded by a different
patch.

16 years agoLots of bug fixes to the checkpointing code. The big fix is that you can
Matthew Dillon [Thu, 18 Nov 2004 13:09:55 +0000 (13:09 +0000)]
Lots of bug fixes to the checkpointing code.  The big fix is that you can
now checkpoint a program that you have checkpoint-restored.  i.e. you run
program X, you checkpoint it, you checkpoint-restore X from the checkpoint,
and then you checkpoint it again.  The issue here is the when a checkpointed
program is restored the checkpoint file is used to map portions of the image
of the restored program.  If you then tried to checkpoint the restored image
the system would overwrite or destroy the original checkpoint file and
the new checkpoint file would have references to the old file (now
non-existant) file.  Any attempt to restore the recursed checkpoint would
result in a seg-fault.  That is now fixed.

* Remove the previous checkpoint file before saving the new one.  If the
  program we are checkpointing happens to be a checkpoint restore from the
  same file then overwriting the file would wind up corrupting the
  image set we are trying to save.

* When checkpointing a program that has been checkpoint-restored do not
  attempt to save the file handles for the vnode representing the
  checkpoint-restored program's own checkpoint file (which is a good chunk
  of its backing store), because this vnode is likely to be destroyed the
  moment we close the handle, since we are likely replacing the previous
  checkpoint file.  Instead, the backing store representing the old
  checkpoint file is copied to the new one.

* Re-checkpointing a program (hitting ^E multiple times) now properly
  replaces the checkpoint file.

* Properly close any file descriptors from the checkpt(1) program itself
  when restoring a checkpointed program, properly replace any file descriptors
  that need replacing.

* Properly replace p_comm[] when restoring a checkpoint file, so checkpointing
  again saves under the same program name.  'ps' output is still wrong,
  though.

TODO LIST:

* Add an iterator to the checkpoint file, accessible via kern.ckptfile,
  so successive checkpoints save to a blah.ckpt.1, blah.ckpt.2, etc,
  rather then always overwriting blah.ckpt (the iterator could be saved
  in the proc structure).

* Add back as a 'feature' the ability for the new checkpoint file to
  reference the old one.  That is, each new checkpoint file would represent
  a delta relative to the old one.  This might be useful when checkpointing
  programs with ever growing data setse so as not to have to copy the
  entire contents of the program to the checkpoint file each time you want
  to make a new checkpoint.  It would be hell on the VM system, but it
  would work.

* Add an option to checkpt(1) so you can checkpoint-restore-enter-gdb all
  in one go, to be able to debug a checkpointed file more easily.

Inspired by: Brook Davis's HPC presentation.  He expressed an interest in
     possibly porting the checkpoint code so I figure I ought to
     fix it up.

16 years agoMake pstat WARNS=6 clean.
Joerg Sonnenberger [Thu, 18 Nov 2004 12:54:13 +0000 (12:54 +0000)]
Make pstat WARNS=6 clean.

16 years agoChange the name entry in struct nlist to const char *.
Joerg Sonnenberger [Thu, 18 Nov 2004 12:38:43 +0000 (12:38 +0000)]
Change the name entry in struct nlist to const char *.

16 years agoMerge FreeBSD SA 04:16 security fix.
Jeroen Ruigrok/asmodai [Thu, 18 Nov 2004 12:08:01 +0000 (12:08 +0000)]
Merge FreeBSD SA 04:16 security fix.

Submitted by: the kind FreeBSD security officer folks

16 years agoClear the NOCORE flag on any text mappings that the RTLD modifies due to
Matthew Dillon [Thu, 18 Nov 2004 10:01:47 +0000 (10:01 +0000)]
Clear the NOCORE flag on any text mappings that the RTLD modifies due to
text relocations or compacted BSS areas.  Otherwise the checkpt code will
not write out the modified areas.

Also note that if you mmap() a file MAP_PRIVATE, then modify portions of it
so the mapping is changed from OBJT_VNODE to OBJT_DEFAULT->OBJT_VNODE,
the current ELF coredump code will *NOT* write out a file handle record for
the backing vnode.  This means that the entire vm_map_entry containing
the modified portions must be marked as COREable if it was previously mapped
NOCORE.

In the case of the RTLD code the text area is mapped read-only.  The text
area is temporarily remapped read-write for the relocation pass and so
the whole area is still represented by a single vm_map_entry and thus the
whole area must be marked COREable.  For the BSS fixup only the last page
is remapped read-write and so it gets its own private vm_map_entry and
thus only the last page must be marked COREable.

The DEFAULT->VNODE backing issue is actually a bug in the elf coredump code,
but even if it were fixed core dump sizes would not get much smaller because
relocations tend to be all over the map.

Checkpt-Nonworking-Bug-Reported-by: Michael Neumann <mneumann@ntecs.de>
16 years agoBring in various fixes from FreeBSD:
Matthew Dillon [Thu, 18 Nov 2004 02:01:44 +0000 (02:01 +0000)]
Bring in various fixes from FreeBSD:

* MAXPATHLEN includes the trailing NUL, Correct array sizes to reflect this.
* Correct NUL termination after strncpy.
* Make ${.OBJDIR} canonical.
* -Wall cleanup.
* unifdef -D__STDC__
* Sort #includes, remove <sys/types.h> (made redundant by <sys/param.h>),
  add <signal.h> (needed for sigaction())
* Unbreak compilation on RELENG_4.
* unifdef -UWANT_ENV_PWD. No one ever going to use this bugfeature.
* Reorder #include. Cast arg #2 of lseek to an off_t when constant. No need to
  test if failsafe memory allocation fails, it can't. perror -> warn. Use
  failsafe memory allocation provided.
* And some other doc cleanup.
* Reduce diffs between FreeBSD and DragonFly Makefile
* Added the MAKE_VERSION global that could be useful in determining
  if a given make(1) is feature-compatible with a set of makefiles.
  When merged, this will be used to replace the ugly upgrade_checks
  hacks in src/Makefile.
  Version has the RYYYYMMDDX format, where R is from RELENG_<R> and
  X allows for 10 distinguishable changes per day.
* make(I) appeared in PWB UNIX.
* Add MAKE_VERSION variables
* Don't do stupid things to avoid unused parameters, mark them __unused.
* Use %p to print a pointer, not %lx and a cast to (unsigned long).  Yuck.
* Avoid classy use of a variable one time with a constant value.
* Bit-width fields should be of type 'int'.

Submitted-by: Max Okumoto <okumoto@home>
16 years agoDo a cleanup pass on the mbuf allocator. Reorder the mmbfree cache tests
Matthew Dillon [Thu, 18 Nov 2004 01:42:26 +0000 (01:42 +0000)]
Do a cleanup pass on the mbuf allocator.  Reorder the mmbfree cache tests
to improve the critical path.  Use critical sections instead of spls for
protection.

16 years agoRemove unused junk from the slab allocator.
Matthew Dillon [Wed, 17 Nov 2004 23:36:21 +0000 (23:36 +0000)]
Remove unused junk from the slab allocator.

Remove M_FAILSAFE and M_INTALLOC.  M_FAILSAFE was a double check for
interrupt-time allocations but using it was problematic at best and as
a consequence it was never used.  M_INTALLOC was a macro that used
M_FAILSAFE and was also never used.  The standard M_ flags for interrupt
time allocations are M_INTNOWAIT and M_INTWAIT.

16 years agoProperly propagate the FIN flag from the following to-be-coalesced segment.
Jeffrey Hsu [Wed, 17 Nov 2004 21:50:46 +0000 (21:50 +0000)]
Properly propagate the FIN flag from the following to-be-coalesced segment.

Questionable use of logical AND caught by: Matt Dillon

16 years agoNormally we want to warn if the local IP address is used by a different
Joerg Sonnenberger [Wed, 17 Nov 2004 21:04:05 +0000 (21:04 +0000)]
Normally we want to warn if the local IP address is used by a different
host. This isn't useful for 0.0.0.0, because it is used by dhclient
when no address is known.

16 years agoFix bug with wrong length being used when coalescing out-of-order segments.
Jeffrey Hsu [Wed, 17 Nov 2004 20:51:16 +0000 (20:51 +0000)]
Fix bug with wrong length being used when coalescing out-of-order segments.

16 years agoFollow NOFSCHG if defined. (It's needed to be able to run make installworld
Matthew Dillon [Wed, 17 Nov 2004 19:16:12 +0000 (19:16 +0000)]
Follow NOFSCHG if defined.  (It's needed to be able to run make installworld
in a jail, in FreeBSD 5).

Submitted-by: Suleiman Souhlal <ssouhlal@FreeBSD.org>
16 years agoCave in and remove NULL checks for M_WAITOK mallocs. DragonFly's M_WAITOK
Matthew Dillon [Wed, 17 Nov 2004 18:59:21 +0000 (18:59 +0000)]
Cave in and remove NULL checks for M_WAITOK mallocs.  DragonFly's M_WAITOK
malloc will panic rather then return NULL, unless M_NULLOK is also specified,
so we don't actually have to check for NULL most of the time.

Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
16 years agoFix a bug in the checking of malloc()'s return value. It turns out to have
Matthew Dillon [Wed, 17 Nov 2004 18:27:17 +0000 (18:27 +0000)]
Fix a bug in the checking of malloc()'s return value.  It turns out to have
been masked by the fact that M_WAITOK does not return NULL anyway.

Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
16 years agoUse the YACC source for c-exp.y and f-exp.y, not the pre-built
Joerg Sonnenberger [Wed, 17 Nov 2004 12:27:59 +0000 (12:27 +0000)]
Use the YACC source for c-exp.y and f-exp.y, not the pre-built
BISON parse. This solves the *very* strange build problem with
-jX in buildworld, where make tries to build this files from
source using the default rules. Those rules are not save for
parallel builds.

16 years agoAlways use the width field from the varent, not the original width.
Joerg Sonnenberger [Wed, 17 Nov 2004 10:09:44 +0000 (10:09 +0000)]
Always use the width field from the varent, not the original width.
This fixes the output of oversized fields messing the overall table
layout.

Reported-by: Peter Avalos <pavalos@theshell.com>
16 years agoTemporarily change the net.inet.tcp.sack default from 1 to 0 after confirmed
Matthew Dillon [Wed, 17 Nov 2004 02:18:17 +0000 (02:18 +0000)]
Temporarily change the net.inet.tcp.sack default from 1 to 0 after confirmed
reports of file corruption in downloads.  This will be changed back to 1
after we figure out and fix the issue.

Corrupted-downloads-reported-by: walt <wa1ter@myrealbox.com>
16 years agoReplace spkrtest script with a shell version.
Joerg Sonnenberger [Tue, 16 Nov 2004 22:21:15 +0000 (22:21 +0000)]
Replace spkrtest script with a shell version.

Obtained-from: FreeBSD

16 years agoDon't install the undocumented scriptdump Perl script.
Joerg Sonnenberger [Tue, 16 Nov 2004 22:04:37 +0000 (22:04 +0000)]
Don't install the undocumented scriptdump Perl script.

16 years agoOverride USE_GCC=3.4, we want to use our system compiler in that case.
Joerg Sonnenberger [Tue, 16 Nov 2004 20:09:26 +0000 (20:09 +0000)]
Override USE_GCC=3.4, we want to use our system compiler in that case.

16 years ago- Use the correct error functions
Liam J. Foy [Tue, 16 Nov 2004 19:06:29 +0000 (19:06 +0000)]
- Use the correct error functions
- Use the correct function to close the client

16 years ago- Set the clnt error functions 's' argument to const char *
Liam J. Foy [Tue, 16 Nov 2004 18:55:45 +0000 (18:55 +0000)]
- Set the clnt error functions 's' argument to const char *
- Update rpc.3

16 years ago- Set the clnt error functions protos from char * -> const char *
Liam J. Foy [Tue, 16 Nov 2004 18:55:04 +0000 (18:55 +0000)]
- Set the clnt error functions protos from char * -> const char *

16 years agoDo not overwrite z*grep commands with shell wrappers in this directory.
YONETANI Tomokazu [Tue, 16 Nov 2004 16:54:57 +0000 (16:54 +0000)]
Do not overwrite z*grep commands with shell wrappers in this directory.
These z*grep shell wrappers rely on `--label' option when they deal with
multiple files, and our version of grep doesn't have that option.

16 years agoMove away from GNU traceroute and use the BSD licensed one.
Eirik Nygaard [Tue, 16 Nov 2004 14:49:54 +0000 (14:49 +0000)]
Move away from GNU traceroute and use the BSD licensed one.

16 years agoFix traceroute.
Eirik Nygaard [Tue, 16 Nov 2004 14:36:01 +0000 (14:36 +0000)]
Fix traceroute.
sendto() to a inet socket wants wants ip->ip_len to be in host order, not
network order.

Submitted by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

16 years agoFix a bug in parsefmt where a string still referenced would be freed.
Joerg Sonnenberger [Tue, 16 Nov 2004 12:38:04 +0000 (12:38 +0000)]
Fix a bug in parsefmt where a string still referenced would be freed.

Submitted-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Slightly modified from the original version.

16 years ago- use STAILQ, instead of hand grown implementation
Joerg Sonnenberger [Tue, 16 Nov 2004 12:16:36 +0000 (12:16 +0000)]
- use STAILQ, instead of hand grown implementation
- split VARENT/VAR into varent with a const point to var and header, width
  and dwidth as modifiable fields
- change users of most VARENT fields to use the modifiable fields
- make VAR[] var static const now
- remove dwidth field from VAR, not needed now
- while changing prototypes anyway, remove the unneeded space before the
  argument list

16 years agoWARNS= 6 cleanup.
Eirik Nygaard [Mon, 15 Nov 2004 19:57:35 +0000 (19:57 +0000)]
WARNS= 6 cleanup.

16 years agoAdd some more hacks for dfport handling, to allow make index to mostly
Joerg Sonnenberger [Mon, 15 Nov 2004 14:29:00 +0000 (14:29 +0000)]
Add some more hacks for dfport handling, to allow make index to mostly
work.

16 years agoBack out constification. This caused a SIGBUS becaus a functon wanted to write
Eirik Nygaard [Mon, 15 Nov 2004 14:04:33 +0000 (14:04 +0000)]
Back out constification. This caused a SIGBUS becaus a functon wanted to write
to the var struct.

Noticed by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>

16 years agoCleanup send-pr and ptx on next update.
Joerg Sonnenberger [Mon, 15 Nov 2004 10:19:07 +0000 (10:19 +0000)]
Cleanup send-pr and ptx on next update.

16 years agoRemove the old release infrastruture. Certain parts e.g. sysinstall or
Joerg Sonnenberger [Mon, 15 Nov 2004 10:18:15 +0000 (10:18 +0000)]
Remove the old release infrastruture. Certain parts e.g. sysinstall or
the picobsd stuff should be kept for future reference in the attic.

16 years agoSync with FreeBSD. This removes the need for perl.
Joerg Sonnenberger [Mon, 15 Nov 2004 10:01:41 +0000 (10:01 +0000)]
Sync with FreeBSD. This removes the need for perl.

16 years agoAdd preprocessor handling for newer processor, they should get the better
Joerg Sonnenberger [Mon, 15 Nov 2004 08:16:02 +0000 (08:16 +0000)]
Add preprocessor handling for newer processor, they should get the better
assembler too.

16 years agoThe code and sources here haven't been used since FreeBSD 2.x, nuke
Joerg Sonnenberger [Mon, 15 Nov 2004 08:15:15 +0000 (08:15 +0000)]
The code and sources here haven't been used since FreeBSD 2.x, nuke
them.

Inspired-by: FreeBSD
16 years agoRemove ptx, it isn't maintained and hasn't been used by base for years.
Joerg Sonnenberger [Mon, 15 Nov 2004 08:14:00 +0000 (08:14 +0000)]
Remove ptx, it isn't maintained and hasn't been used by base for years.

Inspired-by: FreeBSD
Remove send-pr, once we have an official bugtracker, we can replace it
with a matching script. But we don't want to use GNATS, so no need for
send-pr.

16 years agoSync with FreeBSD. Most importantly, this removes the need for perl.
Joerg Sonnenberger [Mon, 15 Nov 2004 08:11:59 +0000 (08:11 +0000)]
Sync with FreeBSD. Most importantly, this removes the need for perl.

16 years agoFix an inverted conditional which could lead to nameBuf being truncated in
Matthew Dillon [Sun, 14 Nov 2004 20:13:12 +0000 (20:13 +0000)]
Fix an inverted conditional which could lead to nameBuf being truncated in
the later snprintf().

Noticed-by: Max Okumoto <okumoto@home>
16 years ago- Remove sys/time.h
Liam J. Foy [Sun, 14 Nov 2004 20:07:25 +0000 (20:07 +0000)]
- Remove sys/time.h
- Use __unused in the sig handlers
- Static functions
- Other minor changes

Note: The sig handler nonfs is not save. Joerg is going to work on this
himself.

16 years agoContinuing synchronization from FreeBSD.
Matthew Dillon [Sun, 14 Nov 2004 20:05:26 +0000 (20:05 +0000)]
Continuing synchronization from FreeBSD.

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
16 years agoFix a lhs-cast by casting first to unsigned char and then to the
Joerg Sonnenberger [Sun, 14 Nov 2004 19:38:34 +0000 (19:38 +0000)]
Fix a lhs-cast by casting first to unsigned char and then to the
type-correct char.

16 years agoRemove the dependency on either asprintf or va_copy. This will be included
Joerg Sonnenberger [Sun, 14 Nov 2004 18:45:55 +0000 (18:45 +0000)]
Remove the dependency on either asprintf or va_copy. This will be included
in later versions by default.

Obtained-from: Tim Kientzle <tim@kientzle.com>

16 years agoRemove CFLAGS?= 2
Joerg Sonnenberger [Sun, 14 Nov 2004 18:20:08 +0000 (18:20 +0000)]
Remove CFLAGS?= 2

16 years ago-Wall -Wstrict-prototypes already in CFLAGS.
Joerg Sonnenberger [Sun, 14 Nov 2004 18:18:30 +0000 (18:18 +0000)]
-Wall -Wstrict-prototypes already in CFLAGS.

16 years ago-W is included in CFLAGS already.
Joerg Sonnenberger [Sun, 14 Nov 2004 18:17:41 +0000 (18:17 +0000)]
-W is included in CFLAGS already.

16 years agoFix an endian bug in pflog. The DragonFly version of PF uses the normal
Joerg Sonnenberger [Sun, 14 Nov 2004 17:27:31 +0000 (17:27 +0000)]
Fix an endian bug in pflog. The DragonFly version of PF uses the normal
host byte order instead of network byte order as used by OpenBSD and
FreeBSD. Normally the ether_output code converts this back, but for
pflog, we shortcut these code. Therefore, before calling bpf_mtap, switch
the byte order back to network order and revert it afterwards.

Problem-reported-by: Erik P. Skaalerud
16 years agoRemove xpt_release_simq_timeout(), this function has not been in use since the
Eirik Nygaard [Sun, 14 Nov 2004 16:48:36 +0000 (16:48 +0000)]
Remove xpt_release_simq_timeout(), this function has not been in use since the
timeout/untimeout ==> callout_* transformation.

16 years agoIf the first slot is empty, don't continue scanning. This fixes hangs
Joerg Sonnenberger [Sun, 14 Nov 2004 15:20:05 +0000 (15:20 +0000)]
If the first slot is empty, don't continue scanning. This fixes hangs
on some machines.

Obtained-from: FreeBSD

16 years agoMerge from vendor branch GDB:
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Merge from vendor branch GDB:
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

16 years agoAdd solib-legacy.c, it is needed for proper attach support.
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

16 years agoAdd solib-legacy.c, it is needed for proper attach support.
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

16 years agoConstify VAR.
Eirik Nygaard [Sun, 14 Nov 2004 13:58:42 +0000 (13:58 +0000)]
Constify VAR.

Submitted by: joerg

WARNS=6 cleanup.

16 years agodirect sysargs to /dev/null for the emualtion system call sets to avoid a
Matthew Dillon [Sun, 14 Nov 2004 01:45:25 +0000 (01:45 +0000)]
direct sysargs to /dev/null for the emualtion system call sets to avoid a
make all_sysent build error.

16 years agoPartial sync from FreeBSD, add dummy syscalls for extended attribte
Matthew Dillon [Sun, 14 Nov 2004 01:41:41 +0000 (01:41 +0000)]
Partial sync from FreeBSD, add dummy syscalls for extended attribte
operations to return ENOATTR rather then ENOSYS (which causes a core dump).

Reported-by: John Duncan <agley@optusnet.com.au>
16 years agoImplement SACK.
Jeffrey Hsu [Sun, 14 Nov 2004 00:49:08 +0000 (00:49 +0000)]
Implement SACK.

16 years ago* Restore indentation to tabs.
Matthew Dillon [Sat, 13 Nov 2004 23:23:08 +0000 (23:23 +0000)]
* Restore indentation to tabs.
* Make it WARNS?=6 clean.
* Remove an unnecessary void cast.
* Declare static functions as static..
* Remove some unnecessary return statements at the end of void functions.

Submitted-by: Sascha Wildner <saw@online.de>
16 years agoAdd support for the ATI Radeon 9600 XT and XT_S.
Matthew Dillon [Sat, 13 Nov 2004 23:04:14 +0000 (23:04 +0000)]
Add support for the ATI Radeon 9600 XT and XT_S.

Submitted-by: "Pablo M<E9>ndez Hern<E1>ndez" <ciph3r@telefonica.net>
16 years agoSpelling corrections.
Matthew Dillon [Sat, 13 Nov 2004 22:42:43 +0000 (22:42 +0000)]
Spelling corrections.

Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD (2001/02/18 10:43:32)

16 years agoRemove left-over '{'.
Joerg Sonnenberger [Sat, 13 Nov 2004 17:31:00 +0000 (17:31 +0000)]
Remove left-over '{'.

16 years agoFix the condition under which yacc -o is used. This should fix the parallel
Joerg Sonnenberger [Sat, 13 Nov 2004 16:52:36 +0000 (16:52 +0000)]
Fix the condition under which yacc -o is used. This should fix the parallel
build in gdb.

Obtained-from: FreeBSD
Problems-reported-by: various folks
16 years ago- Remove main proto
Liam J. Foy [Sat, 13 Nov 2004 16:14:33 +0000 (16:14 +0000)]
- Remove main proto
- Don't bother using *logfile, just use _PATH_LASTLOG
- WARN 6 and remove CFLAGS

Ok'ed: Joerg

16 years agoShow the CPU used by the multi-threaded network stack to handle a socket.
Joerg Sonnenberger [Sat, 13 Nov 2004 13:57:36 +0000 (13:57 +0000)]
Show the CPU used by the multi-threaded network stack to handle a socket.

Submitted-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Slightly modified to skip the column on single CPU machines.

16 years agoRemove ntpdate from FILES list as well.
Joerg Sonnenberger [Sat, 13 Nov 2004 13:12:09 +0000 (13:12 +0000)]
Remove ntpdate from FILES list as well.

Reminder-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
16 years agoMake both arguments to str_concat() const char *'s and remove STR_DOFREE
Matthew Dillon [Sat, 13 Nov 2004 07:25:17 +0000 (07:25 +0000)]
Make both arguments to str_concat() const char *'s and remove STR_DOFREE
support.  Manually free the strings in the one routine in dir.c that used
that option, plus some other minor cleanups.

Reported-by: Max Okumoto <okumoto@home>
16 years agoDocument the slightly surprising behaviour of 'ifconfig -alias' when
Chris Pressey [Sat, 13 Nov 2004 04:13:22 +0000 (04:13 +0000)]
Document the slightly surprising behaviour of 'ifconfig -alias' when
no network address is given.

Prompted-by: Marc G. Fournier <scrappyAThubDOTorg>'s Nov 5 2004
             post to freebsd-stable mailing list

16 years agoSplit var.c into var.c and var_modify.c and move all the modification funcs
Matthew Dillon [Sat, 13 Nov 2004 00:10:09 +0000 (00:10 +0000)]
Split var.c into var.c and var_modify.c and move all the modification funcs
to var_modify.c, for readability.  constify some low hanging fruit (string
manipulation functions) and the upper layers appropriately.  No longer use
the private strstr(3) implementation, while changing string code.  Add var.h

Taken-From: FreeBSD/jmallett

16 years agoSplit var.c into var.c and var_modify.c and move all the modification funcs
Matthew Dillon [Sat, 13 Nov 2004 00:06:16 +0000 (00:06 +0000)]
Split var.c into var.c and var_modify.c and move all the modification funcs
to var_modify.c, for readability.  constify some low hanging fruit (string
manipulation functions) and the upper layers appropriately.  No longer use
the private strstr(3) implementation, while changing string code.  Add var.h

Taken-From: FreeBSD/jmallett

16 years agoPossibly expand the variable name's embedded variables before using it, as
Matthew Dillon [Fri, 12 Nov 2004 23:26:52 +0000 (23:26 +0000)]
Possibly expand the variable name's embedded variables before using it, as
seen (somewhat) in NetBSD.  This catches a few extra recursion cases that
could be hidden by expanding a NIL variable causing an existing variable to
be returned (which caused infinite looping and climbing memory usage in at
least one case).

Taken-From: FreeBSD/1.27,1.28 (jmallett), originally obtained from NetBSD

16 years agoConvert make(1) to use ANSI style function declarations. Variable
Matthew Dillon [Fri, 12 Nov 2004 22:57:04 +0000 (22:57 +0000)]
Convert make(1) to use ANSI style function declarations.  Variable
documentation already adequatedly existed in the description in most
cases.  Where it did not, it was added.  If no documentation existed
beforehand, then none was added.  Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.

Taken-from: FreeBSD/jmallett

16 years agoMake the DEBUGF() macro portable by (ugh) adding a Debug() function, which
Matthew Dillon [Fri, 12 Nov 2004 22:42:36 +0000 (22:42 +0000)]
Make the DEBUGF() macro portable by (ugh) adding a Debug() function, which
is merely printf() but to stderr.  This takes care of the caveat which lead
to the use of a vararg macro -- getting everything to stderr.

Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
variable length arguments to a macro.  Bump version as this makes DEBUG
statements *always* go to stderr rather than sometimes stdout.  There are
a few stragglers, which I will take care of as soon as I can.  Mostly these
relate to the need-for-death-of some of the remote job code.

Taken-From: FreeBSD/jmallett

16 years agoDiff reduction for great justice against NetBSD, cast to unsigned char when
Matthew Dillon [Fri, 12 Nov 2004 22:28:05 +0000 (22:28 +0000)]
Diff reduction for great justice against NetBSD, cast to unsigned char when
passing an argument to isspace(3).

Taken-from: FreeBSD/jmallett

16 years agoPartial sync from FreeBSD/jmallet:
Matthew Dillon [Fri, 12 Nov 2004 22:11:33 +0000 (22:11 +0000)]
Partial sync from  FreeBSD/jmallet:

String lengths and sizeof()s are size_t not int.  Mark an unused parameter
of ReadMakefile as __unused, it's there because this function is used by
the abstracted list interface

16 years agoDo some deregisterization.
Matthew Dillon [Fri, 12 Nov 2004 22:02:51 +0000 (22:02 +0000)]
Do some deregisterization.

Taken-From: FreeBSD/obrien.

16 years agoefree()->free(). remove #define efree (which was defined to free).
Matthew Dillon [Fri, 12 Nov 2004 21:52:04 +0000 (21:52 +0000)]
efree()->free().  remove #define efree (which was defined to free).

Taken-From: FreeBSD

16 years agoThe strings package passes back a pointer via brk_string() to internal
Matthew Dillon [Fri, 12 Nov 2004 21:46:09 +0000 (21:46 +0000)]
The strings package passes back a pointer via brk_string() to internal
memory, it should not be deallocated.  The memory is allocated in str_init()
and release in str_end() which are only called in main().

Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD/1.22

16 years agoRemove various forms of NULL, and cleanup types. This is a partial sync from
Matthew Dillon [Fri, 12 Nov 2004 21:41:54 +0000 (21:41 +0000)]
Remove various forms of NULL, and cleanup types.  This is a partial sync from
FreeBSD's make.

Submitted-by: Max Okumoto <okumoto@home>
16 years agoAdd a missing com_unlock() to the serial port drain test code. This code
Matthew Dillon [Fri, 12 Nov 2004 20:51:29 +0000 (20:51 +0000)]
Add a missing com_unlock() to the serial port drain test code.  This code
is necessary to detect non-existant serial ports on machines (such as the
eMachines laptop) which don't have any serial port hardware at all, but
the missing com_unlock() caused systems to crash in certain situations for
obvious reasons.

Many thanks to Glenn Johnson <glennpj@charter.net> for keeping on my back
about the issue and for testing the fix.  This should also fix the last of the
serial-port related bug reports stemming from the original 1.0A release.