dragonfly.git
19 years agoUpdate some of my copyright notices before we officially publish
Jeffrey Hsu [Fri, 2 Jul 2004 04:41:01 +0000 (04:41 +0000)]
Update some of my copyright notices before we officially publish
DragonFlyBSD in Release 1.0.

19 years agoUpdate our xlint(1) to work with recent preprocessor changes.
Hiten Pandya [Thu, 1 Jul 2004 01:31:45 +0000 (01:31 +0000)]
Update our xlint(1) to work with recent preprocessor changes.

This should get lint(1) working again.

19 years agoMake sure the xe driver found a supported card type, if it didn't then bail
Eirik Nygaard [Wed, 30 Jun 2004 12:14:39 +0000 (12:14 +0000)]
Make sure the xe driver found a supported card type, if it didn't then bail
out.

Okayed by: joerg

19 years agoFix a snafu in the last commit. In the normal non-polling case interrupts
Matthew Dillon [Tue, 29 Jun 2004 00:45:15 +0000 (00:45 +0000)]
Fix a snafu in the last commit.  In the normal non-polling case interrupts
were not being reenabled at the end of the service routine, breaking the
driver.

Reported-by: walt <wa1ter@myrealbox.com>, Richard Nyberg <rnyberg@it.su.se>
19 years agoChange the version string to RC1
Matthew Dillon [Mon, 28 Jun 2004 06:20:50 +0000 (06:20 +0000)]
Change the version string to RC1

