]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoRe-sort ext2fs headers to make things easier to find.
pfg [Sun, 16 Jun 2013 16:10:45 +0000 (16:10 +0000)]
Re-sort ext2fs headers to make things easier to find.

In the ext2fs driver we have a mixture of headers:

- The ext2_ prefixed headers have strong influence from NetBSD
and are carry specific ext2/3/4 information.
- The unprefixed headers are inspired on UFS and carry implementation
specific information.

Do some small adjustments so that the information is easier to
find coming from either UFS or the NetBSD implementation.

MFC after: 3 days

11 years agosys/dev/xen/blkfront/blkfront.c:
gibbs [Sun, 16 Jun 2013 16:01:24 +0000 (16:01 +0000)]
sys/dev/xen/blkfront/blkfront.c:
In xbd_thaw(), fix inverted logic to verify the queue is frozen
before attempting a thaw.

MFC after: 1 week

11 years agoMove _Atomic() into <sys/cdefs.h>.
ed [Sun, 16 Jun 2013 10:48:47 +0000 (10:48 +0000)]
Move _Atomic() into <sys/cdefs.h>.

That way _Atomic() is defined next to all the other C11 keywords for
which we provide compatibility for pre-C11 compilers. While there, fix
the definition to place "volatile" at the end. Otherwise pointer types
will become "volatile T *" instead of "T * volatile".

11 years agoChange callout use counter to use C11 atomics.
ed [Sun, 16 Jun 2013 09:30:35 +0000 (09:30 +0000)]
Change callout use counter to use C11 atomics.

In order to get some coverage of C11 atomics in kernelspace, switch at
least one piece of code in kernelspace to use C11 atomics instead of
<machine/atomic.h>.

While there, slightly improve the code by adding an assertion to prevent
the use count from going negative.

11 years agocvsweb -> svnweb
joel [Sun, 16 Jun 2013 07:16:44 +0000 (07:16 +0000)]
cvsweb -> svnweb

11 years agoReturn ENETDOWN when the parent interface is down.
hrs [Sun, 16 Jun 2013 04:40:02 +0000 (04:40 +0000)]
Return ENETDOWN when the parent interface is down.

MFC after: 1 week

11 years agosh: Add tests for 'local -' (save shell options).
jilles [Sat, 15 Jun 2013 22:22:03 +0000 (22:22 +0000)]
sh: Add tests for 'local -' (save shell options).

11 years agoLet hastd use C11 atomics.
ed [Sat, 15 Jun 2013 22:17:59 +0000 (22:17 +0000)]
Let hastd use C11 atomics.

C11 atomics now work on all the architectures. Have at least a single
piece of software in our base system that uses C11 atomics. This
somewhat makes it less likely that we break it because of LLVM imports,
etc.

11 years agoRegenerate after CVS removal (and it seems other missed changes)
eadler [Sat, 15 Jun 2013 21:29:47 +0000 (21:29 +0000)]
Regenerate after CVS removal (and it seems other missed changes)

11 years agoRemove CVS from the base system.
eadler [Sat, 15 Jun 2013 20:29:07 +0000 (20:29 +0000)]
Remove CVS from the base system.

Discussed with: many
Reviewed by: peter, zi
Approved by: core

11 years agoStyle/comments.
dteske [Sat, 15 Jun 2013 13:38:21 +0000 (13:38 +0000)]
Style/comments.

11 years agoRestore use of polling mode for disk cache flush in case of kernel panic.
mav [Sat, 15 Jun 2013 12:46:38 +0000 (12:46 +0000)]
Restore use of polling mode for disk cache flush in case of kernel panic.
While I am not sure that any extra hardware access is a good idea after
panic, that is an existing behaviour that should better work correctly.

11 years agoBuild __clear_cache on ARM with clang now it supports it.
andrew [Sat, 15 Jun 2013 12:16:27 +0000 (12:16 +0000)]
Build __clear_cache on ARM with clang now it supports it.

11 years agoPull in r183926 from LLVM trunk:
andrew [Sat, 15 Jun 2013 12:13:22 +0000 (12:13 +0000)]
Pull in r183926 from LLVM trunk:

  Allow clang to build __clear_cache on ARM.

  __clear_cache is special. It needs no signature, but is a real function in
  compiler_rt or libgcc.

  Patch by Andrew Turner.

This allows us to build the __clear_cache function in compiler-rt.

11 years agoNow that the necessary infrastructure is in place to ensure hhook points which
lstewart [Sat, 15 Jun 2013 10:38:31 +0000 (10:38 +0000)]
Now that the necessary infrastructure is in place to ensure hhook points which
register after a khelp module will get hooked, move khelp module initialisation
to the earlier SI_SUB_KLD stage.

MFC after: 1 week

11 years agoMove hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to
lstewart [Sat, 15 Jun 2013 10:08:34 +0000 (10:08 +0000)]
Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to
ensure all per-vnet related hhook initialisation is completed prior to any
virtualised hhook points attempting registration.

vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen.
There are no per-vnet initialisors in the source tree at this time which run
earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates
there are no subsystems pre SI_SUB_MBUF that would likely be interested in
registering a virtualised hhook point.

Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first
overtly network-related initilisation stage to run after SI_SUB_VNET. If a
subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register
virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be
revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which
runs immediately after SI_SUB_VNET.

MFC after: 1 week

11 years agoPull in r184040 from upstream clang trunk:
ed [Sat, 15 Jun 2013 09:42:43 +0000 (09:42 +0000)]
Pull in r184040 from upstream clang trunk:

  Emit native implementations of atomic operations on FreeBSD/armv6.

  Just like on Linux, FreeBSD/armv6 assumes the system supports
  ldrex/strex unconditionally. It is also used by the kernel. We can
  therefore enable support for it, like we do on Linux.

  While there, change one of the unit tests to explicitly test against
  armv5 instead of armv7, as it actually tests whether libcalls are
  emitted.

