dragonfly.git
3 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Tue, 15 Mar 2011 02:50:10 +0000 (03:50 +0100)]
bsd-family-tree: Sync with FreeBSD.

3 years agoSync zoneinfo database with tzdata2011d from elsie.nci.nih.gov
Sascha Wildner [Tue, 15 Mar 2011 02:29:17 +0000 (03:29 +0100)]
Sync zoneinfo database with tzdata2011d from elsie.nci.nih.gov

australasia:    8.22 -> 8.23
etcetera:       8.2  -> 8.3
europe:         8.27 -> 8.28
northamerica:   8.41 -> 8.42

* australasia: Samoa's DST will end on April 2, instead of April 3, as
    previously assumed. Thanks to Raymond Hughes for information on the
    change.

* etcetera: Remove obsolete material on angle brackets in the TZ
    environment variable.

* europe: Due to a nationwide exam on March 27, Turkey will change into
    summer time zone one day later.

* northamerica: Cuba will start DST on March 20, one week later than
    previously assumed. Thanks to Steffen Thorsen for the first report
    of the change.

3 years agoUPGRADING: Say that a full build is actually a must for gcc41 -> gcc44.
Sascha Wildner [Mon, 14 Mar 2011 17:01:49 +0000 (18:01 +0100)]
UPGRADING: Say that a full build is actually a must for gcc41 -> gcc44.

In order for the fix for silencing the inline warnings to be picked
up, a new cross-compiler must be built (which will later be used for
compiling the kernel where the fix is needed). This won't work with
quickworld since quickworld skips the cross-tools step.

Reported-by: tuxillo
3 years agoioapic: Add tunable hw.ioapic_use_old
Sepherosa Ziehau [Mon, 14 Mar 2011 13:57:14 +0000 (21:57 +0800)]
ioapic: Add tunable hw.ioapic_use_old

Mainly to ease following new I/O APIC related code testing.

3 years agoioapic: Remove unused TUNABLE_INT
Sepherosa Ziehau [Mon, 14 Mar 2011 13:23:12 +0000 (21:23 +0800)]
ioapic: Remove unused TUNABLE_INT

Since apic_io_enable will be needed very early during boot,
its value is fetched explicitly by calling TUNABLE_FETCH_INT()

3 years agombuf - Factor common code out of m_getjcl() and m_getcl().
Joe Talbott [Wed, 9 Mar 2011 15:01:47 +0000 (10:01 -0500)]
mbuf - Factor common code out of m_getjcl() and m_getcl().

3 years agombuf - Fix m_getjcl()'s size argument's type.
Joe Talbott [Tue, 8 Mar 2011 19:31:11 +0000 (14:31 -0500)]
mbuf - Fix m_getjcl()'s size argument's type.

Use size_t in both the declaration and definition of m_getjcl().

Reported-By: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
3 years agowpi(4) - Use MJUMPAGESIZE mbuf clusters.
Joe Talbott [Fri, 4 Mar 2011 12:31:05 +0000 (07:31 -0500)]
wpi(4) - Use MJUMPAGESIZE mbuf clusters.

Based-On: FreeBSD

3 years agombuf - Add MJUMPAGESIZE mbuf cluster support.
Joe Talbott [Fri, 4 Mar 2011 12:28:29 +0000 (07:28 -0500)]
mbuf - Add MJUMPAGESIZE mbuf cluster support.

This is needed by Intel WiFi chipsets which require larger than usual
clusters.

Revert MCLSHIFT back to 11 to reduce mbuf cluster space usage and make
non-Intel Wifi NICs work without needing to adjust MCLSHIFT.

3 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Mon, 14 Mar 2011 10:34:43 +0000 (06:34 -0400)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

3 years agogcc44: Prevent __stack_chk_fail_local references from being hidden.
Sascha Wildner [Mon, 14 Mar 2011 00:13:37 +0000 (01:13 +0100)]
gcc44: Prevent __stack_chk_fail_local references from being hidden.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2024>

3 years agoAdd missing wcsdup() prototype to <wchar.h>.
Sascha Wildner [Thu, 10 Mar 2011 21:56:22 +0000 (22:56 +0100)]
Add missing wcsdup() prototype to <wchar.h>.

This allows C++ programs to access this function at all.

