]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agomsecs_to_jiffies() is implemented using tvtohz(9), which always returns a
markj [Sun, 10 May 2015 22:21:00 +0000 (22:21 +0000)]
msecs_to_jiffies() is implemented using tvtohz(9), which always returns a
positive value since it adds the current tick to its result. This differs
from the behaviour in Linux, whose implementation does not add the extra
tick, so subtract the extra tick in the OFED compat layer implementation.
This addresses some incorrect handling of IB MAD timeouts, since some IB
code depends on msecs_to_jiffies(0) returning 0.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoPrepare for supporting driver-overridden curchan when submitting scan
adrian [Sun, 10 May 2015 22:07:53 +0000 (22:07 +0000)]
Prepare for supporting driver-overridden curchan when submitting scan
results.

Right now the scan infrastructure assumes the channel is under net80211
control, and that when receiving beacon frames for scanning, the
current channel is indeed what ic_curchan is set to.

But firmware NICs with firmware scan support need more than this -
they can do background scans whilst hiding the off-channel behaviour
from net80211.  Ie, net80211 still thinks everything is associated
and on the main channel, but it's getting scan results from all the
background traffic.

However sta_add() pays attention to ic_curchan and discards scan
results that aren't on the right channel.  CCK beacon frames can be
decoded from adjacent channels so the receive path and sta_add
discard these as appropriate.  This is fine for software scanning
like for ath(4), but not for firmware NICs.  So with those, the
whole concept of background firmware scanning won't work without
major hacks (eg, overriding ic_curchan before calling the beacon
input / scan add.)

As part of my scan overhaul, modify sta_add() and the scan_add()
APIs to take an explicit current channel.  The normal RX path
will set it to ic_curchan so it's a no-op.  However, drivers may
decide to (eventually!) override the scan method to set the
"right" current channel based on what the firmware reports the
scan state is.

So for example, iwn, rsu and other NICs will eventually do this:

* driver issues scan start firmware command;
* firmware sends a "scan start on channel X" notify;
* firmware sends a bunch of beacon RX's as part of
  the scan results;
* .. and the driver will replace scan_add() curchan with channel X,
  so scan results are correct.
* firmware sends a "scan start on channel Y" notify;
* firmware sends more beacons...
* .. the driver replaces scan_add() curchan with channel Y.

Note:

* Eventually, net80211 should eventually grow the idea of a per-packet
  current channel.  It's possible in various modes (eg WAVE, P2P, etc)
  that individual frames can come in from different channels and that
  is under firmware control rather than driver/net80211 control, so
  we should support that.

9 years agofind_next_bit() and find_next_zero_bit(): if the caller-specified offset
markj [Sun, 10 May 2015 22:04:42 +0000 (22:04 +0000)]
find_next_bit() and find_next_zero_bit(): if the caller-specified offset
lies within the last block of the bit set and no bits are set beyond the
offset, terminate the search immediately instead of continuing as though
there are further blocks in the set and subsequently returning an incorrect
result.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoMerge bmake-20150505 improve detection of malformed conditionals.
sjg [Sun, 10 May 2015 22:03:59 +0000 (22:03 +0000)]
Merge bmake-20150505 improve detection of malformed conditionals.

9 years agoctf_add_type(): when looking up an integer or floating point type in the
markj [Sun, 10 May 2015 21:39:24 +0000 (21:39 +0000)]
ctf_add_type(): when looking up an integer or floating point type in the
list of pending dynamic type definitions, a match on the type name is not
sufficient - we need to compare the type encodings as well. For example,
bitfields have their own distinct type definitions which share the name of
the underlying integer type, and these types aren't generally
interchangeable.

This bug was causing the following libdtrace error when attempting to trace
the th_flags member of a struct tcphdr:
  cg: bad field: off 104 type <32877> bits 539620016

Reported by: rwatson
MFC after: 3 weeks

9 years agoUnbreak build following rev. 282726
thomas [Sun, 10 May 2015 21:21:52 +0000 (21:21 +0000)]
Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas

9 years agoFix typo introduced in previous commit.
adrian [Sun, 10 May 2015 21:05:32 +0000 (21:05 +0000)]
Fix typo introduced in previous commit.

PR: kern/199632
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agosynaptics: more support for semi-MT trackpads.
rpaulo [Sun, 10 May 2015 20:36:57 +0000 (20:36 +0000)]
synaptics: more support for semi-MT trackpads.

Several improvements to the Synaptics driver to support
semi-multitouch trackpads and some other fixes:

- Two finger scrolling support for "semi-MT" touchpads. Those include
many of the older Synaptics touchpads before "true" multitouch support
(indicated by capMultiFinger). Semi-MT touchpads can report a second
finger position, but the X or Y coordinate may be swapped with some
coordinate of the first finger. This is a result of how the hardware
works internally. Therefore, all that can be reliably extracted is the
bounding box of the two finger positions. Semi-MT touchpads can be
recognized by the capAdvancedGestures capability bit. After setting the
mode byte, advanced gestures mode has to be enabled. Then, data packets
compatible with the capMultiFinger format are sent, so the same two
finger scrolling code can be leveraged. Enabling advanced gestures mode
on true multitouch touchpads should be harmless. Linux seems to always
enable advanced gestures mode.

- Put mode setting logic into own functions synaptics_preferred_mode()
and synaptics_set_mode() to have this in one place.
synaptics_passthrough_on() and synaptics_passthrough_off() currently
always use 0xc1 as the mode byte, which may be wrong for touchpads that
don't have capExtended.

- Expose X and Y resolution of touchpad to userland. Also expose minimum
and maximum X and Y coordinates. This is useful for programs in
userspace that read raw PSM packets (with PSM_LEVEL_NATIVE enabled) and
need to interpret the coordinates.

- Also send "extended w mode" packets (see section 3.2.9 of
511-000275-01_RevB.pdf) to userspace if PSM_LEVEL_NATIVE is enabled.
This is useful for userspace programs/drivers such as
xf86-input-synaptics that can handle these packets.

- Fix parsing of nExtendedQueries, and request extended/continued
capability bits depending on this value.

- capReportsMax, capClearPad, capAdvancedGestures and capCoveredPad must
be extracted from status[0] and not status[2], I think.

Submitted by: Jan Kokemüller jan.kokemueller at gmail.com

9 years agoTag bmake-20150505
sjg [Sun, 10 May 2015 20:02:26 +0000 (20:02 +0000)]
Tag bmake-20150505

9 years agoImport bmake-20150505 detect typo's in .if variable references.
sjg [Sun, 10 May 2015 20:01:54 +0000 (20:01 +0000)]
Import bmake-20150505 detect typo's in .if variable references.

9 years agoCreate a relocatable instance of ubldr for ARM. The original ubldr,
ian [Sun, 10 May 2015 19:14:28 +0000 (19:14 +0000)]
Create a relocatable instance of ubldr for ARM.  The original ubldr,
static-linked to run at a fixed position, is still installed to maintain
compatibility with existing configurations.  The makefile now also creates
and installs ubldr.bin, a stripped binary (no elf headers) with an entry
point offset of 0 that can be loaded by u-boot at any address and launched
with "go ${loadaddr}".

To use ubldr.bin, U-Boot must still be built with the CONFIG_API option,
but no longer needs the CONFIG_ELF option.

9 years agoEnsure the result from signed subtraction under modulus does not
hselasky [Sun, 10 May 2015 17:11:04 +0000 (17:11 +0000)]
Ensure the result from signed subtraction under modulus does not
become negative.

Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
MFC after: 3 days

9 years agorecv(),send(): Directly call interposing entry instead of going through PLT.
jilles [Sun, 10 May 2015 14:50:50 +0000 (14:50 +0000)]
recv(),send(): Directly call interposing entry instead of going through PLT.

recv() and send()'s calls to recvfrom() and sendto() are much like
waitpid()'s call to wait4(), and likewise need not allow PLT interposing on
the called function.

9 years agoDon't check the return value from self_reloc(), it can't fail and doesn't
ian [Sun, 10 May 2015 13:30:21 +0000 (13:30 +0000)]
Don't check the return value from self_reloc(), it can't fail and doesn't
return a value.

Despite what I said in my prior commit, it turns out this one platform
was checking the return value from the old self-reloc code (which returned
a hard-coded 0).

9 years agoThe self-relocation code is not efi-specific, move it to boot/common.
ian [Sun, 10 May 2015 13:24:26 +0000 (13:24 +0000)]
The self-relocation code is not efi-specific, move it to boot/common.

The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision: https://reviews.freebsd.org/D2490

9 years agoEnsure libmd symbols do not clash with libcrypto
thomas [Sun, 10 May 2015 13:21:36 +0000 (13:21 +0000)]
Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR: 199119
Differential Revision: D2216
Reviewed by: roberto, delphij
MFC after: 2 weeks

9 years agoPut recycle pointer in own memory area which is not mmap'able.
hselasky [Sun, 10 May 2015 12:45:21 +0000 (12:45 +0000)]
Put recycle pointer in own memory area which is not mmap'able.

9 years agoUse the new gic option on all configs that need it.
andrew [Sun, 10 May 2015 12:13:27 +0000 (12:13 +0000)]
Use the new gic option on all configs that need it.