11 years agoLet ARM use the custom tailored atomic intrinsics.
ed [Sat, 15 Jun 2013 09:04:10 +0000 (09:04 +0000)]
Let ARM use the custom tailored atomic intrinsics.

11 years agoRemove conflicting macros from SPARC64's atomic(9) header.
ed [Sat, 15 Jun 2013 08:23:53 +0000 (08:23 +0000)]
Remove conflicting macros from SPARC64's atomic(9) header.

The atomic_load() and atomic_store() macros conflict with the equally
named macros from <stdatomic.h>. Remove them, as they are only used to
implement functions that are not present on any of the other
architectures.

11 years agoStick to using the documented atomic(9) API.
ed [Sat, 15 Jun 2013 08:21:54 +0000 (08:21 +0000)]
Stick to using the documented atomic(9) API.

The atomic_store_ptr() function is not part of the atomic(9) API. We
only provide a version with a release barrier.

11 years agoMake support for atomics on ARM complete.
ed [Sat, 15 Jun 2013 08:15:22 +0000 (08:15 +0000)]
Make support for atomics on ARM complete.

Provide both __sync_*-style and __atomic_*-style functions that perform
the atomic operations on ARMv5 by using Restartable Atomic Sequences.

While there, clean up some pieces of code where it's sufficient to use
regular uint32_t to store register contents and don't need full reg_t's.
Also sync this back to the MIPS code.

11 years agoCleanup and simplification in khelp_{register|deregister}_helper(). No
lstewart [Sat, 15 Jun 2013 06:45:17 +0000 (06:45 +0000)]
Cleanup and simplification in khelp_{register|deregister}_helper(). No
functional changes.

MFC after: 1 week

11 years agoAdd a private KPI between hhook and khelp that allows khelp modules to insert
lstewart [Sat, 15 Jun 2013 05:57:29 +0000 (05:57 +0000)]
Add a private KPI between hhook and khelp that allows khelp modules to insert
hook functions into hhook points which register after the modules were loaded -
potentially useful during boot or if hhook points are dynamically registered.

MFC after: 1 week

11 years agoProperly track the different reasons new I/O is temporarily disabled, and
gibbs [Sat, 15 Jun 2013 04:51:31 +0000 (04:51 +0000)]
Properly track the different reasons new I/O is temporarily disabled, and
only re-enable I/O when all reasons have cleared.

sys/dev/xen/blkfront/block.h:
In the block front driver softc, replace the boolean
XBDF_FROZEN flag with a count of commands and driver global
issues that freeze the I/O queue.  So long xbd_qfrozen_cnt
is non-zero, I/O is halted.

Add flags to xbd_flags for tracking grant table entry and
free command resource shortages.  Each of these classes can
increment xbd_qfrozen_cnt at most once.

Add a command flag (XBDCF_ASYNC_MAPPING) that is set whenever
the initial mapping attempt of a command fails with EINPROGRESS.

sys/dev/xen/blkfront/blkfront.c:
In xbd_queue_cb(), use new XBDCF_ASYNC_MAPPING flag to definitively
know if an async bus dmamap load has occurred.

Add xbd_freeze() and xbd_thaw() helper methods for managing
xbd_qfrozen_cnt and use them to implement all queue freezing logic.

Add missing "thaw" to restart I/O processing once grant references
become available.

Sponsored by: Spectra Logic Corporation

11 years agoInternalise handling of virtualised hook points inside
lstewart [Sat, 15 Jun 2013 04:03:40 +0000 (04:03 +0000)]
Internalise handling of virtualised hook points inside
hhook_{add|remove}_hook_lookup() so that khelp (and other potential API
consumers) do not have to care when they attempt to (un)hook a particular hook
point identified by id and type.

Reviewed by: scottl
MFC after: 1 week

11 years agoMerge r250802 from bryanv/vtnetmq - Fix setting of the Rx filters
bryanv [Sat, 15 Jun 2013 03:55:04 +0000 (03:55 +0000)]
Merge r250802 from bryanv/vtnetmq - Fix setting of the Rx filters

QEMU 1.4 made the descriptor requirement stricter - the size of buffer
descriptor must exactly match the number of MAC addresses provided.

PR: kern/178955
MFC after: 5 days

11 years agoUpgrade Xen interface headers to Xen 4.2.1.
gibbs [Fri, 14 Jun 2013 23:43:44 +0000 (23:43 +0000)]
Upgrade Xen interface headers to Xen 4.2.1.

Move FreeBSD from interface version 0x00030204 to 0x00030208.
Updates are required to our grant table implementation before we
can bump this further.

sys/xen/hvm.h:
Replace the implementation of hvm_get_parameter(), formerly located
in sys/xen/interface/hvm/params.h.  Linux has a similar file which
primarily stores this function.

sys/xen/xenstore/xenstore.c:
Include new xen/hvm.h header file to get hvm_get_parameter().

sys/amd64/include/xen/xen-os.h:
sys/i386/include/xen/xen-os.h:
Correctly protect function definition and variables from being
included into assembly files in xen-os.h

Xen memory barriers are now prefixed with "xen_" to avoid conflicts
with OS native primatives.  Define Xen memory barriers in terms of
the native FreeBSD primatives.

Sponsored by: Spectra Logic Corporation
Reviewed by: Roger Pau Monné
Tested by: Roger Pau Monné
Obtained from: Roger Pau Monné (bug fixes)

11 years agoFix typo (dbM -> dBm)
eadler [Fri, 14 Jun 2013 23:04:31 +0000 (23:04 +0000)]
Fix typo (dbM -> dBm)

