Commit Graph

181752 Commits

Author SHA1 Message Date
Eitan Adler
1cbff2a999 Remove CVS from the base system.
Discussed with:	many
Reviewed by:	peter, zi
Approved by:	core
2013-06-15 20:29:07 +00:00
Devin Teske
65c7c08716 Style/comments. 2013-06-15 13:38:21 +00:00
Alexander Motin
2f87dfb0db 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.
2013-06-15 12:46:38 +00:00
Andrew Turner
8b02079f36 Build __clear_cache on ARM with clang now it supports it. 2013-06-15 12:16:27 +00:00
Andrew Turner
1f4f127b99 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.
2013-06-15 12:13:22 +00:00
Lawrence Stewart
e6124a8a1a 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
2013-06-15 10:38:31 +00:00
Lawrence Stewart
38f080cb04 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
2013-06-15 10:08:34 +00:00
Ed Schouten
d23f3f67b5 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.
2013-06-15 09:42:43 +00:00
Ed Schouten
2d5add2ae6 Let ARM use the custom tailored atomic intrinsics. 2013-06-15 09:04:10 +00:00
Ed Schouten
eaa3b76d1a 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.
2013-06-15 08:23:53 +00:00
Ed Schouten
1f7e35dce5 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.
2013-06-15 08:21:54 +00:00
Ed Schouten
72790363a3 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.
2013-06-15 08:15:22 +00:00
Lawrence Stewart
933a8bff73 Cleanup and simplification in khelp_{register|deregister}_helper(). No
functional changes.

MFC after:	1 week
2013-06-15 06:45:17 +00:00
Lawrence Stewart
58261d30e1 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
2013-06-15 05:57:29 +00:00
Justin T. Gibbs
127a9483ed 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
2013-06-15 04:51:31 +00:00
Lawrence Stewart
b1f53277ec 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
2013-06-15 04:03:40 +00:00
Bryan Venteicher
b059b01e74 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
2013-06-15 03:55:04 +00:00
Justin T. Gibbs
a8f6ac0573 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)
2013-06-14 23:43:44 +00:00
Eitan Adler
eadc444a0f Fix typo (dbM -> dBm)
Submitted by:	Daan@vitsch.nl
Reviewed by:	adrian
2013-06-14 23:04:31 +00:00
Brooks Davis
c872793d46 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
2013-06-14 22:32:47 +00:00
Jilles Tjoelker
0c35cec686 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.
2013-06-14 22:06:18 +00:00
Dimitry Andric
b6fdb9ab2f 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
2013-06-14 21:14:36 +00:00
Devin Teske
c6f73e3099 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.
2013-06-14 19:35:30 +00:00
Lawrence Stewart
bfe72a58e2 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
2013-06-14 18:11:21 +00:00
Justin T. Gibbs
e2c1fe9009 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
2013-06-14 17:00:58 +00:00
Simon J. Gerraty
d31870574c 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
2013-06-14 16:30:11 +00:00
Simon J. Gerraty
a7e08b461e 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
2013-06-14 16:25:41 +00:00
Simon J. Gerraty
b37be1a5d4 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
2013-06-14 16:24:07 +00:00
Sergey Kandaurov
82f2974a69 Replace cpusetffs_obj with CPU_FFS, missed in r251703.
Reported by:	bdrewery, O. Hartmann
2013-06-14 10:26:38 +00:00
Sergey Kandaurov
0ec5ac100c 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
2013-06-14 08:28:08 +00:00
Alexander Motin
126690fec1 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.
2013-06-14 08:26:58 +00:00
Adrian Chadd
8d6235fb66 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)
2013-06-14 08:18:17 +00:00
Adrian Chadd
8ccb8e813f 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.
2013-06-14 08:15:28 +00:00
Adrian Chadd
429eba61c2 Flip on AH_PRIVATE_DIAG by default; this will include the AR9300 EEPROM
dump code that is worth having around.
2013-06-14 08:13:21 +00:00
Adrian Chadd
67a6ee573d Link the AR9300 EEPROM dump tool into the build. 2013-06-14 08:12:54 +00:00
Adrian Chadd
4c8f505c3f Begin fleshing out an AR9300 EEPROM dump helper utility. 2013-06-14 08:12:40 +00:00
Adrian Chadd
4cfeefe1c7 Add missing formatting strings.
Thanks to: clang
2013-06-14 08:11:45 +00:00
Adrian Chadd
b5ddd8005c Add bluetooth setup method functions to the HAL. 2013-06-14 06:15:23 +00:00
Adrian Chadd
94d5d4ada1 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
2013-06-14 06:14:49 +00:00
Kevin Lo
ebe0102309 - 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
2013-06-14 05:36:47 +00:00
Pyun YongHyeon
4951ca8620 Fix a typo introduced in r213280. IFM_OPTIONS macro should see
current media word.
2013-06-14 05:16:51 +00:00
Lawrence Stewart
601d4c7543 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
2013-06-14 04:10:34 +00:00
Adrian Chadd
0f0eebe793 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
2013-06-14 03:42:10 +00:00
Justin T. Gibbs
d5aeb77948 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
2013-06-14 03:31:11 +00:00
Lawrence Stewart
86241d89a9 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
2013-06-14 02:25:40 +00:00
Mark Johnston
563d463961 The functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}().
MFC after:	3 days
2013-06-14 01:12:59 +00:00
Neel Natu
8f1664b724 Remove unused macros PTESHIFT, PDESHIFT, PDPESHIFT and PML4ESHIFT.
Reviewed by:	alc
2013-06-14 00:03:43 +00:00
Marius Strobl
d5e0798e6d 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
2013-06-13 22:13:41 +00:00
Marius Strobl
d13dfb644a Fix whitespace and normalize some entries. 2013-06-13 21:47:22 +00:00
Andrew Turner
93ef7ecb75 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.
2013-06-13 21:31:33 +00:00