9 years agoFor half and reverse line feeds, recognize both SUSv2-style escape-digit
bapt [Sun, 10 May 2015 11:41:38 +0000 (11:41 +0000)]
For half and reverse line feeds, recognize both SUSv2-style escape-digit
and BSD-style escape-control-char sequences in the input stream.

Submitted by: schwarze at OpenBSD
Discussed with: schwarze at OpenBSD
Obtained from: OpenBSD

9 years agoRemove extendline definition
bapt [Sun, 10 May 2015 11:24:16 +0000 (11:24 +0000)]
Remove extendline definition
Remove now unused PWBUFSZ define

9 years agoUse calloc(3) instead of malloc(3) + memset(3)
bapt [Sun, 10 May 2015 11:18:01 +0000 (11:18 +0000)]
Use calloc(3) instead of malloc(3) + memset(3)
While here check the return of calloc(3)

9 years agoThe initial logic for allocating the new string was wrong, the conversion
bapt [Sun, 10 May 2015 10:15:36 +0000 (10:15 +0000)]
The initial logic for allocating the new string was wrong, the conversion
to strndup(3) duplicated the same mistake, actually strdup(3) is good enough
to allocate the new string.

9 years agoUse strndup(3) instead of malloc(3) + memcpy(3)
bapt [Sun, 10 May 2015 10:02:09 +0000 (10:02 +0000)]
Use strndup(3) instead of malloc(3) + memcpy(3)
Check the return of strndup

9 years agoUse the new gic option. While here remove extra whitespace from the ned of
andrew [Sun, 10 May 2015 09:37:54 +0000 (09:37 +0000)]
Use the new gic option. While here remove extra whitespace from the ned of
a few lines.

9 years agoRemove useless call to extendarray
bapt [Sun, 10 May 2015 09:33:15 +0000 (09:33 +0000)]
Remove useless call to extendarray

9 years agoAdd the gic to files.arm under "device gic" and use it with the
andrew [Sun, 10 May 2015 09:33:03 +0000 (09:33 +0000)]
Add the gic to files.arm under "device gic" and use it with the
CUBIEBOARD2 config. This is common across a few SoCs so should be a common
option.

9 years agoFirst pass clenup over the Marvell db-88f6xxx kernel configs.
andrew [Sun, 10 May 2015 09:23:49 +0000 (09:23 +0000)]
First pass clenup over the Marvell db-88f6xxx kernel configs.

9 years agoThe pwdb function is only used once to check the database rename it
bapt [Sun, 10 May 2015 09:23:03 +0000 (09:23 +0000)]
The pwdb function is only used once to check the database rename it
pwdb_check and simplify it accordingly

9 years agoif the check of the pw db fails return the failed value
bapt [Sun, 10 May 2015 09:11:12 +0000 (09:11 +0000)]
if the check of the pw db fails return the failed value

9 years agoInitialize pcids array for the proc0 pmap.
kib [Sun, 10 May 2015 09:09:07 +0000 (09:09 +0000)]
Initialize pcids array for the proc0 pmap.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoTweak assert to also print the thread address.
kib [Sun, 10 May 2015 09:05:57 +0000 (09:05 +0000)]
Tweak assert to also print the thread address.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoSome style(9) fixes
bapt [Sun, 10 May 2015 09:02:15 +0000 (09:02 +0000)]
Some style(9) fixes

9 years agoOn exec, single-threading must be enforced before arguments space is
kib [Sun, 10 May 2015 09:00:40 +0000 (09:00 +0000)]
On exec, single-threading must be enforced before arguments space is
allocated from exec_map.  If many threads try to perform execve(2) in
parallel, the exec map is exhausted and some threads sleep
uninterruptible waiting for the map space.  Then, the thread which won
the race for the space allocation, cannot single-thread the process,
causing deadlock.

Reported and tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoClean up the style to use "options<space><tab>".
andrew [Sun, 10 May 2015 08:48:00 +0000 (08:48 +0000)]
Clean up the style to use "options<space><tab>".

9 years agoSatisfy vm_object uma zone destructor requirements after r282660 when
kib [Sun, 10 May 2015 08:21:03 +0000 (08:21 +0000)]
Satisfy vm_object uma zone destructor requirements after r282660 when
vnode object creation raced.

Reported by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation

9 years agoTurn ieee80211_start_scan_locked() into a swscan module private method.
adrian [Sun, 10 May 2015 06:59:34 +0000 (06:59 +0000)]
Turn ieee80211_start_scan_locked() into a swscan module private method.

It turns out that ieee80211_start_scan_locked() is only ever called by
the swscan code and it won't likely be required by firmware scanning
implementations.

So, don't bother keeping it in ieee80211_scan.c and it likely won't
become an API call.

Tested:

* Intel 5100, STA mode
* AR5416, STA mode

9 years agoAttempt to address Bug #176201 - don't advertise what the AP announced
adrian [Sun, 10 May 2015 06:57:53 +0000 (06:57 +0000)]
Attempt to address Bug #176201 - don't advertise what the AP announced
to us. Instead, advertise what we can do based on what the AP says and what
we're capped at by the VAP settings.

For non-STA modes we still advertise what our VAP settings are.

It may be that I've over-complicated this and instead of capping things
we can just always announce what we're capable of.  But this should at least
stop the blatantly wrong handling of A-MPDU parameters.

(I'll happily simplify things if someone can dig up a replacement, better
compliant behaviour.)

PR: kern/176201

9 years agoFix a couple bugs in 64-bit powerpc fasttrap argument retrieval.
jhibbits [Sun, 10 May 2015 04:33:01 +0000 (04:33 +0000)]
Fix a couple bugs in 64-bit powerpc fasttrap argument retrieval.

Found by code inspection.

9 years agoRemove unnecessary code and make use of generic implementations for
loos [Sun, 10 May 2015 02:19:27 +0000 (02:19 +0000)]
Remove unnecessary code and make use of generic implementations for
bus_alloc_resource(), bus_release_resource() and bus_set_resource()
(bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and
bus_generic_rl_set_resource() respectively).

Do not print the resources for nomatch devices.

Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.

Submitted by: jhb and Michal Meloun (D2033)

9 years agoReplace sprintf(3) with snprintf(3)
bapt [Sat, 9 May 2015 22:48:48 +0000 (22:48 +0000)]
Replace sprintf(3) with snprintf(3)

9 years agoUse snprintf(3) instead of sprintf(3)
bapt [Sat, 9 May 2015 22:43:44 +0000 (22:43 +0000)]
Use snprintf(3) instead of sprintf(3)
Remove useless "else"

9 years agoRemove now unused LNBUFSZ buffer size
bapt [Sat, 9 May 2015 22:08:30 +0000 (22:08 +0000)]
Remove now unused LNBUFSZ buffer size

9 years agoReturn from the function as early as possible
bapt [Sat, 9 May 2015 21:53:33 +0000 (21:53 +0000)]
Return from the function as early as possible

This reduces the depth of the if statements and improves clarity of the code

9 years agoCorrect the assertion. We should compare the pmap' curcpu pcid value
kib [Sat, 9 May 2015 21:36:44 +0000 (21:36 +0000)]
Correct the assertion.  We should compare the pmap' curcpu pcid value
against 0, not the pmap.

Noted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoPass over the at91 kernels to reduce the diff between them.
andrew [Sat, 9 May 2015 21:24:55 +0000 (21:24 +0000)]
Pass over the at91 kernels to reduce the diff between them.

9 years agoMerge ^/projects/release-arm-redux into ^/head.
gjb [Sat, 9 May 2015 21:08:12 +0000 (21:08 +0000)]
Merge ^/projects/release-arm-redux into ^/head.

Of note:

- This commit adds native FreeBSD/arm release build support without
  requiring out-of-tree utilities.

- Part of this merge removes the WANDBOARD-{SOLO,DUAL,QUAD} kernel
  configuration files, for which the IMX6 kernel configuration file
  should be used instead.

- The resulting images have a 'freebsd' user (password 'freebsd'),
  to allow ssh(1) access when console access is not available (VGA
  or serial).  The default 'root' user password is set to 'root'.

- The /etc/ttys file for arm images now enable both ttyv0 and ttyu0
  by default.

Help from: many (boot testing, feedback, etc.)
Sponsored by: The FreeBSD Foundation

9 years agoThe vmem callback to reclaim kmem arena address space on low or
kib [Sat, 9 May 2015 20:08:36 +0000 (20:08 +0000)]
The vmem callback to reclaim kmem arena address space on low or
fragmented conditions currently just wakes up the pagedaemon.  The
kmem arena is significantly smaller then the total available physical
memory, which means that there are loads where kmem arena space could
be exhausted, while there is a lot of pages available still.  The
woken up pagedaemon sees vm_pages_needed != 0, verifies the condition
vm_paging_needed() which is false, clears the pass and returns back to
sleep, not calling neither uma_reclaim() nor lowmem handler.

To handle low kmem arena conditions, create additional pagedaemon
thread which calls uma_reclaim() directly.  The thread sleeps on the
dedicated channel and kmem_reclaim() wakes the thread in addition to
the pagedaemon.

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

9 years agoRemove some uneeded headers
bapt [Sat, 9 May 2015 19:29:55 +0000 (19:29 +0000)]
Remove some uneeded headers

9 years agoRemove unneeded headers
bapt [Sat, 9 May 2015 19:22:33 +0000 (19:22 +0000)]
Remove unneeded headers

9 years agoReplace malloc(3) + strcpy(3) + strcat(3) by asprintf(3)
bapt [Sat, 9 May 2015 19:12:16 +0000 (19:12 +0000)]
Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3)

9 years agoRewrite amd64 PCID implementation to follow an algorithm described in
kib [Sat, 9 May 2015 19:11:01 +0000 (19:11 +0000)]
Rewrite amd64 PCID implementation to follow an algorithm described in
the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency
Algorithms".  The same algorithm is already utilized by the MIPS pmap
to handle ASIDs.

The PCID for the address space is now allocated per-cpu during context
switch to the thread using pmap, when no PCID on the cpu was ever
allocated, or the current PCID is invalidated.  If the PCID is reused,
bit 63 of %cr3 can be set to avoid TLB flush.

Each cpu has PCID' algorithm generation count, which is saved in the
pmap pcpu block when pcpu PCID is allocated.  On invalidation, the
pmap generation count is zeroed, which signals the context switch code
that already allocated PCID is no longer valid.  The implication is
the TLB shootdown for the given cpu/address space, due to the
allocation of new PCID.

The pm_save mask is no longer has to be tracked, which (significantly)
reduces the targets of the TLB shootdown IPIs.  Previously, pm_save
was reset only on pmap_invalidate_all(), which made it accumulate the
cpuids of all processors on which the thread was scheduled between
full TLB shootdowns.

Besides reducing the amount of TLB shootdowns and removing atomics to
update pm_saves in the context switch code, the algorithm is much
simpler than the maintanence of pm_save and selection of the right
address space in the shootdown IPI handler.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoUse snprintf(3) instead of strcpy(3) + strncat(3)
bapt [Sat, 9 May 2015 19:09:34 +0000 (19:09 +0000)]
Use snprintf(3) instead of strcpy(3) + strncat(3)

9 years agoUse sbuf(9) instead of homebrewed buffered string
bapt [Sat, 9 May 2015 19:00:16 +0000 (19:00 +0000)]
Use sbuf(9) instead of homebrewed buffered string

9 years agoRemove unused define.
kib [Sat, 9 May 2015 18:38:35 +0000 (18:38 +0000)]
Remove unused define.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoDo not return from thread_single(SINGLE_BOUNDARY) until all stopped
kib [Sat, 9 May 2015 18:32:13 +0000 (18:32 +0000)]
Do not return from thread_single(SINGLE_BOUNDARY) until all stopped
thread are guarenteed to be removed from the processors.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoIf x86 CPU implementation of the MWAIT instruction reasonably
kib [Sat, 9 May 2015 12:28:48 +0000 (12:28 +0000)]
If x86 CPU implementation of the MWAIT instruction reasonably
interacts with interrupts, query ACPI and use MWAIT for entrance into
Cx sleep states.  Support C1 "I/O then halt" mode.  See Intel'
document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface
Specification" for description.

Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use
it instead of inlining "sti; hlt" sequence in several places.

In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods
sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported}
sysctls.

Both jkim and avg have some other patches implementing the mwait
functionality; this work is unrelated.  Linux does not rely on the
ACPI to provide correct tables describing Cx modes.  Instead, the
driver has pre-defined knowledge of the CPU models, it was supplied by
Intel.

Tested by:    pho (previous versions)
Sponsored by: The FreeBSD Foundation

9 years agoConvert remaining hwpmc(4) debug printfs over to KTR to unbreak the build
bz [Sat, 9 May 2015 09:21:59 +0000 (09:21 +0000)]
Convert remaining hwpmc(4) debug printfs over to KTR to unbreak the build
for at least powerpc kernels.   Missed in r282658.

MFC after: 10 days

9 years agoPass the resources requests to the upper bus.
loos [Sat, 9 May 2015 03:39:18 +0000 (03:39 +0000)]
Pass the resources requests to the upper bus.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agoHandle IRQ resources on iicbus and ofw_iicbus.
loos [Sat, 9 May 2015 03:05:44 +0000 (03:05 +0000)]
Handle IRQ resources on iicbus and ofw_iicbus.

Based on a patch submitted by Michal Meloun <meloun@miracle.cz>.

9 years agoFix the double space in comment.
stas [Sat, 9 May 2015 00:48:44 +0000 (00:48 +0000)]
Fix the double space in comment.

While here, change the comment style to match the rest of the file.

9 years agoAlways convert uuid to lower case.
delphij [Fri, 8 May 2015 23:36:31 +0000 (23:36 +0000)]
Always convert uuid to lower case.

MFC after: 2 weeks

9 years agoFix about ten integer overflows and underflows and a handful of logic
bapt [Fri, 8 May 2015 22:11:54 +0000 (22:11 +0000)]
Fix about ten integer overflows and underflows and a handful of logic
errors in line number handling.

Submitted by: ingo at OpenBSD
Discussed with: ingo at OpenBSD
Obtained from: OpenBSD

9 years agoReplace spaces with tabs, removes an extra blank line.
loos [Fri, 8 May 2015 21:51:37 +0000 (21:51 +0000)]
Replace spaces with tabs, removes an extra blank line.

No functional changes.

9 years agoMove the text section to the start of the output file, so that when you
ian [Fri, 8 May 2015 19:43:53 +0000 (19:43 +0000)]
Move the text section to the start of the output file, so that when you
create a stripped .bin file from it the entry point is the first byte of
the file.  (Will allow "load $addr $file ; go $addr" in u-boot.)

9 years agoPlace VM objects on the object list when created and never remove them.
jhb [Fri, 8 May 2015 19:43:37 +0000 (19:43 +0000)]
Place VM objects on the object list when created and never remove them.
This is ok since objects come from a NOFREE zone and allows objects to
be locked while traversing the object list without triggering a LOR.

Ensure that objects on the list are marked DEAD while free or stillborn,
and that they have a refcount of zero.  This required updating most of
the pagers to explicitly mark an object as dead when deallocating it.
(Only the vnode pager did this previously.)

Differential Revision: https://reviews.freebsd.org/D2423
Reviewed by: alc, kib (earlier version)
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.

9 years agoConvert hwpmc(4) debug printfs over to KTR.
jhb [Fri, 8 May 2015 19:40:00 +0000 (19:40 +0000)]
Convert hwpmc(4) debug printfs over to KTR.

Differential Revision: https://reviews.freebsd.org/D2487
Reviewed by: davide, emaste
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.

9 years agoUse the IMX6 kernel configuration for the WANDBOARD build,
gjb [Fri, 8 May 2015 18:55:09 +0000 (18:55 +0000)]
Use the IMX6 kernel configuration for the WANDBOARD build,
since it supports all of these board variants.

While here, remove the WANDBOARD-{QUAD,SOLO,DUAL} kernel
configuration files.

Discussed with: ian
Sponsored by: The FreeBSD Foundation

9 years agoPort x86 busdma to ARM64
zbb [Fri, 8 May 2015 18:47:19 +0000 (18:47 +0000)]
Port x86 busdma to ARM64

The x86 busdma subsystem allows using multiple implementations.
By default the classic bounce buffer approach is used, however
on systems with IOMMU it could be in runtime switched to more
efficient hardware accelerated implementation.

This commit adds ARM64 port of the x86 busdma framework and bounce
buffer backend. It is ready to use on IO coherent systems. If the
IO coherency cannot be guaranteed, the cache management operations have
to be added to this code in places marked by /* XXX ARM64TODO (...) */
comments. Also IOMMU support might be added by registering another
busdma implementation like it is already done on the x86.

Reviewed by:   andrew, emaste
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation

9 years agoStrip the KERNEL from the mount paths, working around the following
gjb [Fri, 8 May 2015 18:45:32 +0000 (18:45 +0000)]
Strip the KERNEL from the mount paths, working around the following
error:

 root@releng2:/ # mount_msdosfs /dev/md5s1 /usr/obj/usr/src/release/WANDBOARD-QUAD/fat
 mount_msdosfs: /dev/md5s1: File name too long

Sponsored by: The FreeBSD Foundation

9 years agoFix path to the u-boot.imx file, which is relative to the root of
gjb [Fri, 8 May 2015 17:53:44 +0000 (17:53 +0000)]
Fix path to the u-boot.imx file, which is relative to the root of
the chroot environment.

Sponsored by: The FreeBSD Foundation

9 years agoEnsure the USB audio driver doesn't attach twice on the same USB
hselasky [Fri, 8 May 2015 17:48:48 +0000 (17:48 +0000)]
Ensure the USB audio driver doesn't attach twice on the same USB
device by grabbing all the USB audio device interfaces.

MFC after: 1 week

9 years agoAdd support for more than 8 audio channels per PCM stream for USB
hselasky [Fri, 8 May 2015 17:07:11 +0000 (17:07 +0000)]
Add support for more than 8 audio channels per PCM stream for USB
audio class compliant devices under FreeBSD. Tested using 16 recording
and 16 playback audio channels simultaneously.

MFC after: 2 weeks

9 years agoExtend the maximum number of allowed PCM channels in a PCM stream to
hselasky [Fri, 8 May 2015 17:00:33 +0000 (17:00 +0000)]
Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These
definitions are only used inside the kernel and can be changed later
if more than one sub-channel is desired. This has been done to allow
so-called USB audio rack modules to work with FreeBSD.

Bump the FreeBSD version to force recompiling all external modules.

MFC after: 2 weeks
Reviewed by: mav

9 years agoFix spelling of INTERNALLIBS
bdrewery [Fri, 8 May 2015 16:43:01 +0000 (16:43 +0000)]
Fix spelling of INTERNALLIBS

9 years agoTouch '/firstboot' so the growfs rc(8) script runs.
gjb [Fri, 8 May 2015 16:41:21 +0000 (16:41 +0000)]
Touch '/firstboot' so the growfs rc(8) script runs.

Sponsored by: The FreeBSD Foundation

9 years agoFix the starting block of the partition.
gjb [Fri, 8 May 2015 16:37:57 +0000 (16:37 +0000)]
Fix the starting block of the partition.

Sponsored by: The FreeBSD Foundation

9 years agoThe "SYSCTL_INT()" default value is only used for read only SYSCTLs
hselasky [Fri, 8 May 2015 16:37:40 +0000 (16:37 +0000)]
The "SYSCTL_INT()" default value is only used for read only SYSCTLs
and is not applicable unless the integer pointer is NULL. Set it to
zero to avoid confusion. While at it remove extra semicolon at the end
of the "VT_SYSCTL_INT()" macro.

MFC after: 1 week

9 years agoPrevent switching to NULL or own window in the "vt_proc_window_switch"
hselasky [Fri, 8 May 2015 16:19:01 +0000 (16:19 +0000)]
Prevent switching to NULL or own window in the "vt_proc_window_switch"
function. This fixes an issue where X11 keyboard input can appear
stuck. The cause of the problem is a duplicate TTY device window
switch IOCTL during boot, which leaves the "vt_switch_timer" running,
because the current window is already selected. While at it factor out
some NULL checks.

PR: 200032
Differential Revision: https://reviews.freebsd.org/D2480
Reported by: several people
MFC after: 1 week
Reviewed by: emaste

9 years agoUse the kern.bootfile sysctl to set the default kernel path rather than
jhb [Fri, 8 May 2015 16:02:31 +0000 (16:02 +0000)]
Use the kern.bootfile sysctl to set the default kernel path rather than
hardcoding /boot/kernel. This allows pmcstat(8) to work without -k when
using nextboot -k or 'boot foo' at the loader to boot alternate kernels.

Differential Revision: https://reviews.freebsd.org/D2425
Reviewed by: adrian, emaste, gnn
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.

9 years agoInitial support for building the PANDABOARD image.
gjb [Fri, 8 May 2015 16:00:06 +0000 (16:00 +0000)]
Initial support for building the PANDABOARD image.

Sponsored by: The FreeBSD Foundation

9 years agoMove hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
jhb [Fri, 8 May 2015 15:57:23 +0000 (15:57 +0000)]
Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
the broader DEBUG option.

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.

9 years agoAdd a file missed in the previous commit.
gjb [Fri, 8 May 2015 15:23:21 +0000 (15:23 +0000)]
Add a file missed in the previous commit.

Sponsored by: The FreeBSD Foundation

9 years agoCopy arm/WANDBOARD-QUAD.conf to arm/WANDBOARD-{SOLO,DUAL}.conf.
gjb [Fri, 8 May 2015 15:22:29 +0000 (15:22 +0000)]
Copy arm/WANDBOARD-QUAD.conf to arm/WANDBOARD-{SOLO,DUAL}.conf.
Ian informed me a few months ago that the WANDBOARD-* kernels will
eventually be combined into one that will work across all these
boards, but for now, build them individually.

Sponsored by: The FreeBSD Foundation

9 years agoFix FAT partition size.
gjb [Fri, 8 May 2015 15:18:31 +0000 (15:18 +0000)]
Fix FAT partition size.

Sponsored by: The FreeBSD Foundation

9 years agoSigh. Really fix CHECKSUM file creation.
gjb [Fri, 8 May 2015 15:15:36 +0000 (15:15 +0000)]
Sigh.  Really fix CHECKSUM file creation.

Sponsored by: The FreeBSD Foundation

9 years agoFix CHECKSUM file creation.
gjb [Fri, 8 May 2015 15:10:00 +0000 (15:10 +0000)]
Fix CHECKSUM file creation.

Sponsored by: The FreeBSD Foundation

9 years agoInitial support for building WANDBOARD-QUAD images.
gjb [Fri, 8 May 2015 15:07:17 +0000 (15:07 +0000)]
Initial support for building WANDBOARD-QUAD images.

Several parts of this were obtained from Crochet.

Sponsored by: The FreeBSD Foundation

9 years agoxen: introduce a newbus function to allocate unused memory
royger [Fri, 8 May 2015 14:48:40 +0000 (14:48 +0000)]
xen: introduce a newbus function to allocate unused memory

In order to map memory from other domains when running on Xen FreeBSD uses
unused physical memory regions. Until now this memory has been allocated
using bus_alloc_resource, but this is not completely safe as we can end up
using unreclaimed MMIO or ACPI regions.

Fix this by introducing a new newbus method that can be used by Xen drivers
to request for unused memory regions. On amd64 we make sure this memory
comes from regions above 4GB in order to prevent clashes with MMIO/ACPI
regions. On i386 there's nothing we can do, so just fall back to the
previous mechanism.

Sponsored by: Citrix Systems R&D
Tested by: Gustau Pérez <gperez@entel.upc.edu>

9 years agoEnable ttyv0 and ttyu0 by default if they are available
gjb [Fri, 8 May 2015 14:13:19 +0000 (14:13 +0000)]
Enable ttyv0 and ttyu0 by default if they are available
consoles.

Tested on: RPI-B
Sponsored by: The FreeBSD Foundation

9 years agoMFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic
avg [Fri, 8 May 2015 14:03:14 +0000 (14:03 +0000)]
MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic

MFC after: 5 days

9 years agoInitial commit to support building RPI2 images, based on information
gjb [Fri, 8 May 2015 13:55:27 +0000 (13:55 +0000)]
Initial commit to support building RPI2 images, based on information
and documentation written by loos@ on the Wiki.

Sponsored by: The FreeBSD Foundation

9 years agoDo not include '/R' in the path when generating checksums, since
gjb [Fri, 8 May 2015 12:55:25 +0000 (12:55 +0000)]
Do not include '/R' in the path when generating checksums, since
that will cause '/R' to be included in the CHECKSUM files.

Sponsored by: The FreeBSD Foundation

9 years agoMove the finished image build to the '/R' directory (the
gjb [Fri, 8 May 2015 12:50:48 +0000 (12:50 +0000)]
Move the finished image build to the '/R' directory (the
standard 'install' location for other architectures), then
compress the image with xz(1), and generate the CHECKSUM
files.

Sponsored by: The FreeBSD Foundation

9 years agoFix the name of the final image.
gjb [Fri, 8 May 2015 10:47:57 +0000 (10:47 +0000)]
Fix the name of the final image.
Sigh.  Thou shalt not commit before coffee.

Sponsored by: The FreeBSD Foundation

9 years agoRename KERNEL.img -> OSRELEASE-KERNEL.img when complete.
gjb [Fri, 8 May 2015 10:43:29 +0000 (10:43 +0000)]
Rename KERNEL.img -> OSRELEASE-KERNEL.img when complete.

Sponsored by: The FreeBSD Foundation

9 years agoDo not create the uenv.txt file for RPI-B. It is not needed.
gjb [Fri, 8 May 2015 10:39:52 +0000 (10:39 +0000)]
Do not create the uenv.txt file for RPI-B.  It is not needed.

Submitted by: ian
Sponsored by: The FreeBSD Foundation

9 years agoFix path to /boot/msdos for the target image.
gjb [Fri, 8 May 2015 10:38:32 +0000 (10:38 +0000)]
Fix path to /boot/msdos for the target image.

Sponsored by: The FreeBSD Foundation

9 years ago- Fix a wrong R92C_USTIME_TSF register definition
kevlo [Fri, 8 May 2015 09:01:00 +0000 (09:01 +0000)]
- Fix a wrong R92C_USTIME_TSF register definition
- Fix intitial transmit rate to an 11g rate for the RTL8188EU
- Add a comment about response rate settings

9 years agooops - how'd i miss this. Sorry!
adrian [Fri, 8 May 2015 06:02:23 +0000 (06:02 +0000)]
oops - how'd i miss this. Sorry!

9 years agoThis follows the gic and ti/aintc code by adding additional barriers to the
ganbold [Fri, 8 May 2015 04:38:01 +0000 (04:38 +0000)]
This follows the gic and ti/aintc code by adding additional barriers to the
Amlogic pic driver.

Differential Revision: https://reviews.freebsd.org/D2472
Submitted by: John Wehle