]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoAdd header required by cfi_bus_fdt.c.
Marius Strobl [Fri, 30 Dec 2011 21:22:10 +0000 (21:22 +0000)]
Add header required by cfi_bus_fdt.c.

12 years agoAdd some additional const poison after r228972. The 'mapping' array in
Dimitry Andric [Fri, 30 Dec 2011 20:41:24 +0000 (20:41 +0000)]
Add some additional const poison after r228972.  The 'mapping' array in
lib/libc/gen/strtofflags.c became const, but gcc did not warn about
assigning its members to non-const pointers.  Clang warned about this
with:

lib/libc/gen/strtofflags.c:98:12: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types]
                        for (sp = mapping[i].invert ? mapping[i].name :
                                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by: jilles

12 years agoMerge r216333 and r216555 from the native pmap
Alan Cox [Fri, 30 Dec 2011 18:16:15 +0000 (18:16 +0000)]
Merge r216333 and r216555 from the native pmap
  When r207410 eliminated the acquisition and release of the page queues
  lock from pmap_extract_and_hold(), it didn't take into account that
  pmap_pte_quick() sometimes requires the page queues lock to be held.
  This change reimplements pmap_extract_and_hold() such that it no
  longer uses pmap_pte_quick(), and thus never requires the page queues
  lock.

Merge r177525 from the native pmap
  Prevent the overflow in the calculation of the next page directory.
  The overflow causes the wraparound with consequent corruption of the
  (almost) whole address space mapping.

Strictly speaking, r177525 is not required by the Xen pmap because the
hypervisor steals the uppermost region of the normal kernel address
space.  I am nonetheless merging it in order to reduce the number of
unnecessary differences between the native and Xen pmap implementations.

Tested by: sbruno

12 years agoIn sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function
Dimitry Andric [Fri, 30 Dec 2011 17:18:09 +0000 (17:18 +0000)]
In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function
definition from K&R to ANSI, to avoid a clang warning about the uint8_t
parameter being promoted to int, which is not compatible with the type
declared in the earlier prototype.

MFC after: 1 week

12 years agostyle(9), whitespace and spelling nits.
Gleb Smirnoff [Fri, 30 Dec 2011 15:41:28 +0000 (15:41 +0000)]
style(9), whitespace and spelling nits.

12 years agoSet svn:executable on dhclient-script
Jean-Sébastien Pédron [Fri, 30 Dec 2011 14:46:53 +0000 (14:46 +0000)]
Set svn:executable on dhclient-script

Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoAdapt testsuite following change in Domain Search error handling
Jean-Sébastien Pédron [Fri, 30 Dec 2011 14:41:47 +0000 (14:41 +0000)]
Adapt testsuite following change in Domain Search error handling

In this testsuite, warning() and error() have the same behaviour.

PR: bin/163431
Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoInvalid Domain Search option isn't considered as a fatal error
Jean-Sébastien Pédron [Fri, 30 Dec 2011 14:33:08 +0000 (14:33 +0000)]
Invalid Domain Search option isn't considered as a fatal error

In the original Domain Search option patch, an invalid option value
would cause the whole lease to be rejected. However, DHCP servers who
emit such an invalid value are more common than I thought. With this new
patch, just the option is rejected, not the entire lease.

PR: bin/163431
Submitted by: Fabian Keil <fk@fabiankeil.de> (earlier version)
Reviewed by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoDisable several instances instances of clang's -Wself-assign warning.
Dimitry Andric [Fri, 30 Dec 2011 13:16:59 +0000 (13:16 +0000)]
Disable several instances instances of clang's -Wself-assign warning.
All of these are harmless, and are in fact used to shut up warnings from
lint.

While here, remove -Wno-missing-prototypes from the xfs module
Makefile, as I could not reproduce those warnings either with gcc or
clang.

MFC after: 1 week

12 years agoSpelling fixes for share/
Ulrich Spörlein [Fri, 30 Dec 2011 11:11:54 +0000 (11:11 +0000)]
Spelling fixes for share/

12 years agoSpelling fixes for usr.bin/
Ulrich Spörlein [Fri, 30 Dec 2011 11:02:40 +0000 (11:02 +0000)]
Spelling fixes for usr.bin/

12 years agoReencode files from latin1 to UTF-8.
Ulrich Spörlein [Fri, 30 Dec 2011 10:59:15 +0000 (10:59 +0000)]
Reencode files from latin1 to UTF-8.

This makes a tiny percentage of entries in calendars ugly for latin1
users, but fixes them for UTF-8 users.

This badly needs a solution involving locale-dependent re-encoding.

12 years agoSpelling fixes for usr.sbin/
Ulrich Spörlein [Fri, 30 Dec 2011 10:58:14 +0000 (10:58 +0000)]
Spelling fixes for usr.sbin/

12 years agoFix typo in Makefile comment.
Robert Watson [Fri, 30 Dec 2011 10:45:00 +0000 (10:45 +0000)]
Fix typo in Makefile comment.

MFC after: 3 days

12 years agoAdd a configuration file for the Atheros PB47 reference board.
Adrian Chadd [Fri, 30 Dec 2011 09:48:35 +0000 (09:48 +0000)]
Add a configuration file for the Atheros PB47 reference board.
This is an AR71xx based board with 8MB flash, 64MB RAM, a
Mini-PCI+ slot (see below) and a single 10/100/1000baseT
ethernet port.  It also has two USB ports.

This is an easier board than most to add as it doesn't have a
switch PHY on-board.  This made it (mostly) trivial to craft a
working configuration.

Things to note:

* This, like most other reference boards, use uboot rather then
  redboot.  It means that you typically have to manually flash
  both the kernel and rootfs partitions.

* Since there's currently no (nice) way to extract out the
  ethernet MAC and RAM from the uboot environment, the RAM
  will default to 32mb and the MAC will be something very
  incorrect.   I'll try to fix this up in a subsequent commit
  or two, even if it's just some hard-coded nonsense in
  ar71xx_machdep.c for now.

* The board is designed for a specific model of mini-PCI+
  NIC which never made it into production.  Normal mini-PCI
  NICs will work fine; if you happen to have the NIC in question
  then it will work fine with this board.

12 years agoAdd a couple of missing wlan modules.
Adrian Chadd [Fri, 30 Dec 2011 09:39:24 +0000 (09:39 +0000)]
Add a couple of missing wlan modules.

12 years ago- Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one
Lawrence Stewart [Fri, 30 Dec 2011 08:57:58 +0000 (08:57 +0000)]
- Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one
  aspect of time stamp configuration per interface rather than per BPF
  descriptor. Prior to this, the order in which BPF devices were opened and the
  per descriptor time stamp configuration settings could cause non-deterministic
  and unintended behaviour with respect to time stamping. With the new scheme, a
  BPF attached interface's tscfg sysctl entry can be set to "default", "none",
  "fast", "normal" or "external". Setting "default" means use the system default
  option (set with the net.bpf.tscfg.default sysctl), "none" means do not
  generate time stamps for tapped packets, "fast" means generate time stamps for
  tapped packets using a hz granularity system clock read, "normal" means
  generate time stamps for tapped packets using a full timecounter granularity
  system clock read and "external" (currently unimplemented) means use the time
  stamp provided with the packet from an underlying source.

- Utilise the recently introduced sysclock_getsnapshot() and
  sysclock_snap2bintime() KPIs to ensure the system clock is only read once per
  packet, regardless of the number of BPF descriptors and time stamp formats
  requested. Use the per BPF attached interface time stamp configuration to
  control if sysclock_getsnapshot() is called and whether the system clock read
  is fast or normal. The per BPF descriptor time stamp configuration is then
  used to control how the system clock snapshot is converted to a bintime by
  sysclock_snap2bintime().

- Remove all FAST related BPF descriptor flag variants. Performing a "fast"
  read of the system clock is now controlled per BPF attached interface using
  the net.bpf.tscfg sysctl tree.

- Update the bpf.4 man page.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

In collaboration with: Julien Ridoux (jridoux at unimelb edu au)

12 years agoUnset the environment variables associated with individual menu items
Sergey Kandaurov [Fri, 30 Dec 2011 06:24:59 +0000 (06:24 +0000)]
Unset the environment variables associated with individual menu items
before invoking the kernel.

Quoting submitter:

The issue is with the new boot loader menu. It adds many loader variables
including ones that contain ANSI color escapes.

Obviously, these ANSI codes don't play well with serial consoles when
kenv(1) is executed without arguments (reports vary as to what happens,
but it's never pretty).

The net-effect is that kenv(1) no longer reports menu-related variables.

In essence, kenv(1) output should now appear the same as on RELENG_8
(which lacks the new boot loader and didn't use any such variables).
Thus, restoring serial console glory.

Submitted by: Devin Teske <devin dott teske fisglobal.com>
MFC after: 2 weeks

12 years agoDEBUG is a kernel option. Don't define it here, as it breaks LINT.
Marcel Moolenaar [Fri, 30 Dec 2011 04:00:31 +0000 (04:00 +0000)]
DEBUG is a kernel option. Don't define it here, as it breaks LINT.
Since DEBUG was subsequently undefined, this is just debugging left-
over.

12 years agoActually set the baudrate from the FDT.
Marcel Moolenaar [Fri, 30 Dec 2011 03:57:17 +0000 (03:57 +0000)]
Actually set the baudrate from the FDT.

12 years agoRemove trailing white-space.
Marcel Moolenaar [Fri, 30 Dec 2011 03:54:22 +0000 (03:54 +0000)]
Remove trailing white-space.

12 years agoAdd a module for cfi(4). Build only for arm and powerpc, as there are
Marcel Moolenaar [Fri, 30 Dec 2011 03:48:39 +0000 (03:48 +0000)]
Add a module for cfi(4). Build only for arm and powerpc, as there are
only bus attachments only for these.

12 years agoReapply r228785 now it has been tested by Adrian. Also add comments
Dimitry Andric [Fri, 30 Dec 2011 02:58:37 +0000 (02:58 +0000)]
Reapply r228785 now it has been tested by Adrian.  Also add comments
with the old AR_SCR_SLE_XXX values, with a short explanation why they
were changed.

Reviewed by: adrian
MFC after: 1 week

12 years agoIn sys/dev/drm/radeon_state.c, use the correct printf length modifiers
Dimitry Andric [Fri, 30 Dec 2011 02:07:50 +0000 (02:07 +0000)]
In sys/dev/drm/radeon_state.c, use the correct printf length modifiers
for ints.

MFC after: 1 week

12 years agoFor several files in sys/dev/drm, disable -Wunused-value when building
Dimitry Andric [Fri, 30 Dec 2011 01:54:45 +0000 (01:54 +0000)]
For several files in sys/dev/drm, disable -Wunused-value when building
with clang.  There are several macros in these files that return values,
and in some cases nothing is done with them, but it is completely
harmless.  For some other files, also disable -Wconstant-conversion,
since that triggers a false positive with the DMA_BIT_MASK() macro.

MFC after: 1 week

12 years agoExtend <stdatomic.h> to support GCC 4.7's __atomic.
Ed Schouten [Fri, 30 Dec 2011 01:37:25 +0000 (01:37 +0000)]
Extend <stdatomic.h> to support GCC 4.7's __atomic.

The development version of GCC also supports an atomics interface
similar to Clang's. Change the header file to work as follows:

- __CLANG_ATOMICS: Use Clang's new atomics interface,
- __GNUC_ATOMICS: Use GCC's new atomics interface,
- else: fall back to GCC's __sync interface.

12 years agoReencode files to UTF-8. Drop CP1252 em-dash.
Ulrich Spörlein [Fri, 30 Dec 2011 00:59:08 +0000 (00:59 +0000)]
Reencode files to UTF-8. Drop CP1252 em-dash.

12 years agoSpelling fixes for tools/
Ulrich Spörlein [Fri, 30 Dec 2011 00:04:11 +0000 (00:04 +0000)]
Spelling fixes for tools/

Add some $FreeBSD$ tags so svn will allow the commit.

12 years agoSet fbsd:nokeywords for contributed sources.
Ulrich Spörlein [Fri, 30 Dec 2011 00:02:56 +0000 (00:02 +0000)]
Set fbsd:nokeywords for contributed sources.

12 years agoAdd "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernel
Robert Watson [Thu, 29 Dec 2011 22:48:36 +0000 (22:48 +0000)]
Add "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernel
configurations for various architectures in FreeBSD 10.x.  This allows
basic Capsicum functionality to be used in the default FreeBSD
configuration on non-embedded architectures; process descriptors are not
yet enabled by default.

MFC after: 3 months
Sponsored by: Google, Inc

12 years agolibc: Eliminate some relative relocations in file flags table.
Jilles Tjoelker [Thu, 29 Dec 2011 22:15:18 +0000 (22:15 +0000)]
libc: Eliminate some relative relocations in file flags table.

12 years agoFor sys/dev/ce/tau32-ddk.c, disable the following warning when building
Dimitry Andric [Thu, 29 Dec 2011 21:17:35 +0000 (21:17 +0000)]
For sys/dev/ce/tau32-ddk.c, disable the following warning when building
with clang:

sys/dev/ce/tau32-ddk.c:1228:37: warning: implicit truncation from 'int' to bitfield changes value from 65532 to 8188 [-Wconstant-conversion]

Since this file is obfuscated C, we can never determine (in a sane way,
at least :) if this points to a real problem or not.  The driver has
been in the tree for more than five years, so it most likely isn't.

MFC after: 1 week

12 years agoFix manual section for acl_get(3) and mac_get(3) family functions.
Sergey Kandaurov [Thu, 29 Dec 2011 21:12:22 +0000 (21:12 +0000)]
Fix manual section for acl_get(3) and mac_get(3) family functions.

Reviewed by: rwatson
MFC after: 1 week

12 years agoDefer the work of freeing IPv4 multicast options from a socket to an
John Baldwin [Thu, 29 Dec 2011 20:41:16 +0000 (20:41 +0000)]
Defer the work of freeing IPv4 multicast options from a socket to an
asychronous task.  This avoids tearing down multicast state including
sending IGMP leave messages and reprogramming MAC filters while holding
the per-protocol global pcbinfo lock that is used in the receive path of
packet processing.

Reviewed by: rwatson
MFC after: 1 month

12 years agoUpdate if_obytes and if_omcast after successful transmit.
Pyun YongHyeon [Thu, 29 Dec 2011 18:40:58 +0000 (18:40 +0000)]
Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not
up and running.  Previously it updated collision counter and it was
confusing to interprete it.

PR: kern/163478
Reviewed by: glebius, jhb
Tested by: Joe Holden < lists <> rewt dot org dot uk >

12 years agoUse queue(3) macros instead of home-rolled versions in several places in
John Baldwin [Thu, 29 Dec 2011 18:25:18 +0000 (18:25 +0000)]
Use queue(3) macros instead of home-rolled versions in several places in
the INET6 code.  This includes retiring the 'ndpr_next' and 'pfr_next'
macros.

Submitted by: pluknet (earlier version)
Reviewed by: pluknet

12 years agoFix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
Dimitry Andric [Thu, 29 Dec 2011 17:46:24 +0000 (17:46 +0000)]
Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
using jkim's last patch (reviewed by bde) from here:

http://docs.freebsd.org/cgi/mid.cgi?201010141558.03154.jkim

MFC after: 1 week

12 years agoUse curthread rather than PCPU_GET(curthread). 'curthread' uses
John Baldwin [Thu, 29 Dec 2011 16:40:54 +0000 (16:40 +0000)]
Use curthread rather than PCPU_GET(curthread).  'curthread' uses
special-case optimizations on several platforms and is preferred.

Reported by: dim (indirectly)
MFC after: 2 weeks

12 years agoFurther relax the strictness of enforcing allocations to only come from
John Baldwin [Thu, 29 Dec 2011 16:23:14 +0000 (16:23 +0000)]
Further relax the strictness of enforcing allocations to only come from
decoded ranges.  Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated.  This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS.  This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc.  At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.

MFC after: 2 weeks

12 years agoCap the priority calculated from the current thread's running tick count
John Baldwin [Thu, 29 Dec 2011 16:17:16 +0000 (16:17 +0000)]
Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
happen due to irregularities with clock interrupts under certain
virtualization environments.

Tested by: Larry Rosenman  ler lerctr org
MFC after: 2 weeks

12 years agoDon't fallback to a CARP address in BACKUP state.
Gleb Smirnoff [Thu, 29 Dec 2011 15:59:14 +0000 (15:59 +0000)]
Don't fallback to a CARP address in BACKUP state.

12 years agoRegen.
John Baldwin [Thu, 29 Dec 2011 15:35:47 +0000 (15:35 +0000)]
Regen.

12 years agoImplement linux_fadvise64() and linux_fadvise64_64() using
John Baldwin [Thu, 29 Dec 2011 15:34:59 +0000 (15:34 +0000)]
Implement linux_fadvise64() and linux_fadvise64_64() using
kern_posix_fadvise().

Reviewed by: silence on emulation@
MFC after: 2 weeks

12 years agoFix typo in comment.
Robert Watson [Thu, 29 Dec 2011 15:34:59 +0000 (15:34 +0000)]
Fix typo in comment.

MFC after: 3 days

12 years agoDon't define static_assert for C++.
Ed Schouten [Thu, 29 Dec 2011 14:41:17 +0000 (14:41 +0000)]
Don't define static_assert for C++.

Even though _Static_assert() is pretty robust for C code, it cannot work
correctly with C++ code.  This is due to the fact that C++ template
parameters may contain commas that are not enclosed in parentheses. For
example:

static_assert(foo<int, int>::bar == baz, "...");

This causes _Static_assert to be called with an excessive number of
parameters.  If you want to use static_assert in C++, just use a C++11
compiler.

Reported on: current@, ports@

12 years agoReencode files from latin1 to UTF-8.
Ulrich Spörlein [Thu, 29 Dec 2011 12:33:27 +0000 (12:33 +0000)]
Reencode files from latin1 to UTF-8.

12 years agoUpdate LOCKLEAF comment: it should say "vnode".
Sergey Kandaurov [Thu, 29 Dec 2011 12:28:05 +0000 (12:28 +0000)]
Update LOCKLEAF comment: it should say "vnode".
Inspired by PR docs/11596.

12 years agoAdd PCI Id for the Intel AMT serial interface as found on my DQ67OW.
Konstantin Belousov [Thu, 29 Dec 2011 08:27:37 +0000 (08:27 +0000)]
Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.

MFC after: 1 week

12 years agoI'm not yet an alumni, add myself in the right section
Baptiste Daroussin [Thu, 29 Dec 2011 08:13:11 +0000 (08:13 +0000)]
I'm not yet an alumni, add myself in the right section

Approved by: des (mentor)

12 years agoFlesh out the RSPRO GPIO config, including the RF LED.
Adrian Chadd [Thu, 29 Dec 2011 06:07:24 +0000 (06:07 +0000)]
Flesh out the RSPRO GPIO config, including the RF LED.

12 years agoBreak out the AR71XX config file into _BASE and board specific
Adrian Chadd [Thu, 29 Dec 2011 05:51:48 +0000 (05:51 +0000)]
Break out the AR71XX config file into _BASE and board specific
bits.

The ROUERSTATION and RSPRO variants contain:

* the board specific bits (eg the RTC for RSPRO, later on it'll
  include the GPIO/LED definitions);
* the boot specific bits (eg, on-board flash, usb flash, etc).

For now the AR71XX_BASE file contains the common board config,
drivers and net80211/ath wireless drivers.

I'll follow this up with config files for the other boards I
have (eg the Ubiquiti LSSR71, as well as some Mikrotik boards
that use the AR71XX and atheros reference boards) which will
be quite easy to do now.

12 years agosh: Allow quoting ^ and ] in bracket expressions.
Jilles Tjoelker [Wed, 28 Dec 2011 23:51:17 +0000 (23:51 +0000)]
sh: Allow quoting ^ and ] in bracket expressions.

12 years agosh: Use dirent.d_type in pathname generation.
Jilles Tjoelker [Wed, 28 Dec 2011 23:40:46 +0000 (23:40 +0000)]
sh: Use dirent.d_type in pathname generation.

This improves performance for globs where a slash or another component
follows a component with metacharacters by eliminating unnecessary attempts
to open directories that are not.

12 years agosh: Cache de->d_namlen in a local variable.
Jilles Tjoelker [Wed, 28 Dec 2011 23:30:17 +0000 (23:30 +0000)]
sh: Cache de->d_namlen in a local variable.

12 years agoImport the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card
Xin LI [Wed, 28 Dec 2011 23:26:58 +0000 (23:26 +0000)]
Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card
driver.  This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms.

Many thanks to HighPoint for providing this driver.

MFC after: 2 weeks

12 years agoSet maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see
Alexander Motin [Wed, 28 Dec 2011 22:49:28 +0000 (22:49 +0000)]
Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see
no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is any
way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and
overflows are also handled. On my tests even 1MB I/Os are working fine.

Reviewed by: ken@

12 years ago1. Correct capitalization of the nobility particle for
Doug Barton [Wed, 28 Dec 2011 22:18:53 +0000 (22:18 +0000)]
1. Correct capitalization of the nobility particle for
   Francois de La Rochefoucauld introduced in r228909 [1],[2]

2. Change c-cedilla introduced in the same commit to ASCII c since
   non-UTF-8 terminals will choke on the non-ASCII text. [2],[3]

Pointed out by: bf [1]
Reviewed by: French-speakers on #bsdcode [2]
Requested by: uqs [3]

12 years agosh: Do not force special builtins non-special in optimized command subst.
Jilles Tjoelker [Wed, 28 Dec 2011 22:10:12 +0000 (22:10 +0000)]
sh: Do not force special builtins non-special in optimized command subst.

This is not necessary: errors are already caught in evalbackcmd() and
forcelocal handles changes to variables.

Note that this depends on r223024.

MFC after: 4 weeks

12 years agoOptimize vm_object_split()'s handling of reservations.
Alan Cox [Wed, 28 Dec 2011 20:27:18 +0000 (20:27 +0000)]
Optimize vm_object_split()'s handling of reservations.

12 years agoFix a bug in the Xen pmap's implementation of pmap_extract_and_hold():
Alan Cox [Wed, 28 Dec 2011 19:59:54 +0000 (19:59 +0000)]
Fix a bug in the Xen pmap's implementation of pmap_extract_and_hold():
If the page lock acquisition is retried, then the underlying thread is
not unpinned.

Wrap nearby lines that exceed 80 columns.

12 years agoPrefer ASCII apostrophes over Unicode ones like the rest of the file.
Ulrich Spörlein [Wed, 28 Dec 2011 19:37:03 +0000 (19:37 +0000)]
Prefer ASCII apostrophes over Unicode ones like the rest of the file.

12 years agoAdd myself as a src committer
Baptiste Daroussin [Wed, 28 Dec 2011 17:45:26 +0000 (17:45 +0000)]
Add myself as a src committer

Approved by: des (mentor)

12 years agoOops, if we want to check from 0 to nsock, the test condition should be
Olivier Houchard [Wed, 28 Dec 2011 13:01:12 +0000 (13:01 +0000)]
Oops, if we want to check from 0 to nsock, the test condition should be
< nsock, not >.

Pointy hat to: cognet
Submitted by: Olivier Cochard-Labbe <olivier AT cochard doT me>

12 years agoFix incorrect uses of sizeof().
Kevin Lo [Wed, 28 Dec 2011 05:58:31 +0000 (05:58 +0000)]
Fix incorrect uses of sizeof().

The details of the fix can be found in the tcpdump git repository:
commit 684955d58611ee94eccdc34e82b32e676337188c

12 years ago- Add generic GPIO driver for Cavium Octeon. At the moment pin definition is
Oleksandr Tymoshenko [Wed, 28 Dec 2011 05:57:03 +0000 (05:57 +0000)]
- Add generic GPIO driver for Cavium Octeon. At the moment pin definition is
    hardcoded but will be changed later with more flexible way to define them.

12 years agoIn POSIX.1-2008:
Xin LI [Wed, 28 Dec 2011 05:35:33 +0000 (05:35 +0000)]
In POSIX.1-2008:

P_tmpdir [OB XSI]  Default directory prefix for tempnam().

This macro is used in a lot of places in legacy applications,
and is why we see a lot of programs written for e.g. Linux
store volatile temporary files in /var/tmp and not /tmp.

MFC after: 2 months

12 years agoEliminate many of the unnecessary differences between the native and
Alan Cox [Tue, 27 Dec 2011 23:53:00 +0000 (23:53 +0000)]
Eliminate many of the unnecessary differences between the native and
paravirtualized pmap implementations for i386.  This includes some
style fixes to the native pmap and several bug fixes that were not
previously applied to the paravirtualized pmap.

Tested by: sbruno
MFC after: 3 weeks

12 years agolibc: Eliminate some relative relocations in getusershell().
Jilles Tjoelker [Tue, 27 Dec 2011 23:35:10 +0000 (23:35 +0000)]
libc: Eliminate some relative relocations in getusershell().

12 years agolibc: Eliminate some relative relocations in setlocale().
Jilles Tjoelker [Tue, 27 Dec 2011 23:28:01 +0000 (23:28 +0000)]
libc: Eliminate some relative relocations in setlocale().

12 years agoDocument restriction on 32-bits and 64-bits datatypes.
Ed Schouten [Tue, 27 Dec 2011 22:14:35 +0000 (22:14 +0000)]
Document restriction on 32-bits and 64-bits datatypes.

12 years agoAdd locally implemented atomic intrinsics to libcompiler_rt.
Ed Schouten [Tue, 27 Dec 2011 22:13:51 +0000 (22:13 +0000)]
Add locally implemented atomic intrinsics to libcompiler_rt.

The built-in atomic operations are not implemented in our version of GCC
4.2 for the ARM and MIPS architectures. Instead of emitting locked
instructions, they generate calls to functions that can be implemented
in the C runtime.

Only implement the atomic operations that are used by <stdatomic.h> for
datatype sizes that are supported by atomic(9). This means that on these
architectures, we can only use atomic operations on 32-bits and 64-bits
variables, which is typically sufficient.

This makes <stdatomic.h> work on all architectures except MIPS, since
MIPS and SPARC64 still use libgcc. Converting these architectures to
libcompiler_rt is on my todo list.

12 years agoDefine NULL to nullptr in C++11 mode (not strictly required, but it makes
David Chisnall [Tue, 27 Dec 2011 21:36:31 +0000 (21:36 +0000)]
Define NULL to nullptr in C++11 mode (not strictly required, but it makes
migrating code to C++11 easier).

Approved by: dim (mentor)

12 years ago - Fail when the utility is not invoked as rtprio nor idprio.
Xin LI [Tue, 27 Dec 2011 20:03:57 +0000 (20:03 +0000)]
 - Fail when the utility is not invoked as rtprio nor idprio.
 - use warnx() to tell the user whether a process is running in normal,
   idle or realtime priority. with the old code it would have been possible
   for another process to send data to stdout between
printf("%s: ", p);
   and
printf("* priority\n");
   and thus break the formatting.
 - 'rtprio 10 -0' triggeres non-intuitive behavior.  It would first set the
   priority of itself to 10 *and* would then try to execute '-0'. Of course,
   setting the priority of [id|rt]prio itself doesn't make a lot of sense,
   but it is intuitive compared to the previous behavior.
 - 'rtprio -t --1' will actually pass over the '-1' to rtprio().  Now
   invoking rtprio like this will catch the wrong usage before passing
   over the invalid argument to rtprio().
 - Garrett Cooper suggested to add further diagnostics where the failure
   occures, if execvp fails.

PR: bin/154042
Submitted by: arundel
MFC after: 1 month

12 years agoClean up from the 4.x era.
Sergey Kandaurov [Tue, 27 Dec 2011 15:59:51 +0000 (15:59 +0000)]
Clean up from the 4.x era.

In an example of boot command:
- rename wd(4) IDE disk drives name to ad(4) for the time being.
- update the used kernel path "/kernel" to the current default.
[It still worked occasionally by looking into the /boot/kernel directory,
so the resulting path was "/boot//kernel/kernel", with two slashes.]

Bump .Dd for this and previous changes.

MFC after: 1 week

12 years agoFix target mode compilation issues that arose after a change
Matt Jacob [Tue, 27 Dec 2011 14:59:24 +0000 (14:59 +0000)]
Fix target mode compilation issues that arose after a change
in the sense data structures.

MFC after: 1 week

12 years agoAdd missing \.
Ed Schouten [Tue, 27 Dec 2011 13:01:10 +0000 (13:01 +0000)]
Add missing \.

While sorting the MLINKS by name, I forgot to re-add it.

12 years agoAdd manual page for atomic operations.
Ed Schouten [Tue, 27 Dec 2011 12:58:54 +0000 (12:58 +0000)]
Add manual page for atomic operations.

12 years agoUpdate to vendor revision 4016.
Martin Matuska [Tue, 27 Dec 2011 10:36:56 +0000 (10:36 +0000)]
Update to vendor revision 4016.

Vendor has integrated most of our local changes in revisions 3976-3979 so
future updates are going to be easier.
Thanks to Tim Kientzle <kientzle@FreeBSD.org>.

MFC after: 8 days

12 years agoUpdate rtprio(2) manual page to reflect the latest changes in -CURRENT as
Xin LI [Tue, 27 Dec 2011 10:34:00 +0000 (10:34 +0000)]
Update rtprio(2) manual page to reflect the latest changes in -CURRENT as
well as provide documentation for rtprio_thread(2) system call.

MFC after: 1 month
X-MFC-after: r228470

12 years ago1. Remove a bunch of duplicates. Usually this means removing them from
Doug Barton [Tue, 27 Dec 2011 10:21:57 +0000 (10:21 +0000)]
1. Remove a bunch of duplicates. Usually this means removing them from
   fortunes, but occasionally remove them from the other 2 files when
   they are not offensive, or not murphy'ish enough.

   Where the version in fortunes had better attribution and/or formatting,
   copy it over.

2. Fix a few typos

3. Use the full name of François De La Rochefoucauld, fix one of his
   quotes, and remove the duplicate of it.

12 years agoUpdate to vendor revision 4016
Martin Matuska [Tue, 27 Dec 2011 10:21:29 +0000 (10:21 +0000)]
Update to vendor revision 4016

Obtained from: http://libarchive.googlecode.com/svn/release/2.8

12 years agoAddress issues found by clang. While there, fix also some style
Michael Tuexen [Tue, 27 Dec 2011 10:16:24 +0000 (10:16 +0000)]
Address issues found by clang. While there, fix also some style
issues.

MFC after: 3 months.

12 years agoFix some bugs in <stdatomic.h>.
Ed Schouten [Mon, 26 Dec 2011 23:33:41 +0000 (23:33 +0000)]
Fix some bugs in <stdatomic.h>.

- Make atomic_init() work for GCC, as assigning to structs doesn't work.
- Fix misplaced parenthesis in atomic_is_lock_free() for GCC.
- Make atomic_compare_exchange_strong() for GCC return the proper
  boolean value, whether object == expected.
- Fix argument passing in atomic_exchange_explicit() for GCC.

12 years agoUpdate to vendor revision 3982
Martin Matuska [Mon, 26 Dec 2011 22:25:58 +0000 (22:25 +0000)]
Update to vendor revision 3982

Obtained from: http://libarchive.googlecode.com/svn/release/2.8

12 years agoAdd libstdthreads.
Ed Schouten [Mon, 26 Dec 2011 21:51:53 +0000 (21:51 +0000)]
Add libstdthreads.

This library implements the C11 threads interface on top of the pthreads
library.  As discussed on the lists, the preferred way to implement
this, is as a separate library.

It is unlikely that these functions will be used a lot in the future. It
would have been easier if the C11 working group standardized (a subset
of) pthreads and clock_nanosleep(). Having it as a separate library
allows the embedded people to omit it from their system.

Discussed on: arch@, threads@

12 years agoOops, my bad. Fix a broken thing I introduced earlier.
Adrian Chadd [Mon, 26 Dec 2011 19:41:46 +0000 (19:41 +0000)]
Oops, my bad.  Fix a broken thing I introduced earlier.

12 years agoAs per C11, add static_assert() to <assert.h>.
Ed Schouten [Mon, 26 Dec 2011 18:57:59 +0000 (18:57 +0000)]
As per C11, add static_assert() to <assert.h>.

12 years agoImprove C11 bits in <stdlib.h>:
Ed Schouten [Mon, 26 Dec 2011 18:55:37 +0000 (18:55 +0000)]
Improve C11 bits in <stdlib.h>:

- Add missing semicolon to quick_exit(),
- Remove `func' parameter name from at_quick_exit(),
- Fix indentation.
- Compare against 2011 value.

12 years agoAdd cdefs-magic to add optional C11 bits to headers.
Ed Schouten [Mon, 26 Dec 2011 18:49:56 +0000 (18:49 +0000)]
Add cdefs-magic to add optional C11 bits to headers.

12 years agoAdd missing -l flag to usage().
Christian Brueffer [Mon, 26 Dec 2011 16:47:45 +0000 (16:47 +0000)]
Add missing -l flag to usage().

PR: 163629
Submitted by: olgeni
MFC after: 1 week

12 years agoThe standard is now called C11 -- C12.
Ed Schouten [Mon, 26 Dec 2011 10:58:21 +0000 (10:58 +0000)]
The standard is now called C11 -- C12.

While there, compare against the proper __STDC_VERSION value.

12 years agoMerge from OpenBSD 5.0 (this is a dummy change, the vendor change does not
Xin LI [Mon, 26 Dec 2011 09:07:08 +0000 (09:07 +0000)]
Merge from OpenBSD 5.0 (this is a dummy change, the vendor change does not
apply to us).

12 years agoImport nc from OpenBSD 5.0.
Xin LI [Mon, 26 Dec 2011 08:59:17 +0000 (08:59 +0000)]
Import nc from OpenBSD 5.0.

12 years agoAR5416 has 14 GPIO pins, from 0->13.
Adrian Chadd [Mon, 26 Dec 2011 08:21:29 +0000 (08:21 +0000)]
AR5416 has 14 GPIO pins, from 0->13.

12 years agoSince the only thing with a mux is the AR5416 and later, and we're now
Adrian Chadd [Mon, 26 Dec 2011 07:48:29 +0000 (07:48 +0000)]
Since the only thing with a mux is the AR5416 and later, and we're now
doing split software/hardware LED configuration, we can now simply
treat "softled" as an "output" mux type.

This works fine on this DWA-552. Previous generation (pre-11n NICs) don't
have a GPIO mux - only input/output configuration - so they ignore this
field.

12 years agoFlesh out configurable hardware based LED blinking.
Adrian Chadd [Mon, 26 Dec 2011 07:47:05 +0000 (07:47 +0000)]
Flesh out configurable hardware based LED blinking.

The hardware (MAC) LED blinking involves a few things:

* Selecting which GPIO pins map to the MAC "power" and "network" lines;
* Configuring the MAC LED state (associated, scanning, idle);
* Configuring the MAC LED blinking type and speed.

The AR5416 HAL configures the normal blinking setup - ie, blink rate based
on TX/RX throughput.  The default AR5212 HAL doesn't program in any
specific blinking type, but the default of 0 is the same.

This code introduces a few things:

* The hardware led override is configured via sysctl 'hardled';
* The MAC network and power LED GPIO lines can be set, or left at -1
  if needed.  This is intended to allow only one of the hardware MUX
  entries to be configured (eg for PCIe cards which only have one LED
  exposed.)

TODO:

* For AR2417, the software LED blinking involves software blinking the
  Network LED.  For the AR5416 and later, this can just be configured
  as a GPIO output line.  I'll chase that up with a subsequent commit.

* Add another software LED blink for "Link", separate from "activity",
  which blinks based on the association state.  This would make my
  D-Link DWA-552 have consistent and useful LED behaviour (as they're
  marked "Link" and "Activity."

* Don't expose the hardware LED override unless it's an AR5416 or later,
  as the previous generation hardware doesn't have this multiplexing
  setup.

12 years agoSetup the initial LED state on attach and resume.
Adrian Chadd [Mon, 26 Dec 2011 06:25:12 +0000 (06:25 +0000)]
Setup the initial LED state on attach and resume.

Some of the NICs I have here power up with the LEDs blinking, which is
incorrect. The blinking should only occur when the NIC is attempting
to associate.

* On powerup, set the state to HAL_LED_INIT, which turns on the "Power" MAC
  LED but leaves the "Network" MAC LED the way it is.

* On resume, also init it to HAL_LED_INIT unless in station mode, where
  it's forced to HAL_LED_RUN. Hopefully the net80211 state machine will
  call newstate() at some point, which will refiddle the LEDs.

I've tested this on a handful of 11n and pre-11n NICs. The blinking
behaviour is slightly more sensible now.

12 years agoUpdate the hardware LED blinking code to do something useful rather than
Adrian Chadd [Mon, 26 Dec 2011 06:07:21 +0000 (06:07 +0000)]
Update the hardware LED blinking code to do something useful rather than
relying on what the register defaults are.

This forces the blink mode to be proportional to the TX and RX frames
which match the RX filter.

This (along with a few tweaks to if_ath_led.c to configure the correct
GPIO pins) allows my DWA-552 AR5416 NIC to blink the LEDs in a useful
fashion, however those LEDs are marked "Link" and "Act(ivity)", which
don't really map well to the "power" / "network" LED interface which
the MAC provides. Some further tinkering is needed to see what other
useful operating modes are possible.

12 years agoRefactor out the software LED config code into a common function, called
Adrian Chadd [Mon, 26 Dec 2011 05:46:22 +0000 (05:46 +0000)]
Refactor out the software LED config code into a common function, called
ath_led_config().

The eventual aim is to have both software and hardware based LED
configuration done here.

12 years agoFirst pass of LED related code changes.
Adrian Chadd [Mon, 26 Dec 2011 05:37:09 +0000 (05:37 +0000)]
First pass of LED related code changes.

Migrate the LED code out of if_ath.c and into if_ath_led.c.
These routines are _all_ software based LED blinking.