19 years agoUndo one of the recent optimizations I made (only running the handlers
Matthew Dillon [Mon, 28 Jun 2004 05:02:56 +0000 (05:02 +0000)]
Undo one of the recent optimizations I made (only running the handlers
if the irunning bit is set).  Something is not working as intended and
this is leading to timeouts.

19 years agoUpdate the README file with useful information about ACPI.
Matthew Dillon [Mon, 28 Jun 2004 04:18:55 +0000 (04:18 +0000)]
Update the README file with useful information about ACPI.

19 years agoUpdate some copyright notices to become more legal compliant.
David Rhodus [Mon, 28 Jun 2004 02:57:11 +0000 (02:57 +0000)]
Update some copyright notices to become more legal compliant.

Noted by : joerg
Change ok from : dillon, hmp

19 years agoSync in Copyright notice change from FreeBSD.
David Rhodus [Mon, 28 Jun 2004 02:49:06 +0000 (02:49 +0000)]
Sync in Copyright notice change from FreeBSD.

19 years agoIncrease PCCARD_CIS_SIZE from 1024 to 4096 as per FreeBSD-5. Add range
Matthew Dillon [Mon, 28 Jun 2004 02:34:44 +0000 (02:34 +0000)]
Increase PCCARD_CIS_SIZE from 1024 to 4096 as per FreeBSD-5.  Add range
checking to all offsets (fixes a panic on my laptop when I stick in my
ED ether cardbus card, which it doesn't recognize).

19 years agoFix three bugs in the livelock code. Fix a minor range error in an
Matthew Dillon [Mon, 28 Jun 2004 02:33:04 +0000 (02:33 +0000)]
Fix three bugs in the livelock code.  Fix a minor range error in an
assertion, fix an incorrect livelock wakeup argument type (which could lead
to crashes), and use the cpu timer instead of ticks since a livelock may
prevent ticks from incrementing.

For now set the livelock limit to 50,000 interrupts/sec, which is about
right for a ~600Mhz P3.  But what we really need to do is scale it based
on the perceived speed of the system since GiGE is likely able to blow
away 50KI/S.

Tested with: inserting and removing cardbus cards quickly and repeatedly,
which normally locks up a FreeBSD box.

19 years agoThe acpica-unix-20040527 download from intel seems to like to use upper
Matthew Dillon [Sun, 27 Jun 2004 22:08:57 +0000 (22:08 +0000)]
The acpica-unix-20040527 download from intel seems to like to use upper
case directory names.  Just add them to the path so we don't have to worry
about it later.

19 years agoTurn the getty on on ttyd0 by default so a CDBOOT will run all the way through
Matthew Dillon [Sun, 27 Jun 2004 21:39:04 +0000 (21:39 +0000)]
Turn the getty on on ttyd0 by default so a CDBOOT will run all the way through
to a prompt on com1.  It is far more common for the serial port to be connected
to a serial console, or not connected at all, then for it to be connected to
a UPS or a MODEM, especially when one is using the CD.

19 years agoAddendum: it should be noted that boot2 also probes for a valid serial
Matthew Dillon [Sun, 27 Jun 2004 21:27:36 +0000 (21:27 +0000)]
Addendum: it should be noted that boot2 also probes for a valid serial
port and will tell the loader not to use it, but the loader is directly
run from cdboot and (I think) pxeboot and does not have that benefit in
those situations, so we have to check again.

19 years agoProperly probe for the serial port. If the serial port is unmapped or
Matthew Dillon [Sun, 27 Jun 2004 21:26:40 +0000 (21:26 +0000)]
Properly probe for the serial port.  If the serial port is unmapped or
we can't clear the LSR_RXRDY bit by draining the data port then attempting
to use the serial port will result in an input loop lockup.

19 years agoThe schednetisr() routine is supposed to be MP and interrupt safe, but wasn't
Matthew Dillon [Sun, 27 Jun 2004 19:40:14 +0000 (19:40 +0000)]
The schednetisr() routine is supposed to be MP and interrupt safe, but wasn't
because it allocated its messages.  Instead of allocating a message use a
fixed message in the netisr structure.

Get rid of #ifdef SMP/#error.  DEVICE_POLLING now works on SMP builds.

Implement an emergency polling enable function to try to keep the system
operational in a degraded state if interrupt routing is blown.  NOTE: only
vr0 uses the feature at the moment, and DEVICE_POLLING must be enabled.

19 years agoImplement livelock detection for threaded interrupts and automatically
Matthew Dillon [Sun, 27 Jun 2004 19:37:22 +0000 (19:37 +0000)]
Implement livelock detection for threaded interrupts and automatically
throttle such interrupts via the kern.livelock_limit and kern.livelock_fallback
sysctls.   The throttling is removed when the interrupt rate falls below
1/2 the fallback rate.

19 years agoMake the VR device backdown to emergency polling if the interrupt appears
Matthew Dillon [Sun, 27 Jun 2004 19:01:54 +0000 (19:01 +0000)]
Make the VR device backdown to emergency polling if the interrupt appears
to broken.  This is demonstrative, and works, but should probably be
integrated into netif instead of into the device code.

19 years agoUse correct copy-write notation for The DragonFly project copy-writes.
David Rhodus [Sun, 27 Jun 2004 18:23:11 +0000 (18:23 +0000)]
Use correct copy-write notation for The DragonFly project copy-writes.

Noted by: joerg

19 years agoShow a more complete listing of interrupt sources (do not weed out sources
Matthew Dillon [Sun, 27 Jun 2004 17:39:05 +0000 (17:39 +0000)]
Show a more complete listing of interrupt sources (do not weed out sources
with a count of 0).

19 years agoAdd note to cpu_idle_hook (which is currently asserted so the code doesn't
Matthew Dillon [Sun, 27 Jun 2004 09:08:44 +0000 (09:08 +0000)]
Add note to cpu_idle_hook (which is currently asserted so the code doesn't
actually run) ... that when we do eventually try to hook it in, we probably
should only hook it in when ncpus == 1 and otherwise not.

19 years agoBring in YONETANI Tomokazu's acpi-update-2.patch (27-May-2004), a major
Matthew Dillon [Sun, 27 Jun 2004 08:52:46 +0000 (08:52 +0000)]
Bring in YONETANI Tomokazu's acpi-update-2.patch (27-May-2004), a major
update to acpica5 support in the system that fixes more issues that can
be counted on 12, er, 10 fingers.

Submitted-by: YONETANI Tomokazu <qhwt+dragonfly-bugs@les.ath.cx>
19 years agoMore missed named fixups related to the include directory move.
Matthew Dillon [Sun, 27 Jun 2004 08:43:56 +0000 (08:43 +0000)]
More missed named fixups related to the include directory move.

19 years agoBe ultra conservative for now, do not try to initialize the FIFO.
Matthew Dillon [Sun, 27 Jun 2004 08:01:06 +0000 (08:01 +0000)]
Be ultra conservative for now, do not try to initialize the FIFO.

19 years agoFix a minor bug in the auto-console selection (handle the -m mute option
Matthew Dillon [Sun, 27 Jun 2004 08:00:46 +0000 (08:00 +0000)]
Fix a minor bug in the auto-console selection (handle the -m mute option
properly).

Detect when the serial port is unmapped (reads 0xFF) by putting a limit in
the flush code and returning a testable value, then refuse to automatically
configure it if so because an unmapped serial port always looks like it has
input pending.

This fixes a dual-console issue with laptops that don't map the serial port
during the boot stage (e.g. my emachines amd64 laptop).

Be ultra conservative for now, do not try to initialize the FIFO.

19 years agoPrint the correct list in _lf_print_lock
Joerg Sonnenberger [Sun, 27 Jun 2004 03:22:01 +0000 (03:22 +0000)]
Print the correct list in _lf_print_lock

19 years agoDo a bit of cleanup and enable the SIO FIFO (1655x) to reduce latencies
Matthew Dillon [Sat, 26 Jun 2004 23:41:09 +0000 (23:41 +0000)]
Do a bit of cleanup and enable the SIO FIFO (1655x) to reduce latencies
generated by the disk twiddle (the \ | / - \ | twirly that occurs on the
screen).

19 years agoDo not try to chflags() a symbolic link when copying an underlying filesytem
Matthew Dillon [Sat, 26 Jun 2004 22:54:01 +0000 (22:54 +0000)]
Do not try to chflags() a symbolic link when copying an underlying filesytem
into a covering MFS mount.

19 years agoDo not generate the 'Block size restricts cylinder groups to BLAH' warning
Matthew Dillon [Sat, 26 Jun 2004 22:44:05 +0000 (22:44 +0000)]
Do not generate the 'Block size restricts cylinder groups to BLAH' warning
when generating an MFS filesystem.

19 years agoBring boot2 and the loader into line with our new dual-console support.
Matthew Dillon [Sat, 26 Jun 2004 22:37:11 +0000 (22:37 +0000)]
Bring boot2 and the loader into line with our new dual-console support.
We now support dual-consoles by default with options to force either
video (-V) or serial port (-h).  Both boot2 and the loader now properly
parse the options/howto-flags.

Note that the kernel does not yet support dual consoles, but the loader
does tell the kernel which console to use based on which console was used
during the load stage (or the video console if no input was received from
any console during the load stage).

19 years agoUpdate contrib/cvs to contrib/cvs-1.12.8, but note that this Makefile
Matthew Dillon [Sat, 26 Jun 2004 17:44:23 +0000 (17:44 +0000)]
Update contrib/cvs to contrib/cvs-1.12.8, but note that this Makefile
needs to be cleaned up for the doc changes in 1.12.8 and is currently
disabled.

19 years agoRemove 28.cvs for now (the files involved do not exist in the latest contrib)
Matthew Dillon [Sat, 26 Jun 2004 17:43:38 +0000 (17:43 +0000)]
Remove 28.cvs for now (the files involved do not exist in the latest contrib)

19 years agoMove include path work for named related utilities.
Matthew Dillon [Sat, 26 Jun 2004 17:06:36 +0000 (17:06 +0000)]
Move include path work for named related utilities.

19 years agoEnhance lockf's debugging with macros. Print the originating process in
Matthew Dillon [Sat, 26 Jun 2004 17:03:47 +0000 (17:03 +0000)]
Enhance lockf's debugging with macros.  Print the originating process in
addition the the 'lock' process (which is often 0 for flock locks).

19 years agondp was using the old contrib/tcpdump instead of contrib/tcpdump-3.8.3
Matthew Dillon [Sat, 26 Jun 2004 16:55:04 +0000 (16:55 +0000)]
ndp was using the old contrib/tcpdump instead of contrib/tcpdump-3.8.3

19 years agoReorganize the subdirectories into an include/ subdirectory so the
Matthew Dillon [Sat, 26 Jun 2004 16:09:43 +0000 (16:09 +0000)]
Reorganize the subdirectories into an include/ subdirectory so the
named subdirectory in the source tree does not conflict with the named binary
in the object tree (this confuses make clean).

Note: subdirectories moved via repository copy.

Reported-by: Sascha Wildner <saw@online.de>
19 years agoDocument the 'running_threads' GDB macro.
Hiten Pandya [Sat, 26 Jun 2004 13:19:06 +0000 (13:19 +0000)]
Document the 'running_threads' GDB macro.

19 years agoAdd a debug directory under src/test, where we will house all of our debug
Hiten Pandya [Sat, 26 Jun 2004 13:09:52 +0000 (13:09 +0000)]
Add a debug directory under src/test, where we will house all of our debug
scripts that will aid the debugging of the kernel and other code.

I have added a GDB macro set in file 'gdb.kernel' which contains some
helpful macros, such as listing processes, iterating CPU's globaldata,
a kldstat(1) style macro etc.

The 'gdb.kernel' file was written by:

Hiten Pandya <hmp@backplane.com>,
Matthew Dillon <dillon@apollo.backplane.com>

The kldstat(1) macro should be helpful with the asf(1) utility which
is used for setting the right offset to load the KLD's symbols.

19 years agoAdd a short unconditional sleep in the lockf retry path to try to
Matthew Dillon [Sat, 26 Jun 2004 08:35:15 +0000 (08:35 +0000)]
Add a short unconditional sleep in the lockf retry path to try to
avoid locking up the system when a livelock bug we are trying to track down
occurs.

19 years agoUnhook bios_howmem (a simple reporting variable), it isn't ready yet.
Matthew Dillon [Sat, 26 Jun 2004 03:03:59 +0000 (03:03 +0000)]
Unhook bios_howmem (a simple reporting variable), it isn't ready yet.

19 years agoUnhook gcc-3.3 from the buildworld process. This also removes the gcc3
David Rhodus [Sat, 26 Jun 2004 02:56:48 +0000 (02:56 +0000)]
Unhook gcc-3.3 from the buildworld process. This also removes the gcc3
leftover files when `make upgrade` is run.

19 years agoAdd some early serial console debugging support to the loader. This is all
Matthew Dillon [Sat, 26 Jun 2004 02:26:22 +0000 (02:26 +0000)]
Add some early serial console debugging support to the loader.  This is all
#ifdef'd out and has no impact on normal builds.

19 years agoSome general cleanups and use M_ZERO instead of bzero() in one case
Matthew Dillon [Sat, 26 Jun 2004 02:15:16 +0000 (02:15 +0000)]
Some general cleanups and use M_ZERO instead of bzero() in one case
(not a bug).

19 years agoWhen a kernel-created thread exits, properly remove it from gd_tdallq and
Matthew Dillon [Sat, 26 Jun 2004 02:14:31 +0000 (02:14 +0000)]
When a kernel-created thread exits, properly remove it from gd_tdallq and
only queue it on gd_tdfreeq only if it was originally allocated.  Note:
kernel threads do not usually exit so this did not fix any known panics.

19 years agoCleanup a comment.
Matthew Dillon [Sat, 26 Jun 2004 02:12:49 +0000 (02:12 +0000)]
Cleanup a comment.

19 years agoIf Preposterous BIOS basemem is detected, instead of truncating to 640K
Matthew Dillon [Sat, 26 Jun 2004 02:12:08 +0000 (02:12 +0000)]
If Preposterous BIOS basemem is detected, instead of truncating to 640K
truncate to 636K in a vain attempt to be play nicer with broken BIOSES.

19 years agoAdd a signature for bootn0 so boot0cfg doesn't complain about it, even
Matthew Dillon [Sat, 26 Jun 2004 02:04:39 +0000 (02:04 +0000)]
Add a signature for bootn0 so boot0cfg doesn't complain about it, even
though it isn't hooked up to the tree yet.

19 years agoStage 1/999: Rewrite boot0 to relocate to higher memory (beyond 64K). This
Matthew Dillon [Sat, 26 Jun 2004 02:00:11 +0000 (02:00 +0000)]
Stage 1/999: Rewrite boot0 to relocate to higher memory (beyond 64K).  This
is currently a demonstration only but will become part of a larger project
to try to make our boot0,1,2/loader code more BIOS-friendly.

19 years agoMerge from FreeBSD-4, revision 1.1.2.9:
Hiten Pandya [Fri, 25 Jun 2004 18:09:56 +0000 (18:09 +0000)]
Merge from FreeBSD-4, revision 1.1.2.9:

1) Fixed potential problem that would cause out-of-order requests
   in twe_startio().
2) Fixed possible race condition in twe_start.

Discussed with, and tested by David Rhodus <drhodus@machdep.com>.

19 years agoRemove a vn == vp case that was breaking out of the namecache lookup loop
Matthew Dillon [Fri, 25 Jun 2004 17:37:19 +0000 (17:37 +0000)]
Remove a vn == vp case that was breaking out of the namecache lookup loop
in vn_fullpath().  This can cause a NULL pointer dereferencing panic.  This
is believed to be pre-namecache legacy code that is no longer required.

19 years agoMerge from FreeBSD-4, revision 1.115.2.20:
Hiten Pandya [Fri, 25 Jun 2004 17:16:27 +0000 (17:16 +0000)]
Merge from FreeBSD-4, revision 1.115.2.20:

Pin 0 on the first I/O APIC is always an ExtINT pin.  Some BIOS's are
broken and list the type of the pin as INT rather than ExtINT in the MP
Table.  To workaround, force pin 0 of ioapic 0 to be ExtINT if it is of
type INT.  This is not a MFC as -current has very different apic code now.
Current's mptable parser might need a similar workaround.

This fixes a bunch of Fujitsu machines; more information about the problem
can be viewed at:

http://www.freebsd.org/cgi/query-pr.cgi?pr=39234

Discussed-with:  David Rhodus <drhodus@machdep.com>
                 Matthew Dillon <dillon@backplane.com>

Test equipment was kindly provided by David Rhodus!

19 years agoFix a race in the initialisation of struct lock by moving the TAILQ_INITs
Joerg Sonnenberger [Fri, 25 Jun 2004 15:32:18 +0000 (15:32 +0000)]
Fix a race in the initialisation of struct lock by moving the TAILQ_INITs
under the protection of the pool token.

19 years agoAdd missing WI_UNLOCK
Joerg Sonnenberger [Fri, 25 Jun 2004 09:13:30 +0000 (09:13 +0000)]
Add missing WI_UNLOCK

19 years agoImplement duel-console mode and make it the default. Adjust the boot
Matthew Dillon [Fri, 25 Jun 2004 05:38:00 +0000 (05:38 +0000)]
Implement duel-console mode and make it the default.  Adjust the boot
flags to match.  -D means duel console mode (but it is now the default),
-h makes the serial console the only console, and a new option, -V, makes
the video console the only console.  Support for pre-programming the flags
in the stage1/2 boot will be added in the future.

19 years agoTurn on the DDB_TRACE config option, so that we will get a trace as soon
Hiten Pandya [Fri, 25 Jun 2004 05:09:38 +0000 (05:09 +0000)]
Turn on the DDB_TRACE config option, so that we will get a trace as soon
as we hit a panic and enter DDB.

This is the automatic equivalent of doing a manual 'tr' on DDB.

Discussed-with:
David Rhodus <drhodus@machdep.com>, Matthew Dillon <dillon@backplane.com>

19 years agoMerge rev. 1.7 of FreeBSD's src/sys/dev/twa/twa_freebsd.c.
Hiten Pandya [Fri, 25 Jun 2004 03:37:03 +0000 (03:37 +0000)]
Merge rev. 1.7 of FreeBSD's src/sys/dev/twa/twa_freebsd.c.

Fix a typo that made the busdma tag have a 0 highaddr.

19 years agoConvert the M4'd btxldr.s to a preprocessed btxldr.S (taken from FreeBSD-5)
Matthew Dillon [Fri, 25 Jun 2004 00:38:38 +0000 (00:38 +0000)]
Convert the M4'd btxldr.s to a preprocessed btxldr.S (taken from FreeBSD-5)

19 years agoBring in 1.33 from FreeBSD-5:
Matthew Dillon [Thu, 24 Jun 2004 23:31:06 +0000 (23:31 +0000)]
Bring in 1.33 from FreeBSD-5:

When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
While we end up the same place, we end up with two different CS register
values after the jump and 0xf000 is compatible with the hardware reset value.
This makes a difference if the BIOS does a near jump before a far jump.

Detective work and patch by:     Adrian Steinmann <ast@marabu.ch>

19 years agoDrop to the debugger if unable to sync out the buffers during shutdown.
David Rhodus [Thu, 24 Jun 2004 16:49:13 +0000 (16:49 +0000)]
Drop to the debugger if unable to sync out the buffers during shutdown.

19 years agoMerge from vendor branch GCC:
Joerg Sonnenberger [Thu, 24 Jun 2004 14:16:11 +0000 (14:16 +0000)]
Merge from vendor branch GCC:
This is GCC 3.4, not 3.3

19 years agoThis is GCC 3.4, not 3.3
Joerg Sonnenberger [Thu, 24 Jun 2004 14:16:11 +0000 (14:16 +0000)]
This is GCC 3.4, not 3.3

19 years agoGet rid of the PFIL_HOOKS option, integrate pfil in the system permanently.
Matthew Dillon [Thu, 24 Jun 2004 08:15:18 +0000 (08:15 +0000)]
Get rid of the PFIL_HOOKS option, integrate pfil in the system permanently.
(previously the packet filters couldn't even be kldload'd without PFIL_HOOKS).

19 years agoBackout 1.19. It prevents some machines from booting (READ timeout).
Matthew Dillon [Thu, 24 Jun 2004 07:55:26 +0000 (07:55 +0000)]
Backout 1.19.  It prevents some machines from booting (READ timeout).
I must be misinterpreting how the ATA_A_IDS bit works, or perhaps it is
a write-only bit?   I don't know.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
19 years agoThe route table treats sockaddr data as opaque, which means that the unused
Matthew Dillon [Thu, 24 Jun 2004 07:45:22 +0000 (07:45 +0000)]
The route table treats sockaddr data as opaque, which means that the unused
fields in the structure passed to rtalloc() MUST BE ZERO.

The syncache code allocates a governing struct syncache structure which
contains an embedded struct route, but it does not zero this structure.
When used in a mixed IPV4/IPV6 environment, it is possible for a structure
to be allocated for IPV4 whos unused fields for the route lookup (e.g.
sin_port and sin_zero) may contain garbage.  This screws up the route
table lookup and causes the wrong route to be returned.

I believe the proper fix in this case is to rewrite the route table code,
but since that would take a very long time the fix I am committing is
to have tcp_rtlookup() zero out the sockaddr_in before it builds it for
the rtalloc() call.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
With-help-from: Hiten Pandya <hmp@nxad.com>

19 years agoThis is less, correct name in upgrade file.
Eirik Nygaard [Wed, 23 Jun 2004 20:40:50 +0000 (20:40 +0000)]
This is less, correct name in upgrade file.

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

19 years agoFix a broken vrele() in the session tty exit code.
Matthew Dillon [Wed, 23 Jun 2004 16:45:23 +0000 (16:45 +0000)]
Fix a broken vrele() in the session tty exit code.

Submitted-by: Joerg Sonnenberger <joerg@britannica.bec.de>
19 years agoHack in the code from FreeBSD-5 to set the timings for NVIDIA/AMD chipsets.
Matthew Dillon [Wed, 23 Jun 2004 16:15:24 +0000 (16:15 +0000)]
Hack in the code from FreeBSD-5 to set the timings for NVIDIA/AMD chipsets.
This seems to greatly reduce READ_BIG: ILLEGAL REQUEST problems accessing
a CD on my AMD64 box (NVidia3 chipset, secondary controller, master, PIO4).
The problem occurs at a much lower frequency in overnight tests.  Further
testing is ongoing.

19 years agoDo a partial synch from FreeBSD-5 of the NVIDIA and NFORCE ATA setup code.
Matthew Dillon [Wed, 23 Jun 2004 06:53:13 +0000 (06:53 +0000)]
Do a partial synch from FreeBSD-5 of the NVIDIA and NFORCE ATA setup code.
Our previous code was totally bogus.

19 years agoFix an improper DELAY in the ata tag code (but nobody should be using
Matthew Dillon [Wed, 23 Jun 2004 06:52:26 +0000 (06:52 +0000)]
Fix an improper DELAY in the ata tag code (but nobody should be using
the ata tag code anyway).

19 years agoCheck for a queued interrupt being dispatched after the ATA driver
Matthew Dillon [Wed, 23 Jun 2004 06:51:55 +0000 (06:51 +0000)]
Check for a queued interrupt being dispatched after the ATA driver
diabled the controller interrupt and return if so.  Enclose the ATA
command setup in a critical section.

19 years agoFix indentation.
Hiten Pandya [Wed, 23 Jun 2004 06:27:28 +0000 (06:27 +0000)]
Fix indentation.

19 years agoRemove references to FreeBSD in the comments.
Hiten Pandya [Wed, 23 Jun 2004 06:17:50 +0000 (06:17 +0000)]
Remove references to FreeBSD in the comments.

Discussed-with:  Matthew Dillon <dillon@backplane.com>

19 years agoUnbreak the buildworld by fixing a cc_tools dependancy on cc_prep in
Matthew Dillon [Tue, 22 Jun 2004 21:46:54 +0000 (21:46 +0000)]
Unbreak the buildworld by fixing a cc_tools dependancy on cc_prep in
Makefile.inc1 instead of trying to create a dependancy in cc_tools.  The
object tree had not yet been created for cc_prep and this caused files to
be generated in /usr/src, amoung other things.

19 years agoPerl is no longer user during kernel build, so remove the Perl scripts
Chris Pressey [Tue, 22 Jun 2004 20:51:30 +0000 (20:51 +0000)]
Perl is no longer user during kernel build, so remove the Perl scripts
that are no longer needed for this purpose.

Confirmed-with: eirikn

19 years agoMake virecover more robust. Instead of aborting (and causing
Chris Pressey [Tue, 22 Jun 2004 20:37:02 +0000 (20:37 +0000)]
Make virecover more robust.  Instead of aborting (and causing
subsequent RCNG scripts to fail) when the directory /var/tmp/vi.recover
doesn't exist, just re-create it.

Reviewed-by: eirikn, Devon H. O'Dell, GeekGod
19 years agoTurn propolice (-fstack-protector) on by default. Propolice rearranges
Matthew Dillon [Tue, 22 Jun 2004 16:40:32 +0000 (16:40 +0000)]
Turn propolice (-fstack-protector) on by default.  Propolice rearranges
the ordering of local variable declarations so pointers do not get
overwritten by buffer overflows, and checks a magic marker on return to see
if the return address has been blown away.  It's a very important security
feature.

19 years agoFix -j builds for gcc-3.4. The .nx build in cc_tools was breaking
Matthew Dillon [Mon, 21 Jun 2004 21:50:02 +0000 (21:50 +0000)]
Fix -j builds for gcc-3.4.  The .nx build in cc_tools was breaking
parallelism because individual source/header dependancies were being built
in parallel, and this was causing the helper programs to build in parallel
and/or generate the same header file in parallel.

Remove all direct dependancies on the helper programs.  Make libgcc
dependant on cc_tools (to generate required header files), clean up
the dependancy target for cc_tools, and force make depend to build
the tools in bsd.hostprog.mk.  This should result in all the tools being
available to the rest of the gcc-3.4 build.

Tested with several -j 8 builds.  There could still be additional
-j issues.

19 years agoFix -j builds for gcc-3.4. The .nx build in cc_tools was breaking
Matthew Dillon [Mon, 21 Jun 2004 21:49:13 +0000 (21:49 +0000)]
Fix -j builds for gcc-3.4.  The .nx build in cc_tools was breaking
parallelism because individual source/header dependancies were being built
in parallel, and this was causing the helper programs to build in parallel
and/or generate the same header file in parallel.

Remove all direct dependancies on the helper programs.  Make libgcc
dependant on cc_tools (to generate required header files), clean up
the dependancy target for cc_tools, and force make depend to build
the tools.  This should result in all the tools being available to the
rest of the gcc-3.4 build.

Tested with several -j 8 builds.  There could still be additional
-j issues.

19 years agoMerge with FreeBSD (HEAD) src/usr.sbin/adduser/*:
Chris Pressey [Mon, 21 Jun 2004 17:47:12 +0000 (17:47 +0000)]
Merge with FreeBSD (HEAD) src/usr.sbin/adduser/*:

Move towards Perl removal from the base by replacing the Perl scripts
`adduser' and `rmuser' with corresponding versions from FreeBSD 5
which are written in the Bourne shell.

Submitted-by: Tim Wickberg <me at k9mach3 dot org>
Additional-testing-by: William DeVries
19 years agoSome more M_NOWAIT->M_INTWAIT. Not sure if the sym changes are correct,
Matthew Dillon [Mon, 21 Jun 2004 15:45:42 +0000 (15:45 +0000)]
Some more M_NOWAIT->M_INTWAIT.  Not sure if the sym changes are correct,
but they are more correct then using M_NOWAIT.

19 years agoGeneral M_NOWAIT -> M_INTWAIT work, except in periodic timeout() routines
Matthew Dillon [Mon, 21 Jun 2004 15:39:31 +0000 (15:39 +0000)]
General M_NOWAIT -> M_INTWAIT work, except in periodic timeout() routines
which can handle occassional malloc() failures and really shouldn't block.

19 years agoCorrect a known panic in the twe driver, M_NOWAIT -> M_INTWAIT work.
Matthew Dillon [Mon, 21 Jun 2004 15:35:41 +0000 (15:35 +0000)]
Correct a known panic in the twe driver, M_NOWAIT -> M_INTWAIT work.

19 years agogcc-3.4 cleanups. missing break / goto labels.
Matthew Dillon [Mon, 21 Jun 2004 06:02:21 +0000 (06:02 +0000)]
gcc-3.4 cleanups.  missing break / goto labels.

19 years agogcc-3.4 cleanups. Add missing break statements, deal with goto labels,
Matthew Dillon [Mon, 21 Jun 2004 05:58:01 +0000 (05:58 +0000)]
gcc-3.4 cleanups.  Add missing break statements, deal with goto labels,
and adjust the use of __FUNCTION__ (string concat is no longer supported).

19 years agoAdding missing break after default: (gcc-3.4).
Matthew Dillon [Mon, 21 Jun 2004 05:31:47 +0000 (05:31 +0000)]
Adding missing break after default: (gcc-3.4).

19 years agogcc-3.4 cleanup.
Matthew Dillon [Mon, 21 Jun 2004 05:28:53 +0000 (05:28 +0000)]
gcc-3.4 cleanup.

19 years agoHook gcc 3.4 into the buildworld. Rearrange HOST_CCVER so it becomes the
Matthew Dillon [Mon, 21 Jun 2004 03:48:07 +0000 (03:48 +0000)]
Hook gcc 3.4 into the buildworld.  Rearrange HOST_CCVER so it becomes the
responsibility of the Makefile element that is overriding CCVER.  Get rid
of the obsolete MY_CCVER magic.  Fix improper use of ${.TARGET} in
cc34/cc_tools/Makefile.tools.  Do not try to override _CPUCFLAGS in
bsd.hostprog.mk, which doesn't handle the generic .nx/.no case.  Instead
remove -mtune, -mcpu, and -march options in NXCFLAGS and NXCXXFLAGS.

Work-by: Joerg Sonnenberger <joerg@crater.dragonflybsd.org>
Reviewed-by: Matthew Dillon <dillon@backplane.com>
19 years agoFix a bug in 2.95.x prototypes that prevents us from building the world with
Matthew Dillon [Mon, 21 Jun 2004 03:39:10 +0000 (03:39 +0000)]
Fix a bug in 2.95.x prototypes that prevents us from building the world with
gcc-3.4.  Note that contrib/gcc is an 'old' contrib that came before our
new 'no-touch' policy for contrib sources so we can modify it directly.

19 years agoAdd a missing break after default: for gcc-3.4 support.
Matthew Dillon [Mon, 21 Jun 2004 03:38:52 +0000 (03:38 +0000)]
Add a missing break after default: for gcc-3.4 support.

19 years agoRemove the last vestiges of -DCCVER from 2.95.x contrib so we can remove
Matthew Dillon [Mon, 21 Jun 2004 03:31:00 +0000 (03:31 +0000)]
Remove the last vestiges of -DCCVER from 2.95.x contrib so we can remove
it from the build tree.

19 years agoFix a prototype error in gcc-3.3's com.h in order to allow gcc-3.4 to compile
Matthew Dillon [Mon, 21 Jun 2004 03:25:33 +0000 (03:25 +0000)]
Fix a prototype error in gcc-3.3's com.h in order to allow gcc-3.4 to compile
it.  This is a bad hack but we are going to remove 3.3 from the tree soon
anyway.

19 years ago'lrint' is a gcc3.4 builtin and gcc3.4 is unhappy if we use that for anything
Matthew Dillon [Mon, 21 Jun 2004 02:28:34 +0000 (02:28 +0000)]
'lrint' is a gcc3.4 builtin and gcc3.4 is unhappy if we use that for anything
else.

19 years agoMerge with FreeBSD (HEAD) src/usr.sbin/kbdmap/*:
Chris Pressey [Mon, 21 Jun 2004 01:37:42 +0000 (01:37 +0000)]
Merge with FreeBSD (HEAD) src/usr.sbin/kbdmap/*:

Move towards Perl removal from the base by replacing the Perl script
'kbdmap' with the version from FreeBSD 5, which is written in C.

Submitted-by: Tim Wickberg <me at k9mach3 dot org>
Additional-testing-by: William DeVries
19 years agoCheck kp (struct kinfo_proc *kp) against NULL and not 0, because it is a
Hiten Pandya [Mon, 21 Jun 2004 01:03:06 +0000 (01:03 +0000)]
Check kp (struct kinfo_proc *kp) against NULL and not 0, because it is a
pointer.

19 years agoUse the kern.boottime sysctl for retrieving the system boot time as a
Hiten Pandya [Mon, 21 Jun 2004 00:47:57 +0000 (00:47 +0000)]
Use the kern.boottime sysctl for retrieving the system boot time as a
struct timeval.  This is used to fix the STARTED column for pure kernel
threads.

Note, currently, we do not set the start time for pure threads due to
safety issues with microtime(9), although this change conditionalizes
the thread start time appropriately, so that in the future when pure
threads will account their start time, we wouldn't need to change anything
in this utility (with regard to the start time, ofcourse).

Discussed-with:  Matthew Dillon <dillon@apollo.backplane.com>

19 years agomake ==> ${MAKE} ${.TARGET}
Joerg Sonnenberger [Mon, 21 Jun 2004 00:20:33 +0000 (00:20 +0000)]
make ==> ${MAKE} ${.TARGET}

19 years agomake => ${MAKE}
Joerg Sonnenberger [Mon, 21 Jun 2004 00:03:41 +0000 (00:03 +0000)]
make => ${MAKE}

19 years agoMove the 'p_start' field from struct pstats (Process Statistics) into the
Hiten Pandya [Sun, 20 Jun 2004 22:29:10 +0000 (22:29 +0000)]
Move the 'p_start' field from struct pstats (Process Statistics) into the
thread structure and call it 'td_start'.  The behavior of vm_fork(9) is
retained, i.e., it still copies the start time from the parent process just
as it did before.

The 'td_start' will later be used by pure threads to indicate their start
time.  It has not been committed in this round because use of the microtime()
function at such a early point in the boot process might be unsafe.

Note, there should be no problem in accessing the td_start field, unless
the process is a Zombie; due to the way Zombies are reaped, the thread will
be decoupled in kern_wait1() but the process will still be around for a
while it will not be possible to access the td_start field in such
scenarios.  A little note about this has been added on top of struct proc
in <sys/proc.h> for future reference.

This work was a collaboration of Hiten Pandya <hmp@backplane.com> and
Matthew Dillon <dillon@apollo.backplane.com>

19 years agoAllow CCVER to be empty, which will cause the compiled-in default compiler
Matthew Dillon [Sun, 20 Jun 2004 22:19:51 +0000 (22:19 +0000)]
Allow CCVER to be empty, which will cause the compiled-in default compiler
to be used.

19 years agoAdd the STABS default output hack for GCC 3.4 too.
Joerg Sonnenberger [Sun, 20 Jun 2004 21:41:15 +0000 (21:41 +0000)]
Add the STABS default output hack for GCC 3.4 too.