Submitted by: Daan@vitsch.nl
Reviewed by: adrian

11 years agoSimplify the hierarchy target's logic. [0]
brooks [Fri, 14 Jun 2013 22:32:47 +0000 (22:32 +0000)]
Simplify the hierarchy target's logic. [0]

Run hierarchy with WORLDTMP in the path so it works when it is invoked
directly.  Such use is nearly alwasy wrong but appears to be common.[1]

PR: conf/178209 [0], conf/178547 [1]
Submitted by: Garrett Cooper <yaneurabeya@gmail.com> [0]
MFC after: 5 days

11 years agosh(1): A subshell environment has its own rlimits (ulimit).
jilles [Fri, 14 Jun 2013 22:06:18 +0000 (22:06 +0000)]
sh(1): A subshell environment has its own rlimits (ulimit).

This has always been the case and is intended (just like cd).

This matches Austin group issue #706.

11 years agoPull in r181620 from llvm trunk:
dim [Fri, 14 Jun 2013 21:14:36 +0000 (21:14 +0000)]
Pull in r181620 from llvm trunk:

  [ms-inline asm] Fix a crasher when we fail on a direct match.

  The issue was that the MatchingInlineAsm and VariantID args to the
  MatchInstructionImpl function weren't being set properly.  Specifically, when
  parsing intel syntax, the parser thought it was parsing inline assembly in the
  at&t dialect; that will never be the case.

  The crash was caused when the emitter tried to emit the instruction, but the
  operands weren't set.  When parsing inline assembly we only set the opcode, not
  the operands, which is used to lookup the instruction descriptor.
  rdar://13854391 and PR15945

  Also, this commit reverts r176036.  Now that we're correctly parsing the intel
  syntax the pushad/popad don't match properly.  I've reimplemented that fix using
  a MnemonicAlias.

Pull in r183907 from llvm trunk:

  X86: Make the cmov aliases work with intel syntax too.

These commits make a number of Intel-style inline assembly mnemonics
aliases (occurring in several ports) work properly, which could cause
assertions otherwise.

Reported by: kwm, bapt

11 years agoAdd skeleton processing of selected packages in the order in which they
dteske [Fri, 14 Jun 2013 19:35:30 +0000 (19:35 +0000)]
Add skeleton processing of selected packages in the order in which they
should be processed. De-select each package as we "process" (actual
processing still pending) each package so that if we get an error, we can
return to an accurate state of selected packages.

11 years agoFix a major oversight in r251732 which causes non-VIMAGE kernels to trigger a
lstewart [Fri, 14 Jun 2013 18:11:21 +0000 (18:11 +0000)]
Fix a major oversight in r251732 which causes non-VIMAGE kernels to trigger a
KASSERT during TCP hhook registration at boot. Virtualised hook points only
require extra housekeeping and sanity checking when "options VIMAGE" is present.

Reported by: bdrewery,jh,dhw
Tested by: dhw
MFC after: 1 week
X-MFC with: 251732

11 years agoImprove debugger visibility into queuing functions by removing the macro
gibbs [Fri, 14 Jun 2013 17:00:58 +0000 (17:00 +0000)]
Improve debugger visibility into queuing functions by removing the macro
scheme for defining inline command queuing functions.

Prefer enums to #defines.

sys/dev/xen/blkfront/block.h
Replace inline function generation performed by the
XBDQ_COMMAND_QUEUE() macro with single instances of each
inline function (init, enqueue, dequeue, remove).  This was
made possible by using queue indexes instead of bit flags
in the command structure, and passing the index enum as
an argument to the functions.

Improve panic/assert messages in the queue functions.

Combine queue data and stats into a single data structure
and declare an array of them instead of each queue individually.

Convert command flags, softc state, and softc flags to enums.

sys/dev/xen/blkfront/blkfront.c
Mechanical adjustments for new queue api.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoFlag recursive make targets with .MAKE
sjg [Fri, 14 Jun 2013 16:30:11 +0000 (16:30 +0000)]
Flag recursive make targets with .MAKE
so that job token pipe is passed to them.
To avoid surprising anyone, only add .MAKE to ${TGTS} when -n
has not been specified (at least for Makefile).

Reviewed by: obrien

11 years agoFlag recursive make targets with .MAKE (has no effect on fmake)
sjg [Fri, 14 Jun 2013 16:25:41 +0000 (16:25 +0000)]
Flag recursive make targets with .MAKE (has no effect on fmake)
make -n will still exectute such targets
make -N will not.

Reviewed by: obrien

11 years agoWe cannot remove the _+_ trick, until old make is completely deprecated.
sjg [Fri, 14 Jun 2013 16:24:07 +0000 (16:24 +0000)]
We cannot remove the _+_ trick, until old make is completely deprecated.
But we don't want to set it to + for bmake since it breaks make -N
which is used to supress the normal handling of targets marked with .MAKE
(which seems broken in fmake and might be why _+_ was introduced).
Add some comments to explain what's gong on.

Reviewed by: obrien

11 years agoReplace cpusetffs_obj with CPU_FFS, missed in r251703.
pluknet [Fri, 14 Jun 2013 10:26:38 +0000 (10:26 +0000)]
Replace cpusetffs_obj with CPU_FFS, missed in r251703.

Reported by: bdrewery, O. Hartmann

11 years agoFix and improve filemon(4) example:
pluknet [Fri, 14 Jun 2013 08:28:08 +0000 (08:28 +0000)]
Fix and improve filemon(4) example:
- remove return statements from void function [1]
- include missing header
- use O_CLOEXEC instead of separate fcntl() calls

PR: docs/179459 [1]
MFC after: 1 week