Reported-by: Pierre Abbat <phma@phma.optus.nu>
3 years agokernel - missing PRELE() in ptrace(PT_DETACH).
YONETANI Tomokazu [Thu, 10 Mar 2011 10:31:04 +0000 (19:31 +0900)]
kernel - missing PRELE() in ptrace(PT_DETACH).

3 years agoamd(8): Fix a warning from the days when NULL was 0.
Sascha Wildner [Thu, 10 Mar 2011 03:21:26 +0000 (04:21 +0100)]
amd(8): Fix a warning from the days when NULL was 0.

3 years agoFix compilation with gcc44 and -fstack-protector.
Sascha Wildner [Thu, 10 Mar 2011 01:34:18 +0000 (02:34 +0100)]
Fix compilation with gcc44 and -fstack-protector.

Reported-by: various people
3 years agoioapic: Function renaming
Sepherosa Ziehau [Wed, 9 Mar 2011 14:22:25 +0000 (22:22 +0800)]
ioapic: Function renaming

3 years agolapic: Record the max LAPIC APIC ID
Sepherosa Ziehau [Wed, 9 Mar 2011 13:07:28 +0000 (21:07 +0800)]
lapic: Record the max LAPIC APIC ID

3 years agokernel - Add vm.cache_vmspaces boot-time tunable
Matthew Dillon [Wed, 9 Mar 2011 02:19:56 +0000 (18:19 -0800)]
kernel - Add vm.cache_vmspaces boot-time tunable

* Add vm.cache_vmspaces boot-time tunable, defaulting to 32 objects.
  This controls how many free vmspace+pmap structures can be maintained
  in the objcache.

* Change the sysref API a bit.  mag_capacity becomes nom_cache.

Related-to: IRC conversion thesjg & vsrinivas

3 years agokernel - Add lwkt.cache_threads boot-time tunable
Matthew Dillon [Wed, 9 Mar 2011 02:01:08 +0000 (18:01 -0800)]
kernel - Add lwkt.cache_threads boot-time tunable

* Add lwkt.cache_threads boot-time tunable.  This has to be set in
  /boot/loader.conf and controls how large a thread+kstack cache the
  kernel should maintain.

* Increase the default thread+kstack cache from 6 to 32 threads.

* Change the objcache_create*() API a little.  Instead of passing a
  mag_capacity field pass a nom_cache (nominal free objects to keep cached)
  field.

* Change the mag_capacity calculation to take into account small caches
  (the exec args cache) and remove the too-small-for-ncpus warning.

Related-to: IRC conversion thesjg & vsrinivas

3 years agokernel - Add kern.zone_cache sysctl
Matthew Dillon [Wed, 9 Mar 2011 01:14:32 +0000 (17:14 -0800)]
kernel - Add kern.zone_cache sysctl

* Add a sysctl to adjust how many empty zones each cpu caches for the
  slab allocator.  sysctl kern.zone_cache.

* Increase the default from 2 to 32 zones.

Related-to: IRC conversion thesjg & vsrinivas