11 years agoImprove firmware download status check. Previous check was insufficient for
mav [Fri, 14 Jun 2013 08:26:58 +0000 (08:26 +0000)]
Improve firmware download status check.  Previous check was insufficient for
ATA since it ignored transport errors like command timeouts, while for SCSI
it was just wrong.

11 years agoAdd in an initial WB225 (AR9485 + AR3012 BT) combo profile.
adrian [Fri, 14 Jun 2013 08:18:17 +0000 (08:18 +0000)]
Add in an initial WB225 (AR9485 + AR3012 BT) combo profile.

This hasn't yet been tested as unfortunately the AR3012 I have doesn't
have the "real" firmware on it; it shipped with the cut down HCI firmware
that only understands enough to accept a new firmware image.

* Linux ath9k (GPIO constants)

11 years agoThe AR9300 HAL uses this config to program AR_PHY_SWITCH_COM_2 on AR9485
adrian [Fri, 14 Jun 2013 08:15:28 +0000 (08:15 +0000)]
The AR9300 HAL uses this config to program AR_PHY_SWITCH_COM_2 on AR9485
NICs which have bluetooth coexistence enabled.

The WB225 NIC has the common antenna switch configuration set to 0x0 which
disables all external switch bit setting. This obviously won't work when
doing coexistence.

This value is a magic value from the windows .inf files. It _looks_ right
but I haven't yet verified it - unfortunately my AR9285+AR3012 BT combo
has an earlier BT device which doesn't actually _have_ firmware on it.
So I have to fix ath3kfw to handle loading in firmware into the newer
NICs before I can finish testing this.

This may not hold true for CUS198, which is another custom AR9485 board.

11 years agoFlip on AH_PRIVATE_DIAG by default; this will include the AR9300 EEPROM
adrian [Fri, 14 Jun 2013 08:13:21 +0000 (08:13 +0000)]
Flip on AH_PRIVATE_DIAG by default; this will include the AR9300 EEPROM
dump code that is worth having around.

11 years agoLink the AR9300 EEPROM dump tool into the build.
adrian [Fri, 14 Jun 2013 08:12:54 +0000 (08:12 +0000)]
Link the AR9300 EEPROM dump tool into the build.

11 years agoBegin fleshing out an AR9300 EEPROM dump helper utility.
adrian [Fri, 14 Jun 2013 08:12:40 +0000 (08:12 +0000)]
Begin fleshing out an AR9300 EEPROM dump helper utility.

11 years agoAdd missing formatting strings.
adrian [Fri, 14 Jun 2013 08:11:45 +0000 (08:11 +0000)]
Add missing formatting strings.

Thanks to: clang

11 years agoAdd bluetooth setup method functions to the HAL.
adrian [Fri, 14 Jun 2013 06:15:23 +0000 (06:15 +0000)]
Add bluetooth setup method functions to the HAL.

11 years agoIf chan is NULL, don't derefrence it.
adrian [Fri, 14 Jun 2013 06:14:49 +0000 (06:14 +0000)]
If chan is NULL, don't derefrence it.

The bluetooth setup code actually does a channel lookup during setup,
even though we haven't yet programmed in a channel. Sigh.

Tested:

* WB225 (AR9485) + bluetooth

11 years ago- Use the consistenly PHY-specific reset routine PHY_RESET() rather than
kevlo [Fri, 14 Jun 2013 05:36:47 +0000 (05:36 +0000)]
- Use the consistenly PHY-specific reset routine PHY_RESET() rather than
  generic mii_phy_reset().
- Return the result of mii_mediachg() rather than blindly returning 0.
- on smsc(4), driver lock should be held to get current
  mii_media_active/mii_media_status value.

Reviewed by: yongari

11 years agoFix a typo introduced in r213280. IFM_OPTIONS macro should see
yongari [Fri, 14 Jun 2013 05:16:51 +0000 (05:16 +0000)]
Fix a typo introduced in r213280. IFM_OPTIONS macro should see
current media word.

11 years agoAdd support for non-virtualised hhook points, which are uniquely identified by
lstewart [Fri, 14 Jun 2013 04:10:34 +0000 (04:10 +0000)]
Add support for non-virtualised hhook points, which are uniquely identified by
type and id, as compared to virtualised hook points which are now uniquely
identified by type, id and a vid (which for vimage is the pointer to the vnet
that the hhook resides in).

All hhook_head structs for both virtualised and non-virtualised hook points
coexist in hhook_head_list, and a separate list is maintained for hhook points
within each vnet to simplify some vimage-related housekeeping.

Reviewed by: scottl
MFC after: 1 week

11 years agoInitial AR9485/AR933x 1x1 LNA diversity work.
adrian [Fri, 14 Jun 2013 03:42:10 +0000 (03:42 +0000)]
Initial AR9485/AR933x 1x1 LNA diversity work.

* Add the LNA configuration table entries for AR933x/AR9485
* Add a chip-dependent LNA signal level delta in the startup path
* Add a TODO list for the stuff I haven't yet ported over but
  I haven't.

Tested:

* AR9462 with LNA diversity enabled

11 years agosys/dev/xen/netfront/netfront.c:
gibbs [Fri, 14 Jun 2013 03:31:11 +0000 (03:31 +0000)]
sys/dev/xen/netfront/netfront.c:
In netif_free(), call ifmedia_removeall() after ether_ifdetach()
so that bpf listeners are detached, any link state processing
is completed, and there is no chance for external reference to media
information.

Suggested by: yongari
MFC after: 1 week

11 years agoFix a potential NULL-pointer dereference that would trigger if the hhook
lstewart [Fri, 14 Jun 2013 02:25:40 +0000 (02:25 +0000)]
Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.

MFC after: 3 days

11 years agoThe functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}().
markj [Fri, 14 Jun 2013 01:12:59 +0000 (01:12 +0000)]
The functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}().

MFC after: 3 days

11 years agoRemove unused macros PTESHIFT, PDESHIFT, PDPESHIFT and PML4ESHIFT.
neel [Fri, 14 Jun 2013 00:03:43 +0000 (00:03 +0000)]
Remove unused macros PTESHIFT, PDESHIFT, PDPESHIFT and PML4ESHIFT.

Reviewed by: alc

11 years agoAll of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
marius [Thu, 13 Jun 2013 22:13:41 +0000 (22:13 +0000)]
All of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
exact same (subsystem) device and vendor IDs. However, the reference
design for the OXu16PCI954 uses a 14.7456 MHz clock (as does the EXSYS
EX-41098-2 equipped with these), while at least the OX16PCI954 defaults
to a 1.8432 MHz one. According to the datasheets of these chips, the
only difference in PCI configuration space is that OXu16PCI954 have
a revision ID of 1 while the other two are at 0. So employ the latter
for determining the default clock rates of this family.
Note that one might think that the actual clock could be derived from
the Clock Prescaler Register (CPR) of these chips. Unfortunately, this
is not that case and its use and content are orthogonal to the frequency
of the crystal employed.
Tested with an EXSYS EX-41098-2, which identifies and attaches as:
pcib4@pci0:19:0:0:      class=0x060400 card=0x02dd1014 chip=0x10801b21
rev=0x03 hdr=0x01
    vendor     = 'ASMedia Technology Inc.'
    device     = 'ASM1083/1085 PCIe to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
puc0@pci0:20:4:0:       class=0x070006 card=0x00001415 chip=0x95011415
rev=0x01 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    device     = 'OX16PCI954 (Quad 16950 UART) function 0 (Uart)'
    class      = simple comms
    subclass   = UART
puc1@pci0:20:4:1:       class=0x068000 card=0x00001415 chip=0x95111415
rev=0x01 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    device     = 'OX16PCI954 (Quad 16950 UART) function 1 (8bit bus)'
    class      = bridge
puc2@pci0:20:8:0:       class=0x070006 card=0x00001415 chip=0x95011415
rev=0x01 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    device     = 'OX16PCI954 (Quad 16950 UART) function 0 (Uart)'
    class      = simple comms
    subclass   = UART
puc3@pci0:20:8:1:       class=0x068000 card=0x00001415 chip=0x95111415
rev=0x01 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    device     = 'OX16PCI954 (Quad 16950 UART) function 1 (8bit bus)'
    class      = bridge

pci20: <ACPI PCI bus> on pcib4
puc0: <Oxford Semiconductor OX16PCI954 UARTs> port 0x5000-0x501f,
0x5020-0x503f mem 0xc6000000-0xc6000fff,0xc6001000-0xc6001fff irq 16 at
device 4.0 on pci20
uart1: <16950 or compatible> at port 1 on puc0
uart2: <16950 or compatible> at port 2 on puc0
uart3: <16950 or compatible> at port 3 on puc0
uart4: <16950 or compatible> at port 4 on puc0
puc1: <Oxford Semiconductor OX9160/OX16PCI954 UARTs (function 1)> port
0x5040-0x505f,0x5060-0x507f mem 0xc6002000-0xc6002fff,0xc6003000-0xc6003fff
irq 16 at device 4.1 on pci20
puc2: <Oxford Semiconductor OX16PCI954 UARTs> port 0x5080-0x509f,
0x50a0-0x50bf mem 0xc6004000-0xc6004fff,0xc6005000-0xc6005fff irq 16 at
device 8.0 on pci20
uart5: <16950 or compatible> at port 1 on puc2
uart6: <16950 or compatible> at port 2 on puc2
uart7: <16950 or compatible> at port 3 on puc2
uart8: <16950 or compatible> at port 4 on puc2
puc3: <Oxford Semiconductor OX9160/OX16PCI954 UARTs (function 1)> port
0x50c0-0x50df,0x50e0-0x50ff mem 0xc6006000-0xc6006fff,0xc6007000-0xc6007fff
irq 16 at device 8.1 on pci20

MFC after: 2 weeks

11 years agoFix whitespace and normalize some entries.
marius [Thu, 13 Jun 2013 21:47:22 +0000 (21:47 +0000)]
Fix whitespace and normalize some entries.

11 years agoFix the vfp code to work with the 16 register variants of the VFP unit. We
andrew [Thu, 13 Jun 2013 21:31:33 +0000 (21:31 +0000)]
Fix the vfp code to work with the 16 register variants of the VFP unit. We
check which variant we are on, and if it is a VFPv3 or v4, and has 32
double registers we save these. This fixes VFP support on Raspberry Pi.

While here clean fmrx and fmxr up to use the register names from vfp.h
as opposed to the raw register names.

11 years ago - Convert the slab free item list from a linked array of indices to a
jeff [Thu, 13 Jun 2013 21:05:38 +0000 (21:05 +0000)]
 - Convert the slab free item list from a linked array of indices to a
   bitmap using sys/bitset.  This is much simpler, has lower space
   overhead and is cheaper in most cases.
 - Use a second bitmap for invariants asserts and improve the quality of
   the asserts as well as the number of erroneous conditions that we will
   catch.
 - Drastically simplify sizing code.  Special case refcnt zones since they
   will be going away.
 - Update stale comments.

Sponsored by: EMC / Isilon Storage Division

11 years ago - Add a BIT_FFS() macro and use it to replace cpusetffs_obj()
jeff [Thu, 13 Jun 2013 20:46:03 +0000 (20:46 +0000)]
 - Add a BIT_FFS() macro and use it to replace cpusetffs_obj()

Discussed with: attilio
Sponsored by: EMC / Isilon Storage Division

11 years agoBring the stdatomic for MIPS code slightly more in sync with the ARM version.
ed [Thu, 13 Jun 2013 18:47:28 +0000 (18:47 +0000)]
Bring the stdatomic for MIPS code slightly more in sync with the ARM version.

11 years agoAdd C11 atomic fallbacks for ARM.
ed [Thu, 13 Jun 2013 18:46:49 +0000 (18:46 +0000)]
Add C11 atomic fallbacks for ARM.

Basically the situation is as follows:

- When using Clang + armv6, we should not need any intrinsics. It should
  support it, even though due to a target misconfiguration it does not.
  We should fix this in Clang.
- When using Clang + noarmv6, provide __atomic_* functions that disable
  interrupts.
- When using GCC + armv6, we can provide __sync_* intrinsics, similar to
  what we did for MIPS. As ARM and MIPS are quite similar, simply base
  this implementation on the one I did for MIPS.
- When using GCC + noarmv6, disable the interrupts, like we do for
  Clang.

This implementation still lacks functions for noarmv6 userspace. To be
done.

11 years agoMinor improvements to <stdatomic.h>.
ed [Thu, 13 Jun 2013 18:40:45 +0000 (18:40 +0000)]
Minor improvements to <stdatomic.h>.

- Define __SYNC_ATOMICS in case we're using the __sync_*() API. This is
  not used by <stdatomic.h> itself, but may be useful for some of the
  intrinsics code to determine whether it should build the
  machine-dependent intrinsic functions.

- Make is_lock_free() work in kernelspace. For now, assume atomics in
  kernelspace are always lock free. This is a quite reasonable
  assumption, as we surely shouldn't implement the atomic fallbacks for
  arbitrary sizes.

11 years agoExplain remedy for -J error from old make
sjg [Thu, 13 Jun 2013 18:39:17 +0000 (18:39 +0000)]
Explain remedy for -J error from old make

11 years agoAdd a missing comma.
jkim [Thu, 13 Jun 2013 18:33:54 +0000 (18:33 +0000)]
Add a missing comma.

11 years ago- Document GCC support for AMD Family 10h processors (amdfam10).
jkim [Thu, 13 Jun 2013 18:31:09 +0000 (18:31 +0000)]
- Document GCC support for AMD Family 10h processors (amdfam10).
- Document Clang support for AMD Jaguar processors (btver2).

11 years agoAdd a new CPUTYPE supported by Clang 3.3 for AMD Jaguar processors (btver2).
jkim [Thu, 13 Jun 2013 18:26:12 +0000 (18:26 +0000)]
Add a new CPUTYPE supported by Clang 3.3 for AMD Jaguar processors (btver2).

11 years agoBe more agressive about bootstrapping ctfmerge and ctfconvert so
brooks [Thu, 13 Jun 2013 18:26:04 +0000 (18:26 +0000)]
Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly.

Sponsored by: DARPA, AFRL
MFC after: 3 days

11 years agoUse portable string comparison
emaste [Thu, 13 Jun 2013 13:05:08 +0000 (13:05 +0000)]
Use portable string comparison

We support == in /bin/sh now, but it ought to be avoided, and my use of
it was accidental.

11 years agoFix two issues with the spin loops in the umtx(2) implementation.
kib [Thu, 13 Jun 2013 09:33:22 +0000 (09:33 +0000)]
Fix two issues with the spin loops in the umtx(2) implementation.

- When looping, check for the pending suspension.  Otherwise, other
  usermode thread which races with the looping one, could try to
  prevent the process from stopping or exiting.

- Add missed checks for the faults from casuword*().  The code is
  structured in a way which makes the loops exit if the specified
  address is invalid, since both fuword() and casuword() return -1 on
  the fault.  But if the address is mapped readonly, the typical value
  read by fuword() is different from -1, while casuword() returns -1.
  Absent the checks for casuword() faults, this is interpreted as the
  race with other thread and causes non-interruptible spinning in the
  kernel.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoRevert r251649:
mav [Thu, 13 Jun 2013 08:34:23 +0000 (08:34 +0000)]
Revert r251649:
ken@ noticed that with recently added d_gone() disk method GEOM already
holds reference on the periph, so we don't need another one.

11 years agoRemove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
lstewart [Thu, 13 Jun 2013 08:07:42 +0000 (08:07 +0000)]
Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
KHELP_DECLARE_MOD_UMA().

MFC after: 3 days

11 years agoImprove locking strategy between keys hash and ID hash.
glebius [Thu, 13 Jun 2013 06:07:19 +0000 (06:07 +0000)]
Improve locking strategy between keys hash and ID hash.

Before this change state creating sequence was:

1) lock wire key hash
2) link state's wire key
3) unlock wire key hash
4) lock stack key hash
5) link state's stack key
6) unlock stack key hash
7) lock ID hash
8) link into ID hash
9) unlock ID hash

What could happen here is that other thread finds the state via key
hash lookup after 6), locks ID hash and does some processing of the
state. When the thread creating state unblocks, it finds the state
it was inserting already non-virgin.

Now we perform proper interlocking between key hash locks and ID hash
lock:

1) lock wire & stack hashes
2) link state's keys
3) lock ID hash
4) unlock wire & stack hashes
5) link into ID hash
6) unlock ID hash

To achieve that, the following hacking was performed in pf_state_key_attach():

- Key hash mutex is marked with MTX_DUPOK.
- To avoid deadlock on 2 key hash mutexes, we lock them in order determined
  by their address value.
- pf_state_key_attach() had a magic to reuse a > FIN_WAIT_2 state. It unlinked
  the conflicting state synchronously. In theory this could require locking
  a third key hash, which we can't do now.
  Now we do not remove the state immediately, instead we leave this task to
  the purge thread. To avoid conflicts in a short period before state is
  purged, we push to the very end of the TAILQ.
- On success, before dropping key hash locks, pf_state_key_attach() locks
  ID hash and returns.

Tested by: Ian FREISLICH <ianf clue.co.za>

11 years agoRemove unused variable sc_tx_bufsz.
kevlo [Thu, 13 Jun 2013 05:46:19 +0000 (05:46 +0000)]
Remove unused variable sc_tx_bufsz.
The variable is initialized but not used.

Reviewed by: yongari

11 years agoRevert revision 251648. style(9) requires an empty line here.
grog [Thu, 13 Jun 2013 04:11:21 +0000 (04:11 +0000)]
Revert revision 251648.  style(9) requires an empty line here.

Reported by: mdf@

11 years agoRelax some unnecessary unsigned type changes in ext2fs.
pfg [Thu, 13 Jun 2013 03:23:24 +0000 (03:23 +0000)]
Relax some unnecessary unsigned type changes in ext2fs.

While the changes in r245820 are in line with the ext2 spec,
the code derived from UFS can use negative values so it is
better to relax some types to keep them as they were, and
somewhat more similar to UFS. While here clean some casts.

Some of the original types are still wrong and will require
more work.

Discussed with: bde
MFC after: 3 days

11 years agoSet the FreeBSD capability bit to indicate that LNA diversity is enabled.
adrian [Thu, 13 Jun 2013 02:20:45 +0000 (02:20 +0000)]
Set the FreeBSD capability bit to indicate that LNA diversity is enabled.

This is true for the AR9485 and AR933x SoC.

11 years agoReturn HAL_ANT_VARIABLE for now, until it's unstubbed.
adrian [Thu, 13 Jun 2013 02:19:53 +0000 (02:19 +0000)]
Return HAL_ANT_VARIABLE for now, until it's unstubbed.

This is needed by the slow antenna diversity logic for the AR9485/AR9462
as it's only engaged if the TX diveristy is set to VARIABLE.

11 years agoFix a typo: s/KLSI/CATC/
kevlo [Thu, 13 Jun 2013 01:33:01 +0000 (01:33 +0000)]
Fix a typo: s/KLSI/CATC/

11 years agoAdd PF_IEEE80211 definition.
kevlo [Thu, 13 Jun 2013 01:29:54 +0000 (01:29 +0000)]
Add PF_IEEE80211 definition.

Reviewed by: rpaulo

11 years agoRenumber clauses to reduce diffs to other versions
emaste [Thu, 13 Jun 2013 00:19:30 +0000 (00:19 +0000)]
Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.

11 years agoTurn libc.so into an ld script rather than a symlink pointing to the
jlh [Wed, 12 Jun 2013 21:12:05 +0000 (21:12 +0000)]
Turn libc.so into an ld script rather than a symlink pointing to the
real shared object and libssp_nonshared.a.

This was the last showstopper that prevented from enabling SSP for ports
by default.  portmgr@ performed a buildworld which showed no significant
breakage with this patch.

Details:

On i386 for PIC objects, gcc uses the __stack_chk_fail_local hidden
symbol instead of calling __stack_chk_fail directly [1].  This happen
not only with our gcc-4.2.1 but also with the latest gcc-4.8.  If you
want the very nasty details, see [2].

OTOH the problem doesn't exist on other architectures.  It also doesn't
exist with Clang as the latter will somehow manage to create the
function in the object file at compile time (contrary to only
referencing it through a symbol that will be brought in at link time).

In a perfect world, when an object file is compiled with
-fstack-protector, it will be linked into a binary or a DSO with this
same flag as well, so GCC will add libssp_nonshared.a to the linker
command-line.  Unfortunately, we don't control softwares in ports and we
may have such broken DSO.  This is the whole point of this patch.

You can reproduce the problem on i386 by compiling a source file into an
object file with "-fstack-protector-all -fPIE" and linking it
into a binary without "-fstack-protector".

This ld script automatically proposes libssp_nonshared.a along with the
real libc DSO to the linker.  It is important to understand that the
object file contained in this library will be pulled in the resulting
binary _only if_ the linker notices one of its symbols is needed (i.e.
one of the SSP symbol is missing).

A theorical performance impact could be when compiling, but my testing
showed less than 0.1% of difference.

[1] For 32-bit code gcc saves the PIC register setup by using
    __stack_chk_fail_local hidden function instead of calling
    __stack_chk_fail directly.  See comment line 19460 in:
    src/contrib/gcc/config/i386/i386.c

[2] When compiling a source file to an object file, if you use something
    which is external to the compilation unit, GCC doesn't know yet if
    this symbol will be inside or outside the DSO.  So it expects the
    worst case and routes the symbol through the GOT, which means
    additional space and extra relocation for rtld(1).

    Declaring a symbol has hidden tells GCC to use the optimal route (no
    GOT), but on the other hand this means the symbol has to be provided
    in the same DSO (namely libssp_nonshared.a).

    On i386, GCC actually uses an hidden symbol for SSP in PIC objects
    to save PIC register setup, as said in [1].

PR: ports/138228
PR: ports/168010
Reviewed by: kib, kan

11 years agoHandle DW_TAG_unspecified_type
emaste [Wed, 12 Jun 2013 20:11:49 +0000 (20:11 +0000)]
Handle DW_TAG_unspecified_type

2011-11-14  Jim Ingham  <jingham@apple.com>

        * dwarf2read.c (read_type_die): Handle DW_TAG_unspecified_type.
        (read_tag_unspecified_type): New function, add a type for the
        DW_TAG_unspecified_type die.

Obtained from: Apple, gdb-1752

11 years agoHandle DW_TAG_rvalue_reference_type
emaste [Wed, 12 Jun 2013 20:05:19 +0000 (20:05 +0000)]
Handle DW_TAG_rvalue_reference_type

2012-05-21  Jim Ingham <jingham@apple.com>

      * dwarf2read.c (process_die): Handle DW_TAG_rvalue_reference_type.
      (read_type_die): Ditto.
      (dwarf_tag_name): Ditto.

      * elf/dwarf2.h: Add DW_TAG_rvalue_reference_type.

Obtained from: Apple, gdb-1820

11 years agoFix build after r251654.
mav [Wed, 12 Jun 2013 19:21:23 +0000 (19:21 +0000)]
Fix build after r251654.

11 years agoUpgrade our copy of llvm/clang to 3.3 release.
dim [Wed, 12 Jun 2013 18:48:53 +0000 (18:48 +0000)]
Upgrade our copy of llvm/clang to 3.3 release.

Release notes are still in the works, these will follow soon.

MFC after: 1 month

11 years agoReplicate r242422 from ata(4) to mvs(4):
mav [Wed, 12 Jun 2013 18:08:11 +0000 (18:08 +0000)]
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in mvs(4) with ATA_CAM option.
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.

11 years agoClean up swapfile memory disk on shutdown
crees [Wed, 12 Jun 2013 16:44:17 +0000 (16:44 +0000)]
Clean up swapfile memory disk on shutdown

Make the md unit number configurable so that it can be predicted

PR: bin/168544
Submitted by: wblock (based on)
Approved by: kevlo

11 years agoUse CAM_DIR_NONE for requests without data.
mav [Wed, 12 Jun 2013 16:13:05 +0000 (16:13 +0000)]
Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.

MFC after: 1 week

11 years agoTurn DIAGNOSTICs to INVARIANTS in ext2fs.
pfg [Wed, 12 Jun 2013 15:24:48 +0000 (15:24 +0000)]
Turn DIAGNOSTICs to INVARIANTS in ext2fs.

This is done to be consistent with what other filesystems and
particularly ffs already does (see r173464).

MFC after: 5 days

11 years agoTie in the LNA diversity configuration functions into the HAL.
adrian [Wed, 12 Jun 2013 15:23:17 +0000 (15:23 +0000)]
Tie in the LNA diversity configuration functions into the HAL.

11 years agoSet the antenna "config group" field.
adrian [Wed, 12 Jun 2013 15:18:10 +0000 (15:18 +0000)]
Set the antenna "config group" field.

The reference HAL pushes a config group parameter to the driver layer
to inform it which particular chip behaviour to implement.

This particular value tags it as an AR9285.

11 years agoMigrate the LNA mixing diversity machinery from the AR9285 HAL to the driver.
adrian [Wed, 12 Jun 2013 14:52:57 +0000 (14:52 +0000)]
Migrate the LNA mixing diversity machinery from the AR9285 HAL to the driver.

The AR9485 chip and AR933x SoC both implement LNA diversity.
There are a few extra things that need to happen before this can be
flipped on for those chips (mostly to do with setting up the different
bias values and LNA1/LNA2 RSSI differences) but the first stage is
putting this code into the driver layer so it can be reused.

This has the added benefit of making it easier to expose configuration
options and diagnostic information via the ioctl API.  That's not yet
being done but it sure would be nice to do so.

Tested:

* AR9285, with LNA diversity enabled
* AR9285, with LNA diversity disabled in EEPROM

11 years agoMake CAM return and GEOM DISK pass through new GEOM::lunid attribute.
mav [Wed, 12 Jun 2013 13:36:20 +0000 (13:36 +0000)]
Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.

SPC-4 specification states that serial number may be property of device,
but not a specific logical unit.  People reported about FC storages using
serial number in that way, making it unusable for purposes of LUN multipath
detection.  SPC-4 states that designators associated with logical unit from
the VPD page 83h "Device Identification" should be used for that purpose.
Report first of them in the new attribute in such preference order: NAA,
EUI-64, T10 and SCSI name string.

While there, make GEOM DISK properly report GEOM::ident in XML output also
using d_getattr() method, if available.  This fixes serial numbers reporting
for SCSI disks in `geom disk list` output and confxml.

Discussed with: gibbs, ken
Sponsored by: iXsystems, Inc.
MFC after: 2 weeks

11 years agoAdd new script to run release builds. The script is heavily based upon
gjb [Wed, 12 Jun 2013 13:15:28 +0000 (13:15 +0000)]
Add new script to run release builds.  The script is heavily based upon
the release/generate-release.sh script by nwhitehorn.

This script can use optional configuration file to override defaults,
making running multiple serialzied builds with different specific
configurations or architecture-specific tunings quite easy.

Sample overrideable options are included in the release.conf.sample
file.

Approved by: kib (mentor)
MFC After: 2 weeks
X-MFC-To: stable/9 only

11 years agoUse direct custom implementations instead of g_handleattr() for CFI and NAND
mav [Wed, 12 Jun 2013 12:51:43 +0000 (12:51 +0000)]
Use direct custom implementations instead of g_handleattr() for CFI and NAND
d_getattr().  Since these drivers use disk(9) KPI and not directly GEOM, use
of that function means KPI layering violation, causing extra g_io_deliver()
call for the request.

11 years agoAdd missing copyright notice.
nwhitehorn [Wed, 12 Jun 2013 12:38:12 +0000 (12:38 +0000)]
Add missing copyright notice.

11 years agoAcquire periph reference when handling d_getattr() method call.
mav [Wed, 12 Jun 2013 09:07:15 +0000 (09:07 +0000)]
Acquire periph reference when handling d_getattr() method call.

While GEOM in general has provider opened while sending BIO_GETATTR,
GEOM DISK does not really need to open disk to read medium-unrelated
attributes for own use.

Proposed by: ken

11 years agostyle(9)
grog [Wed, 12 Jun 2013 07:53:59 +0000 (07:53 +0000)]
style(9)

MFC after: 2 weeks