3 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Tue, 8 Mar 2011 19:41:45 +0000 (14:41 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

3 years agokernel - Fix null pointer panic related to setproctitle()
Matthew Dillon [Tue, 8 Mar 2011 00:57:47 +0000 (16:57 -0800)]
kernel - Fix null pointer panic related to setproctitle()

* Fix a missing NULL check when setproctitle() is called for a
  program whos args were previously too large to fit in the
  per-process p_args cache.

Reported-by: John Marino <dragonflybsd@marino.st>
3 years agokernel - Fix ktrace -C and -d
Matthew Dillon [Mon, 7 Mar 2011 20:10:04 +0000 (12:10 -0800)]
kernel - Fix ktrace -C and -d

* Fix a system lockup when ktrace -C / -d is used (bug introduced with
  recent MP work).

3 years agoSync zoneinfo database with tzdata2011c from elsie.nci.nih.gov
Sascha Wildner [Mon, 7 Mar 2011 15:08:41 +0000 (16:08 +0100)]
Sync zoneinfo database with tzdata2011c from elsie.nci.nih.gov

leapseconds:    8.10 -> 8.11
northamerica:   8.40 -> 8.41
southamerica:   8.44 -> 8.45
zone.tab:       8.40 -> 8.41

* leapseconds: Update notice from IERS (no leap second at the end of
    June 2011).

* northamerica: Replace Juneau (Alaska) with Juneau, Sitka and
    Metlakatla.

* southamerica: Delay the end of the Chilean DST in 2011 until the
    first Sunday in April.

* zone.tab:  Replace Juneau (Alaska) with Juneau, Sitka and
    Metlakatla.

3 years agomdocml: Remove old files outside contrib/
Sascha Wildner [Mon, 7 Mar 2011 05:22:43 +0000 (06:22 +0100)]
mdocml: Remove old files outside contrib/

3 years agomdocml: Switch to using the files in contrib/mdocml
Sascha Wildner [Mon, 7 Mar 2011 05:21:41 +0000 (06:21 +0100)]
mdocml: Switch to using the files in contrib/mdocml

3 years agoMerge remote branch 'crater/vendor/MDOCML' into HEAD
Sascha Wildner [Mon, 7 Mar 2011 06:01:39 +0000 (07:01 +0100)]
Merge remote branch 'crater/vendor/MDOCML' into HEAD

3 years agomdocml: Add README.DRAGONFLY
Sascha Wildner [Mon, 7 Mar 2011 05:20:41 +0000 (06:20 +0100)]
mdocml: Add README.DRAGONFLY

3 years agoImport mdocml-1.10.9
Sascha Wildner [Mon, 7 Mar 2011 04:57:19 +0000 (05:57 +0100)]
Import mdocml-1.10.9

3 years agoinstall - Makefile.usr to use 2010Q4 on master
Matthew Dillon [Sun, 6 Mar 2011 18:36:43 +0000 (10:36 -0800)]
install - Makefile.usr to use 2010Q4 on master

* Use pkgsrc-2010Q4 on master for Makefile.usr

Submitted-by: Max Herrgard <herrgard@gmail.com>
3 years agokernel - Make sure thread is released before migrating
Matthew Dillon [Sun, 6 Mar 2011 18:24:49 +0000 (10:24 -0800)]
kernel - Make sure thread is released before migrating

* Make sure the current thread is in a released state before migrating it
  to another cpu.  Doing the release inside the lwkt_switch(), after we
  send the IPI, can result in a livelock.

Reported-by: Peter Avalos <peter@theshell.com>
3 years agoinstall - Add the src-create-shallow directive to Makefile.usr
Matthew Dillon [Sun, 6 Mar 2011 17:19:11 +0000 (09:19 -0800)]
install - Add the src-create-shallow directive to Makefile.usr

* Add the src-create-shallow directive to Makefile.usr

Submitted-by: John Marino <dragon@marino.st>
3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Venkatesh Srinivas [Sun, 6 Mar 2011 13:20:31 +0000 (05:20 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

3 years agokernel -- file desc malloc zone overflow handling.
Venkatesh Srinivas [Sun, 6 Mar 2011 13:18:24 +0000 (05:18 -0800)]
kernel -- file desc malloc zone overflow handling.

Allow null return from mallocs for file descriptor arrays. Fork and exec
will ENOMEM when we cannot allocate FD arrays.

This is only a partial solution to bug 2019.

3 years agoRevert "<float.h>: Use compiler builtins for some constants, if they are available."
Sascha Wildner [Sun, 6 Mar 2011 12:24:32 +0000 (13:24 +0100)]
Revert "<float.h>: Use compiler builtins for some constants, if they are available."

This reverts commit 7a0a994307056aae0718f7c17fa081f57d19f2c1.

It does more harm than it fixes and needs more investigation.

For now, lower WARNS in xlint/lint1 to 0.

Reported-by: vsrinivas
3 years agoFix a compilation error on x86_64.
Francois Tigeot [Sun, 6 Mar 2011 08:44:24 +0000 (09:44 +0100)]
Fix a compilation error on x86_64.

bus_dma_tag_create() expects a bus_addr_t parameter for its lowaddr argument.

3 years agokernel - Fix a few MP races against process status
Matthew Dillon [Sun, 6 Mar 2011 00:05:20 +0000 (16:05 -0800)]
kernel - Fix a few MP races against process status

* proc->p_token is required when traversing p->p_lwp_tree.

* Reorder lwp insertion on lwp_fork() so scan races see a whole lwp
  instead of a partially initialized one.

* Check for NULL p->p_pgrp and friends when only using proc_token to
  scan the process list to deal with new processes that are still in the
  middle of being fork()'d.

Reported-by: Peter Avalos <peter@theshell.com>,
     Antonio Huete Jimenez <tuxillo@crater.dragonflybsd.org>

3 years agops - Handle unexpected output order when sorting by memory or cpu
Matthew Dillon [Sat, 5 Mar 2011 22:44:22 +0000 (14:44 -0800)]
ps - Handle unexpected output order when sorting by memory or cpu

* When sorting by memory or cpu, including when using 'u' as in 'ps aux',
  if the primary sort critera is an exact match fall back to the default
  sort critera (tty and then pid).

Reported-by: swildner
3 years agokernel - Major bridging functionality added (bug fixes 2)
Matthew Dillon [Sat, 5 Mar 2011 22:27:13 +0000 (14:27 -0800)]
kernel - Major bridging functionality added (bug fixes 2)

* Recalculate the port configuration after enabling a member interface,
  fixing an issue where openvpn brings up a TAP interface after
  authenticating the link but whos weights then go unrecognized by the
  bridge.

  The port configuration was already being recalculated after a member
  interface becomes disabled.

* Reinitialize the bridge when the link0, link1, and/or link2 interface
  flag changes state, so the sysop doesn't have to bring the interface
  down and up manually to recognize the new settings.

3 years agokernel -- vm_map: Remove infork field from vm_map.
Venkatesh Srinivas [Sat, 5 Mar 2011 12:50:17 +0000 (04:50 -0800)]
kernel -- vm_map: Remove infork field from vm_map.

The infork field was never being read.

3 years agoifconfig.8: Fix a typo.
Sascha Wildner [Sat, 5 Mar 2011 01:47:07 +0000 (02:47 +0100)]
ifconfig.8: Fix a typo.

3 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Fri, 4 Mar 2011 23:09:22 +0000 (18:09 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

3 years agoie(4): Fix a gcc44 warning.
Sascha Wildner [Fri, 4 Mar 2011 21:52:14 +0000 (22:52 +0100)]
ie(4): Fix a gcc44 warning.

3 years agokernel -- vm_object locking Part 2: Lockup a few vm_object users.
Venkatesh Srinivas [Fri, 4 Mar 2011 14:40:39 +0000 (06:40 -0800)]
kernel -- vm_object locking Part 2: Lockup a few vm_object users.

3 years agoUPGRADING: Fix typo.
Sascha Wildner [Fri, 4 Mar 2011 13:16:52 +0000 (14:16 +0100)]
UPGRADING: Fix typo.

3 years agoAt long last, switch us to using GCC 4.4 as the default compiler.
Sascha Wildner [Fri, 4 Mar 2011 11:19:25 +0000 (12:19 +0100)]
At long last, switch us to using GCC 4.4 as the default compiler.

[I've put some notes into UPGRADING which I quote here.]

That means that any settings that set CCVER to 'gcc44' are not needed
anymore. Instead, CCVER can be set to 'gcc41' to go back to using
GCC 4.1.

The NO_GCC44 options has been removed and will not affect the build
anymore. There is now a NO_GCC41 option that will prevent GCC 4.1 from
building in a similar fashion.

Also, we recommend to do a full buildworld/buildkernel for upgrading.

Thanks-to: sephe, Max Herrgard and everybody else who helped with
           testing and fixing.

3 years agokernel -- vm_object locking Part 1: Primitives
Venkatesh Srinivas [Fri, 4 Mar 2011 07:07:47 +0000 (23:07 -0800)]
kernel -- vm_object locking Part 1: Primitives

   * Create per-vm_object 'hold count'; the hold count ensures that a
     vm_object is not deallocated or collapsed till it transitions 1->0.
     Hold count is waited for in vm_object_terminate and _collapse.

   * Convert vm_object_lock/_unlock to use pool tokens; pool tokens do not
     share storage with the vm_object, simplifying lifetime.

Cleanups:

   * Remove first attempts at vm_object locking; it just wasn't clear
     what each token was protecting earlier.

   * Eliminate vestigial fields from vm_object structure.

   * Clean vm_object_pip_wakeup (just call _wakeupn)

   * Remove vm_page_(un)lock for now

Discussed-with: dillon@

3 years agokernel -- POSIX Message Queues: Remove objcache for MQ messages.
Venkatesh Srinivas [Fri, 4 Mar 2011 06:55:11 +0000 (22:55 -0800)]
kernel -- POSIX Message Queues: Remove objcache for MQ messages.

The MQ code was using objcache for messages upto the default max size;
objcache was not really useful over kmalloc here, however. The messages did
not have any constructed object state to store and using kmalloc leads to using
appropriately sized message buffers each time.

3 years agokernel -- Prevent POSIX MQ from overflowing malloc zones.
Venkatesh Srinivas [Fri, 4 Mar 2011 03:27:21 +0000 (19:27 -0800)]
kernel -- Prevent POSIX MQ from overflowing malloc zones.

3 years agoUPDATING: Use '-' instead of '=' for underlining to avoid git confusion.
Sascha Wildner [Thu, 3 Mar 2011 22:15:59 +0000 (23:15 +0100)]
UPDATING: Use '-' instead of '=' for underlining to avoid git confusion.

3 years ago<float.h>: Use compiler builtins for some constants, if they are available.
Sascha Wildner [Thu, 3 Mar 2011 21:27:43 +0000 (22:27 +0100)]
<float.h>: Use compiler builtins for some constants, if they are available.

I've left the original values in as fallbacks, should any compiler have
no builtins. But they are no longer used for the GCCs with this commit.

3 years agogroff: Fix a gcc44 warning.
Sascha Wildner [Thu, 3 Mar 2011 21:27:03 +0000 (22:27 +0100)]
groff: Fix a gcc44 warning.

3 years agocsh(1): Remove redundant check (silences gcc44 warning).
Sascha Wildner [Thu, 3 Mar 2011 18:42:25 +0000 (19:42 +0100)]
csh(1): Remove redundant check (silences gcc44 warning).

3 years agoFix buildworld (netstat(1)).
Sascha Wildner [Thu, 3 Mar 2011 16:59:42 +0000 (17:59 +0100)]
Fix buildworld (netstat(1)).

Taken-from: FreeBSD

3 years agomptable: Assign index for each IOAPIC
Sepherosa Ziehau [Thu, 3 Mar 2011 14:14:40 +0000 (22:14 +0800)]
mptable: Assign index for each IOAPIC

IOAPIC information is saved into list ordered by ascending order
of IOAPIC's APIC ID and each IOAPIC is assigned an index according
to the order.

In this way we could use IOAPIC information extracted from ACPI
MADT and MPTABLE in the same fashion when routing PCI interrupts,
i.e. using index instead of APIC ID.  It has been observed that on
some machines, the APIC ID of IOAPIC in ACPI MADT is different from
the one in MPTABLE, but the order (index) is same.

PCI interrupt routing information now saves IOAPIC's index instead
of IOAPIC's APIC ID.

3 years agogrowfs(8): Silence a gcc44 warning.
Sascha Wildner [Thu, 3 Mar 2011 13:43:43 +0000 (14:43 +0100)]
growfs(8): Silence a gcc44 warning.

3 years agomptable: Simplify bus id duplication check logic
Sepherosa Ziehau [Thu, 3 Mar 2011 11:24:26 +0000 (19:24 +0800)]
mptable: Simplify bus id duplication check logic

3 years agoUpdate queue(3) for the REMOVE_NEXT -> REMOVE_AFTER rename.
Peter Avalos [Thu, 3 Mar 2011 10:49:52 +0000 (00:49 -1000)]
Update queue(3) for the REMOVE_NEXT -> REMOVE_AFTER rename.

While I'm here, sync with FreeBSD:
-Remove extra note about O(n) removal.

Obtained-from: FreeBSD

3 years agoFix forgotten _REMOVE_NEXT -> _REMOVE_AFTER rename.
Peter Avalos [Thu, 3 Mar 2011 10:31:36 +0000 (00:31 -1000)]
Fix forgotten _REMOVE_NEXT -> _REMOVE_AFTER rename.

3 years agoatmarpd(8) & scspd(8): Silence some gcc44 warnings.
Sascha Wildner [Thu, 3 Mar 2011 09:48:44 +0000 (10:48 +0100)]
atmarpd(8) & scspd(8): Silence some gcc44 warnings.

3 years agoppp(8): Silence some gcc44 warnings.
Sascha Wildner [Thu, 3 Mar 2011 09:40:41 +0000 (10:40 +0100)]
ppp(8): Silence some gcc44 warnings.

3 years agospppcontrol(8): Silence some gcc44 warnings.
Sascha Wildner [Thu, 3 Mar 2011 09:28:01 +0000 (10:28 +0100)]
spppcontrol(8): Silence some gcc44 warnings.

3 years agowindow(1): Fix a gcc44 warning.
Sascha Wildner [Thu, 3 Mar 2011 09:13:11 +0000 (10:13 +0100)]
window(1): Fix a gcc44 warning.

While here, remove an unused file which I missed when I upgraded it to
NetBSD's.

3 years ago<sys/queue.h>: Sync with FreeBSD
Peter Avalos [Thu, 3 Mar 2011 08:09:06 +0000 (22:09 -1000)]
<sys/queue.h>: Sync with FreeBSD

-Add _SWAP macros.
-Avoid corrupting the list or queue if _REMOVE is invoked with a
reference to the head and QUEUE_MACRO_DEBUG is defined.
-Rename _REMOVE_NEXT to _REMOVE_AFTER since the name matches the _INSERT
macros.

Obtained-from: FreeBSD

3 years agoRemove insque()/remque() from kernel code.
Peter Avalos [Thu, 3 Mar 2011 05:34:00 +0000 (19:34 -1000)]
Remove insque()/remque() from kernel code.

This transitions everything over to using the appropriate macros from
<sys/queue.h>.

3 years agoIPX/SPX: Remove unused code.
Peter Avalos [Thu, 3 Mar 2011 03:48:17 +0000 (17:48 -1000)]
IPX/SPX:  Remove unused code.

3 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Wed, 2 Mar 2011 23:20:24 +0000 (18:20 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

3 years agokernel: Fix the remaining gcc44 warnings for the kernel.
Sascha Wildner [Wed, 2 Mar 2011 22:34:42 +0000 (23:34 +0100)]
kernel: Fix the remaining gcc44 warnings for the kernel.

3 years agoaicasm: Add two YY_NO_INPUTs (silences gcc44 warnings).
Sascha Wildner [Wed, 2 Mar 2011 19:50:11 +0000 (20:50 +0100)]
aicasm: Add two YY_NO_INPUTs (silences gcc44 warnings).

3 years agogcc44: Don't emit warning about inline failure due to optimization
Sepherosa Ziehau [Wed, 2 Mar 2011 13:11:29 +0000 (21:11 +0800)]
gcc44: Don't emit warning about inline failure due to optimization

gcc44 tries to guess the hotness of the code path and refuses to inline
functions on cold code path even if the function has __inline attribute.
The warning caused by this kind of inline failure is extremely annoying
and it actually has nothing to do with possible software bugs.

3 years agokernel - Refactor dsched ref/unref routines
Matthew Dillon [Tue, 1 Mar 2011 23:52:19 +0000 (15:52 -0800)]
kernel - Refactor dsched ref/unref routines

* Refactor the dsched ref/unref routines to handle 1->0 transitions
  atomically and to properly deal with 1->0 races related to any
  re-referencing of the structure which can occur concurrently.

  Such races can occur because the structure must acquire other locks
  while removing itself from the various lists it is on and thus can
  be accessed via those lists in the mean time.

  Instead of using -0x400 as a separate atomic op after a 1->0 transition
  we directly transition from 1 to 0x80000000, removing a race condition.

  This also allows temporary references to be made during destruction.

* Get a temporary ref and re-check flag state after acquiring a lock to
  determine if the structure in question is still on the list we are trying
  to remove it from.

3 years agokernel - Use do/while sequences to protect multi-line dsched macros
Matthew Dillon [Tue, 1 Mar 2011 22:47:38 +0000 (14:47 -0800)]
kernel - Use do/while sequences to protect multi-line dsched macros

* Use do/while sequences to protect multi-line dsched macros in case
  they are used in statement sequences without braces, as in
  'if (fubar) dsched_macro;', or similar circumstances.

3 years agolibstand/printf.c: Oops, fix a braino.
Sascha Wildner [Tue, 1 Mar 2011 19:58:44 +0000 (20:58 +0100)]
libstand/printf.c: Oops, fix a braino.

3 years agolibstand: Sync libstand's printf() with FreeBSD.
Sascha Wildner [Tue, 1 Mar 2011 19:54:41 +0000 (20:54 +0100)]
libstand: Sync libstand's printf() with FreeBSD.

The main change is to add various missing conversions, such as %ll, %j, %q,
%z, %X, %h, %hh etc.

3 years agokern.mk: Prevent gcc4.4 from generating SSSE3, SSE4 and AVX instructions
Sepherosa Ziehau [Tue, 1 Mar 2011 15:39:08 +0000 (23:39 +0800)]
kern.mk: Prevent gcc4.4 from generating SSSE3, SSE4 and AVX instructions

3 years agokernel: Don't store FPU status into the reserved area of fxsave
Sepherosa Ziehau [Tue, 1 Mar 2011 14:44:16 +0000 (22:44 +0800)]
kernel: Don't store FPU status into the reserved area of fxsave

Since each time before the old sv_ex_sw is accessed, fnstsw() is
always called, it no longer makes any sense to save the temporary
in the reserved area for fxsave.  And more important: saving the
FPU status into fxsave area overwrites saved xmm register value.

3 years agops(1): Use alias syntax for the 'comm' alias.
Sascha Wildner [Tue, 1 Mar 2011 12:17:26 +0000 (13:17 +0100)]
ps(1): Use alias syntax for the 'comm' alias.

3 years agokernel - Major bridging functionality added (bug fixes)
Matthew Dillon [Mon, 28 Feb 2011 17:47:56 +0000 (09:47 -0800)]
kernel - Major bridging functionality added (bug fixes)

* The root bridge was not taking into account the peer's weightings when
  calculating path costs.

  In order to do this the root bridge must use available peer info.  The
  peer info should already include both the local and remote's path costs
  since 'we' are the root, so our path cost will already be directly
  incorporated in the path cost the peer reports to us.

* Fixes issue where not-weighted path costs on root bridge were not
  synchronized with the weighted path costs of one or more of its peers.

3 years agoUse g++ 4.4 from base for CCVER=gcc46.
Sascha Wildner [Mon, 28 Feb 2011 16:45:15 +0000 (17:45 +0100)]
Use g++ 4.4 from base for CCVER=gcc46.

3 years agoAdd 'pcc' as a CCVER value (using /usr/pkgsrc/lang/pcc-current).
Sascha Wildner [Mon, 28 Feb 2011 16:44:04 +0000 (17:44 +0100)]
Add 'pcc' as a CCVER value (using /usr/pkgsrc/lang/pcc-current).

It doesn't compile a full world or kernel yet but is quite fast and
a lot of our stuff builds with it (bin/, games/, secure/, most of
sbin/ and usr.bin/ and probably more).

If anyone wants to look at the remaining issues, be our guest.

3 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Mon, 28 Feb 2011 16:18:02 +0000 (11:18 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

3 years agokernel: Use the system's offsetof() macro instead of cooking our own.
Sascha Wildner [Sun, 27 Feb 2011 19:21:28 +0000 (20:21 +0100)]
kernel: Use the system's offsetof() macro instead of cooking our own.

While here, #undef ROUNDUP again after usage.

3 years agognu/lib/csu: Add -fno-asynchronous-unwind-tables to the CFLAGS.
Sascha Wildner [Sun, 27 Feb 2011 18:25:38 +0000 (19:25 +0100)]
gnu/lib/csu: Add -fno-asynchronous-unwind-tables to the CFLAGS.

Quoth FreeBSD's commit msg:

Often reported issue with newer ld is:
error in /usr/lib/crtendS.o(.eh_frame); no .eh_frame_hdr table will
be created.

The issue is that crtend is compiled with unwind table, and also it
places the special CIE into the .eh_frame indicating the end of
section, that is located before generated unwind table. New ld has
assertion that verifies that closing CIE is indeed the last CIE,
causing the crypting message to be issued, and refusing to generate
dwarf unwind.

Add -fno-asynchronous-unwind-tables to disable unwind table generation
for crtbegin/crtend.

Taken-from: FreeBSD

3 years agokernel: Remove some variables that are set but not used.
Sascha Wildner [Sun, 27 Feb 2011 15:22:35 +0000 (16:22 +0100)]
kernel: Remove some variables that are set but not used.

3 years agolib/csu: Fix typo
Sepherosa Ziehau [Sun, 27 Feb 2011 14:31:57 +0000 (22:31 +0800)]
lib/csu: Fix typo

3 years agolib/csu: Remove a redundant -Wall in the Makefile.
Sascha Wildner [Sun, 27 Feb 2011 11:56:52 +0000 (12:56 +0100)]
lib/csu: Remove a redundant -Wall in the Makefile.

3 years agokernel: Comment out some unused functions.
Sascha Wildner [Sun, 27 Feb 2011 01:09:54 +0000 (02:09 +0100)]
kernel: Comment out some unused functions.

3 years agomly(4): Put mly_timeout() under MLY_DEBUG where it belongs.
Sascha Wildner [Sun, 27 Feb 2011 01:06:32 +0000 (02:06 +0100)]
mly(4): Put mly_timeout() under MLY_DEBUG where it belongs.

3 years agokernel - Fix incorrect inode wait code in HAMMER
Matthew Dillon [Sat, 26 Feb 2011 17:32:40 +0000 (09:32 -0800)]
kernel - Fix incorrect inode wait code in HAMMER

* Fix incorrect code t wait for an inode flush to finish.  This should also
  fix the reported assertion.

  Any bugs in this new code would likely result in process stalls instead
  of panics, so watch for that possibility.

Reported-by: Venkatesh Srinivas <vsrinivas@dragonflybsd.org>,
     Peter Avalos <peter@theshell.com>

3 years agolibrt: Fix buildworld by putting some unused variables in #if 0.
Sascha Wildner [Sat, 26 Feb 2011 09:29:13 +0000 (10:29 +0100)]
librt: Fix buildworld by putting some unused variables in #if 0.

While here, use #if 0 for #ifdef notyet in the committed part, too.

3 years agoifconfig(8): Change constructor priorities from 100 to 101.
Sascha Wildner [Sat, 26 Feb 2011 08:30:01 +0000 (09:30 +0100)]
ifconfig(8): Change constructor priorities from 100 to 101.

This silences some gcc44 warnings.

Constructor priorities are bounded between 101 and 65535 inclusive.
0 to 100 are reserved for the implementation.

See also:

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html

3 years agoAdd YY_NO_INPUT to a number of lex(1) input files (silences gcc44 warnings).
Sascha Wildner [Sat, 26 Feb 2011 08:14:54 +0000 (09:14 +0100)]
Add YY_NO_INPUT to a number of lex(1) input files (silences gcc44 warnings).

3 years agolibrt -- AIO: Implement SIGEV_THREAD for AIO completion notification.
Venkatesh Srinivas [Sat, 26 Feb 2011 03:40:31 +0000 (19:40 -0800)]
librt -- AIO: Implement SIGEV_THREAD for AIO completion notification.

SIGEV_THREAD launches a libthread thread in response to I/O completion.
We link librt against libthread to allow access to the pthread_*
routines.

3 years agolibevtr: Add YY_NO_INPUT to ktrfmt.l and regenerate (silences gcc44 warning).
Sascha Wildner [Fri, 25 Feb 2011 19:51:36 +0000 (20:51 +0100)]
libevtr: Add YY_NO_INPUT to ktrfmt.l and regenerate (silences gcc44 warning).

3 years agoAdd 'gcc46' as a CCVER value (using /usr/pkgsrc/lang/gnat-aux).
Sascha Wildner [Fri, 25 Feb 2011 17:20:18 +0000 (18:20 +0100)]
Add 'gcc46' as a CCVER value (using /usr/pkgsrc/lang/gnat-aux).

So far I've tested building and running our kernel (which both works).

World hasn't been tested and would fail using default values, since
gnat-aux so far only supports C and Ada.

Many thanks to John Marino <john@marino.st> who did and maintains the
lang/gnat-aux package.

3 years agogcc44: Make i486 the default arch
Sepherosa Ziehau [Fri, 25 Feb 2011 03:36:57 +0000 (11:36 +0800)]
gcc44: Make i486 the default arch

3 years agomk: Rearrange bsd.cpu.gcc44.mk
Sepherosa Ziehau [Thu, 24 Feb 2011 09:15:19 +0000 (17:15 +0800)]
mk: Rearrange bsd.cpu.gcc44.mk

- Don't always set -march=xxx
- Support CPUTYPE=native
- Support several new -march argument, e.g. barcelona
- Split CPUTYPE adjustment into compat CPUTYPE adjustment and
  CPUTYPE alias adjustment

3 years agomk: Add FORCE_CPUTYPE which overrides user's CPUTYPE or forcefully sets CPUTYPE
Sepherosa Ziehau [Thu, 24 Feb 2011 06:13:24 +0000 (14:13 +0800)]
mk: Add FORCE_CPUTYPE which overrides user's CPUTYPE or forcefully sets CPUTYPE

3 years agoRemove an old header via 'make upgrade'.
Sascha Wildner [Fri, 25 Feb 2011 11:37:04 +0000 (12:37 +0100)]
Remove an old header via 'make upgrade'.

3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 24 Feb 2011 22:16:52 +0000 (14:16 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly