]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoClean up the style of the LEAVE_HYP macro.
Andrew Turner [Mon, 31 Aug 2015 09:39:16 +0000 (09:39 +0000)]
Clean up the style of the LEAVE_HYP macro.

9 years agoAdd new USB quirk.
Hans Petter Selasky [Mon, 31 Aug 2015 07:18:13 +0000 (07:18 +0000)]
Add new USB quirk.

MFC after: 1 week
PR: 202783

9 years ago - uri is expected to be nul-terminated (strchr used later),
Xin LI [Mon, 31 Aug 2015 06:11:39 +0000 (06:11 +0000)]
 - uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after: 2 weeks

9 years agoConstify opt_f and opt_t and eliminate unneeded copying. This fixes
Xin LI [Mon, 31 Aug 2015 05:57:26 +0000 (05:57 +0000)]
Constify opt_f and opt_t and eliminate unneeded copying.  This fixes
memory leaks.

Reported by: clang static analyzer
MFC after: 2 weeks

9 years agoSimplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
Alexander V. Chernikov [Mon, 31 Aug 2015 05:03:36 +0000 (05:03 +0000)]
Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
  alloc handler, based on flags.

9 years agoAdd support for the UGA draw protocol. This includes adding a
Marcel Moolenaar [Sun, 30 Aug 2015 23:58:53 +0000 (23:58 +0000)]
Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

Since UGA does not provide information about the stride, we
set the stride to the horizontal resolution. This is likely
not correct and we should determine the stride by trial and
error. For now, this should show something on the console
rather than nothing.

Refactor this file to maximize code reuse.

PR: 202730

9 years agoAdd the LED definitions from vendor's DTS.
Luiz Otavio O Souza [Sun, 30 Aug 2015 23:20:00 +0000 (23:20 +0000)]
Add the LED definitions from vendor's DTS.

Add gpioled support to A20 kernel.

While here rename the gpio phandle to match the one used in the vendor's
DTS.

9 years agoThe vendor's DTS for Allwinner A20 uses a different way to map the gpio
Luiz Otavio O Souza [Sun, 30 Aug 2015 22:38:06 +0000 (22:38 +0000)]
The vendor's DTS for Allwinner A20 uses a different way to map the gpio
pins, they specify the bank and the pin in two separated cells.

This allow the use of vendor's DTS definitions by adding a gpio map
routine that copes with that.

9 years agooops - mis-commit.
Adrian Chadd [Sun, 30 Aug 2015 21:55:01 +0000 (21:55 +0000)]
oops - mis-commit.

9 years agoConvert this over to use the new cdev based ioctl path.
Adrian Chadd [Sun, 30 Aug 2015 21:54:47 +0000 (21:54 +0000)]
Convert this over to use the new cdev based ioctl path.

9 years agoMigrate the stats API for iwn(4) into a cdev ioctl, rather than tying
Adrian Chadd [Sun, 30 Aug 2015 21:54:33 +0000 (21:54 +0000)]
Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying
into the vap.

This allows for possible hardware interaction without needing a vap
configured.

9 years agoA bibliography of FreeBSD and BSD related papers and books.
George V. Neville-Neil [Sun, 30 Aug 2015 20:59:19 +0000 (20:59 +0000)]
A bibliography of FreeBSD and BSD related papers and books.
Keep this file in order by primary key which is the first author's
last name and the year of publication.

9 years agoUse P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
Konstantin Belousov [Sun, 30 Aug 2015 18:02:57 +0000 (18:02 +0000)]
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.  It was intended to be used there, compare with the
min value, and with the test for correctness in ksched_setscheduler().

Note that P1B_PRIO_MAX and RTP_PRIO_MAX do have the same numerical
values, the change is cosmetical.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoRemove single-use macros obfuscating malloc(9) and free(9) calls.
Konstantin Belousov [Sun, 30 Aug 2015 17:58:11 +0000 (17:58 +0000)]
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agosh: Fix read with escaped IFS characters at the end.
Jilles Tjoelker [Sun, 30 Aug 2015 17:24:22 +0000 (17:24 +0000)]
sh: Fix read with escaped IFS characters at the end.

Characters escaped with a backslash must be treated as if they were not in
IFS. This includes stripping trailing IFS characters.

9 years agoReduce the difference to vendor DTS by using the vendor compat strings (at
Luiz Otavio O Souza [Sun, 30 Aug 2015 16:10:12 +0000 (16:10 +0000)]
Reduce the difference to vendor DTS by using the vendor compat strings (at
some point we have to use the complete vendor DTS files, but we're not
there yet).

9 years agoIn preparation to support other A20 based boards, rename the CUBIEBOARD2
Luiz Otavio O Souza [Sun, 30 Aug 2015 15:38:41 +0000 (15:38 +0000)]
In preparation to support other A20 based boards, rename the CUBIEBOARD2
kernel configuration to A20.

There are other boards (namely the banana pi) that use exactly the same
devices.

Additionally, we are moving from static FDT support (DTB compiled
in-kernel) to DTB passed to kernel by the boot loader (ubldr).  The u-boot
for these boards are already available on ports and as the crochet support
for these boards isn't committed yet, this should not bring any issues.

Discussed with: ian

9 years agoRevert r286880: If at first this change made sense, it turns out
Julien Charbon [Sun, 30 Aug 2015 13:44:46 +0000 (13:44 +0000)]
Revert r286880:  If at first this change made sense, it turns out
it helps only the TCP timers callout(9) usage.  As the benefit for
others callout(9) usages did not reach a consensus the historical
usage should prevail.

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

9 years agoPut r284245 back in place: If at first this fix was seen as a temporary
Julien Charbon [Sun, 30 Aug 2015 13:44:39 +0000 (13:44 +0000)]
Put r284245 back in place:  If at first this fix was seen as a temporary
workaround for a callout(9) issue, it turns out it is instead the right
way to use callout in mpsafe mode without using callout_drain().

r284245 commit message:

Fix a callout race condition introduced in TCP timers callouts with r281599.
In TCP timer context, it is not enough to check callout_stop() return value
to decide if a callout is still running or not, previous callout_reset()
return values have also to be checked.

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

9 years agoRemove support for FreeBSD < 602110.
Xin LI [Sun, 30 Aug 2015 08:48:31 +0000 (08:48 +0000)]
Remove support for FreeBSD < 602110.

9 years agoFix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
Adrian Chadd [Sun, 30 Aug 2015 08:46:50 +0000 (08:46 +0000)]
Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
logical negation when used in this fashion.

Tested:

* compile only

9 years agoDon't assign 'ptr' without using it.
Xin LI [Sun, 30 Aug 2015 08:38:59 +0000 (08:38 +0000)]
Don't assign 'ptr' without using it.

Reported by: clang static analyzer
MFC after: 2 weeks

9 years agoFix a mistake in r287292. Despite correctly stating intent in the
Konstantin Belousov [Sun, 30 Aug 2015 04:46:44 +0000 (04:46 +0000)]
Fix a mistake in r287292.  Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 6 days

9 years agoAdd a gop command to help diagnose VT efifb problems. The gop
Marcel Moolenaar [Sun, 30 Aug 2015 01:39:59 +0000 (01:39 +0000)]
Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
  list - list all possible modes (paged)
  get - return the current mode
  set <mode> - set the current mode to <mode>

9 years ago- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
Craig Rodrigues [Sat, 29 Aug 2015 19:47:20 +0000 (19:47 +0000)]
- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
- Add missing <err.h> for err() and <sys/sysctl.h> for sysctlbyname()
- NULL -> 0 for 5th parameter of sysctlbyname()

Submitted by: Andriy Voskoboinyk <s3erios@gmail com>
Differential Revision: https://reviews.freebsd.org/D3442

9 years agosh: Add set -o nolog.
Jilles Tjoelker [Sat, 29 Aug 2015 19:41:47 +0000 (19:41 +0000)]
sh: Add set -o nolog.

POSIX requires this to prevent entering function definitions in history but
this implementation does nothing except retain the option's value. In ksh88,
function definitions were usually entered in the history file, even when
they came from ~/.profile and the $ENV file, to allow displaying their
definitions.

This is also the first option that does not have a letter.

9 years agoSupport the ZTE MF112 HSUPA 3G USB stick.
Gavin Atkinson [Sat, 29 Aug 2015 18:37:09 +0000 (18:37 +0000)]
Support the ZTE MF112 HSUPA 3G USB stick.

MFC after: 1 week

9 years agoUse 5 times RTO.Max as the default for the shutdown guard timer
Michael Tuexen [Sat, 29 Aug 2015 17:26:29 +0000 (17:26 +0000)]
Use 5 times RTO.Max as the default for the shutdown guard timer
as required by RFC 4960. The sysctl variable can be used to
overwrite this.

Discussed with: rrs
MFC after: 1 week

9 years agoRemove 600 bytes of port_priv from struct ctl_io_hdr.
Alexander Motin [Sat, 29 Aug 2015 15:33:31 +0000 (15:33 +0000)]
Remove 600 bytes of port_priv from struct ctl_io_hdr.

This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.

9 years agoSwitch libc from using _sig{procmask,action,suspend} symbols, which
Konstantin Belousov [Sat, 29 Aug 2015 14:25:01 +0000 (14:25 +0000)]
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by: Pete French <petefrench@ingresso.co.uk>
Tested by: Michiel Boland <boland37@xs4all.nl>
Reviewed by: jilles (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoAttach pass driver to LUNs is OFFLINE state.
Alexander Motin [Sat, 29 Aug 2015 11:21:20 +0000 (11:21 +0000)]
Attach pass driver to LUNs is OFFLINE state.

Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.

MFC after: 1 month

9 years agoUse the userland exported states and handle them completely.
Michael Tuexen [Sat, 29 Aug 2015 09:27:29 +0000 (09:27 +0000)]
Use the userland exported states and handle them completely.

9 years agoFix a buffer overrun which may lead to data corruption, introduced in
Xin LI [Sat, 29 Aug 2015 09:22:32 +0000 (09:22 +0000)]
Fix a buffer overrun which may lead to data corruption, introduced in
r286951 by reinstating changes in r274628.

In l2arc_compress_buf(), we allocate a buffer to stash away the compressed
data in 'cdata', allocated of l2hdr->b_asize bytes.

We then ask zio_compress_data() to compress the buffer, b_l1hdr.b_tmp_cdata,
which is of l2hdr->b_asize bytes, and have the compressed size (or original
size, if compress didn't gain enough) stored in csize.

To pad the buffer to fit the optimal write size, we round up the compressed
size to L2 device's vdev_ashift.

Illumos code rounds up the size by at most SPA_MINBLOCKSIZE.  Because we
know csize <= b_asize, and b_asize is integer multiple of SPA_MINBLOCKSIZE,
we are guaranteed that the rounded up csize would be <= b_asize. However,
this is not necessarily true when we round up to 1 << vdev_ashift, because
it could be larger than SPA_MINBLOCKSIZE.

So, in the worst case scenario, we are overwriting at most

(1 << vdev_ashift - SPA_MINBLOCKSIZE)

bytes of memory next to the compressed data buffer.

Andriy's original change in r274628 reorganized the code a little bit,
by moving the padding to after we determined that the compression was
beneficial.  At which point, we would check rounded size against the
allocated buffer size, and the buffer overrun would not be possible.

9 years agoFix the exporting of SCTP association states to userland. Without this,
Michael Tuexen [Sat, 29 Aug 2015 09:14:32 +0000 (09:14 +0000)]
Fix the exporting of SCTP association states to userland. Without this,
associations in SHUTDOWN-PENDING were never reported correctly.

MFC after: 3 weeks

9 years agoReport CLOSED as state for bound sockets for consistency with
Michael Tuexen [Sat, 29 Aug 2015 09:10:52 +0000 (09:10 +0000)]
Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.

PR: 201585
MFC after: 3 weeks

9 years agoIn r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
Xin LI [Sat, 29 Aug 2015 08:16:57 +0000 (08:16 +0000)]
In r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
as parent.  In the case of a send or receive, the curproc would be the
userland application that issues the ioctl.  This would trigger an assertion
failure introduced in Solaris compatibility shims in r196458 when kernel is
compiled with INVARIANTS.

Fix this by using p0 (proc0 or kernel) as the parent thread when creating
the kernel threads.

9 years agoAdd reminder to run etcupdate or mergemaster to get updated
Gleb Smirnoff [Sat, 29 Aug 2015 07:59:31 +0000 (07:59 +0000)]
Add reminder to run etcupdate or mergemaster to get updated
rc.d scripts for wireless.

Poked by: adrian

9 years agoImplement RSS hashing/re-hashing for IPv6 ingress packets.
Adrian Chadd [Sat, 29 Aug 2015 07:14:29 +0000 (07:14 +0000)]
Implement RSS hashing/re-hashing for IPv6 ingress packets.

This mirrors the basic IPv4 implementation - IPv6 packets under RSS
now are checked for a correct RSS hash and if one isn't provided,
it's done in software.

This only handles the initial receive - it doesn't yet handle
reinjecting / rehashing packets after being decapsulated from
various tunneling setups.  That'll come in some follow-up work.

For non-RSS users, this is almost a giant no-op.

It does change a couple of ipv6 methods to use const mbuf * instead of
mbuf * but it doesn't have any functional changes.

So, the following now occurs:

* If the NIC doesn't do any RSS hashing, it's all done in software.
  Single-queue, non-RSS NICs will now have the RX path distributed
  into multiple receive netisr queues.

* If the NIC provides the wrong hash (eg only IPv6 hash when we needed
  an IPv6 TCP hash, or IPv6 UDP hash when we expected IPv6 hash)
  then the hash is recalculated.

* .. if the hash is recalculated, it'll end up being injected into
  the correct netisr queue for v6 processing.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3504

9 years agoRename rss_soft_m2cpuid() -> rss_soft_m2cpuid_v4() in preparation for
Adrian Chadd [Sat, 29 Aug 2015 06:58:30 +0000 (06:58 +0000)]
Rename rss_soft_m2cpuid() ->  rss_soft_m2cpuid_v4() in preparation for
an IPv6 version to show up.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3504

9 years agoThe TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.
Justin Hibbits [Sat, 29 Aug 2015 06:52:14 +0000 (06:52 +0000)]
The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.

9 years agoRemove now unused (and #if 0'ed out) headers.
Adrian Chadd [Sat, 29 Aug 2015 04:33:31 +0000 (04:33 +0000)]
Remove now unused (and #if 0'ed out) headers.

9 years agoMark ValleyView/Bay Trail as not supported
Baptiste Daroussin [Sat, 29 Aug 2015 00:05:39 +0000 (00:05 +0000)]
Mark ValleyView/Bay Trail as not supported

9 years agoRemove now obsolete comment.
Warner Losh [Fri, 28 Aug 2015 20:06:58 +0000 (20:06 +0000)]
Remove now obsolete comment.

MFC After: 2 days

9 years agoPer overwhelming sentiment in the code review, use FEATURE instead.
Warner Losh [Fri, 28 Aug 2015 19:53:19 +0000 (19:53 +0000)]
Per overwhelming sentiment in the code review, use FEATURE instead.

Differential Revision: https://reviews.freebsd.org/D3488
MFC After: 2 days

9 years agoComment out cleaning files, since it cleans too much.
Warner Losh [Fri, 28 Aug 2015 16:29:38 +0000 (16:29 +0000)]
Comment out cleaning files, since it cleans too much.

9 years agoRemove .WAIT hacks and put in specific dependencies.
Warner Losh [Fri, 28 Aug 2015 16:23:03 +0000 (16:23 +0000)]
Remove .WAIT hacks and put in specific dependencies.

9 years agoAdd missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
Warner Losh [Fri, 28 Aug 2015 15:41:09 +0000 (15:41 +0000)]
Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
This allows the owc module to compile on pc98 and seems preferable to
adding another special case in the build system.

9 years agoAdd underscores to attributes when checking for __has_attribute.
Pedro F. Giffuni [Fri, 28 Aug 2015 15:36:05 +0000 (15:36 +0000)]
Add underscores to attributes when checking for __has_attribute.

This is a good practice to avoid confusion with allowed macros.

Suggested by: jilles

9 years agoMove dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
Andrew Turner [Fri, 28 Aug 2015 15:27:55 +0000 (15:27 +0000)]
Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
subclass the dwmmc driver to allow SoC specific attachments.

Sponsored by: ABT Systems Ltd

9 years agoAdd back missing -m32 for amd64 and powerpc64 that was lost
Warner Losh [Fri, 28 Aug 2015 14:50:36 +0000 (14:50 +0000)]
Add back missing -m32 for amd64 and powerpc64 that was lost
in the move to bsd.stand.mk.

9 years agoFix an NFS server bug that manifested in "ls -al" displaying a plus
Edward Tomasz Napierala [Fri, 28 Aug 2015 14:26:11 +0000 (14:26 +0000)]
Fix an NFS server bug that manifested in "ls -al" displaying a plus
sign on every directory exported via NFSv4 with NFSv4 ACLs enabled.

Reviewed by: rmacklem@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3502

9 years agotrailing space
Pedro F. Giffuni [Fri, 28 Aug 2015 14:13:01 +0000 (14:13 +0000)]
trailing space

9 years agoBe more GCC-friendly with attributes
Pedro F. Giffuni [Fri, 28 Aug 2015 14:06:28 +0000 (14:06 +0000)]
Be more GCC-friendly with attributes

Being clang the default compiler, we were always giving precedence to
the __has_attribute check. Unfortunately clang generally doesn't support
the new attributes (alloc_size was briefly supported and then reverted)
so we were always doing both checks. Give the precedence to GCC as that is
the working case now.

Do the same for  __has_builtin() for consistency.

9 years agoFix cleaning of files generated from .m sources.
Warner Losh [Fri, 28 Aug 2015 13:57:30 +0000 (13:57 +0000)]
Fix cleaning of files generated from .m sources.

9 years agoOnly check for the bus frequency if it has not already been set, for
Andrew Turner [Fri, 28 Aug 2015 10:34:37 +0000 (10:34 +0000)]
Only check for the bus frequency if it has not already been set, for
example through a driver running as a subclass of this.

Sponsored by: ABT Systems Ltd

9 years agoremove a left-over after r220463 empty #ifdef INET check.
Bjoern A. Zeeb [Fri, 28 Aug 2015 09:38:18 +0000 (09:38 +0000)]
remove a left-over after r220463 empty #ifdef INET check.

MFC after: 1 week

9 years agoPlug memory leaks when running out of memory.
Xin LI [Fri, 28 Aug 2015 06:41:40 +0000 (06:41 +0000)]
Plug memory leaks when running out of memory.

Reported by: clang scan-build
MFC after: 2 weeks

9 years agoReplace the printf()s with optional rate limited debugging for RSS.
Adrian Chadd [Fri, 28 Aug 2015 05:58:16 +0000 (05:58 +0000)]
Replace the printf()s with optional rate limited debugging for RSS.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3471

9 years agoFix text alignment. mcsr was indented one too many spaces.
Justin Hibbits [Fri, 28 Aug 2015 05:20:31 +0000 (05:20 +0000)]
Fix text alignment.  mcsr was indented one too many spaces.

9 years agoAdd another .WAIT since sometimes we lose the race.
Warner Losh [Fri, 28 Aug 2015 04:32:43 +0000 (04:32 +0000)]
Add another .WAIT since sometimes we lose the race.

9 years agoExtend pmap to support e500mc and e5500.
Justin Hibbits [Fri, 28 Aug 2015 03:03:09 +0000 (03:03 +0000)]
Extend pmap to support e500mc and e5500.

As part of this, clean up tlb1_init(), since bootinfo is always NULL here just
eliminate the loop altogether.

Also, fix a bug in mmu_booke_mapdev_attr() where it's possible to map a larger
immediately following a smaller page, causing the mappings to overlap.  Instead,
break up the new mapping into smaller chunks.  The downside to this is that it
uses more precious TLB1 entries, which, on smaller chips (e500v2) it could cause
problems with TLB1 being out of space (e500v2 only has 16 TLB1 entries).

Obtained from: Semihalf (partial)
Sponsored by: Alex Perez/Inertial Computing

9 years agoSimply to appease gcc's warnings.
Warner Losh [Fri, 28 Aug 2015 02:29:31 +0000 (02:29 +0000)]
Simply to appease gcc's warnings.

9 years agoSet DMA alignment constraint of status, TX and RX LEs(List Elements
Pyun YongHyeon [Fri, 28 Aug 2015 01:32:42 +0000 (01:32 +0000)]
Set DMA alignment constraint of status, TX and RX LEs(List Elements
in Marvell terms) to 32768.  32768 looks overkill but it will
ensure correct DMAed update.  This change addresses occasional
watchdog timeouts reported on 10.2-RELEASE.

Tested by: Johann Hugo <jhugo@meraka.csir.co.za>
MFC after: 2 weeks

9 years agoRespect locale settings.
Xin LI [Fri, 28 Aug 2015 00:49:30 +0000 (00:49 +0000)]
Respect locale settings.

MFC after: 2 weeks

9 years agoUse exit() instead of return in main().
Xin LI [Fri, 28 Aug 2015 00:44:58 +0000 (00:44 +0000)]
Use exit() instead of return in main().

MFC after: 2 weeks

9 years agoRemove weighted page handling from vm_page_advise().
Mark Johnston [Fri, 28 Aug 2015 00:44:17 +0000 (00:44 +0000)]
Remove weighted page handling from vm_page_advise().

This was added in r51337 as part of the implementation of
madvise(MADV_DONTNEED).  Its objective was to ensure that the page daemon
would eventually reclaim other unreferenced pages (i.e., unreferenced pages
not touched by madvise()) from the active queue.

Now that the pagedaemon performs steady scanning of the active page queue,
this weighted handling is unnecessary.  Instead, always "cache" clean pages
by moving them to the head of the inactive page queue.  This simplifies the
implementation of vm_page_advise() and eliminates the fragmentation that
resulted from the distribution of pages among multiple queues.

Suggested by: alc
Reviewed by: alc
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3401

9 years agoRe-apply r274569. It was reverted in r276848 since that appeared to fix
Mark Johnston [Fri, 28 Aug 2015 00:38:18 +0000 (00:38 +0000)]
Re-apply r274569. It was reverted in r276848 since that appeared to fix
some ctfmerge crashes that started to occur on i386 weeks after r274569 was
committed. Some later investigation indicated that the crashes were caused
by malformed CTF info that led to a stack overflow. The issue with CTF
info in i386 kernels seems to have been resolved by r261246, which updated
libdwarf and libelf.

r274569 fixes a bug which caused duplicate types to appear in the kernel's
CTF info. This duplication generally does not cause problems when using
DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type
definitions in a CTF container.

MFC after: 2 weeks

9 years agoRemove an unneeded instruction.
Mark Johnston [Fri, 28 Aug 2015 00:17:21 +0000 (00:17 +0000)]
Remove an unneeded instruction.

MFC after: 1 week

9 years agonv.h lives in sys/ as of r279439.
Mark Johnston [Fri, 28 Aug 2015 00:12:59 +0000 (00:12 +0000)]
nv.h lives in sys/ as of r279439.

9 years agoUse CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.
Warner Losh [Thu, 27 Aug 2015 23:46:42 +0000 (23:46 +0000)]
Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.
Go ahead and defined -D_STANDALONE for all targets (only strictly
needed for some architecture, but harmless on those it isn't required
for). Also add -msoft-float to all architectures uniformly rather
that higgley piggley like it is today.

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

9 years agoNew 1-Wire bus implementation. 1-Wire controller is abstracted, though
Warner Losh [Thu, 27 Aug 2015 23:33:38 +0000 (23:33 +0000)]
New 1-Wire bus implementation. 1-Wire controller is abstracted, though
only gpiobus configured via FDT is supported. Bus enumeration is
supported. Devices are created for each device found. 1-Wire
temperature controllers are supported, but other drivers could be
written. Temperatures are polled and reported via a sysctl.  Errors
are reported via sysctl counters. Mis-wired bus detection is included
for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for
details of what's supported and known issues.

This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black
with up to 7 devices.

Differential Revision: https://reviews.freebsd.org/D2956
Relnotes: yes
MFC after: 2 weeks
Reviewed by: loos@ (with many insightful comments)

9 years agoDocument bsd.endian.mk.
Warner Losh [Thu, 27 Aug 2015 22:42:02 +0000 (22:42 +0000)]
Document bsd.endian.mk.

9 years agopf: Remove support for 'scrub fragment crop|drop-ovl'
Kristof Provost [Thu, 27 Aug 2015 21:27:47 +0000 (21:27 +0000)]
pf: Remove support for 'scrub fragment crop|drop-ovl'

The crop/drop-ovl fragment scrub modes are not very useful and likely to confuse
users into making poor choices.
It's also a fairly large amount of complex code, so just remove the support
altogether.

Users who have 'scrub fragment crop|drop-ovl' in their pf configuration will be
implicitly converted to 'scrub fragment reassemble'.

Reviewed by: gnn, eri
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3466

9 years agoFix type bug introduced at r286811.
Alexander Motin [Thu, 27 Aug 2015 21:16:24 +0000 (21:16 +0000)]
Fix type bug introduced at r286811.

9 years agoFix a conversion error in rc.d/jail
Peter Wemm [Thu, 27 Aug 2015 20:52:41 +0000 (20:52 +0000)]
Fix a conversion error in rc.d/jail

9 years agoIn vm_pageout_scan(), simplify the logic for determining if a page can be
Alan Cox [Thu, 27 Aug 2015 20:38:45 +0000 (20:38 +0000)]
In vm_pageout_scan(), simplify the logic for determining if a page can be
paged out and apply some nearby style fixes.

In collaboration with: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division

9 years agoadd documentation for timers that silby added in r197244, almost 6 years
John-Mark Gurney [Thu, 27 Aug 2015 19:12:42 +0000 (19:12 +0000)]
add documentation for timers that silby added in r197244, almost 6 years
ago...

9 years agodie() would never return, mark it as so.
Xin LI [Thu, 27 Aug 2015 18:11:00 +0000 (18:11 +0000)]
die() would never return, mark it as so.

MFC after: 2 weeks

9 years agoMove setting of LDFLAGS to the modules which require it actually, as
Hajimu UMEMOTO [Thu, 27 Aug 2015 17:16:18 +0000 (17:16 +0000)]
Move setting of LDFLAGS to the modules which require it actually, as
other kerberos5 modules do so.

9 years agoThere is no need to get the bus tag or handle.
Andrew Turner [Thu, 27 Aug 2015 16:27:51 +0000 (16:27 +0000)]
There is no need to get the bus tag or handle.

Sponsored by: ABT Systems Ltd

9 years agoLimit the speed to the bus frequency.
Andrew Turner [Thu, 27 Aug 2015 16:24:30 +0000 (16:24 +0000)]
Limit the speed to the bus frequency.

Sponsored by: ABT Systems Ltd

9 years agoAllow the fifo-depth and num-slots to be missing. For the former we read
Andrew Turner [Thu, 27 Aug 2015 16:18:22 +0000 (16:18 +0000)]
Allow the fifo-depth and num-slots to be missing. For the former we read
the value from the hardware, for the latter assume a single slot.

Sponsored by: ABT Systems Ltd

9 years agoget_inpcbinfo() and get_pcblist() are UDP local functions and
Bjoern A. Zeeb [Thu, 27 Aug 2015 15:27:41 +0000 (15:27 +0000)]
get_inpcbinfo() and get_pcblist() are UDP local functions and
do not do what one would expect by name. Prefix them with "udp_"
to at least obviously limit the scope.

This is a non-functional change.

Reviewed by: gnn, rwatson
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3505

9 years agoDecompose linkat()/renameat() rights to source and target.
Ed Schouten [Thu, 27 Aug 2015 15:16:41 +0000 (15:16 +0000)]
Decompose linkat()/renameat() rights to source and target.

To make it easier to understand how Capsicum interacts with linkat() and
renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}.

This also addresses a shortcoming in Capsicum, where it isn't possible
to disable linking to files stored in a directory. Creating hardlinks
essentially makes it possible to access files with additional rights.

Reviewed by: rwatson, wblock
Differential Revision: https://reviews.freebsd.org/D3411

9 years agoMake it buildable with WITH_OPENLDAP, again.
Hajimu UMEMOTO [Thu, 27 Aug 2015 15:03:34 +0000 (15:03 +0000)]
Make it buildable with WITH_OPENLDAP, again.

MFC after: 1 week

9 years agoRepair sys/cdefs.h enough to be usable with GCC 5.x
Alexander Kabaev [Thu, 27 Aug 2015 14:00:23 +0000 (14:00 +0000)]
Repair sys/cdefs.h enough to be usable with GCC 5.x

The __alloc_size and __alloc_align need to be defined to
nothingness for lint, but the existing check is deficient
and allows attributes with working __has_attrubute() to
slip through.

9 years agoMake ncurses build with GCC 5.0 and up
Alexander Kabaev [Thu, 27 Aug 2015 14:00:20 +0000 (14:00 +0000)]
Make ncurses build with GCC 5.0 and up

Merge the end result of two upstream changes:

Original fix from 20141206:
  + modify MKlib_gen.sh to work around change in development version of
    gcc introduced here:
            https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
            https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
    (reports by Marcus Shawcroft, Maohui Lei).

Later fixed in different manner in 20150725:
  + use alternate workaround for gcc 5.x feature (adapted from patch by
    Mikhail Peselnik).

9 years agoUnbreak nvi message catalog generation for 8 bit locales.
Alexander Kabaev [Thu, 27 Aug 2015 14:00:16 +0000 (14:00 +0000)]
Unbreak nvi message catalog generation for 8 bit locales.

Feeding any file encoded in 8 bit locales such as KOI8-RU
to sort utility running under UTF-8 locale produces astonishing
result of recoding the output to UTF-8. To counter that, just
run sort under 'C' locale for now.

9 years agoAllow us to select the transfer count. This allows us to work with hardware
Andrew Turner [Thu, 27 Aug 2015 13:08:45 +0000 (13:08 +0000)]
Allow us to select the transfer count. This allows us to work with hardware
that seems to only work with a single block at a time.

Sponsored by: ABT Systems Ltd

9 years agoSilent a compilation warning on callout_stop()
Julien Charbon [Thu, 27 Aug 2015 10:43:35 +0000 (10:43 +0000)]
Silent a compilation warning on callout_stop()

9 years agoIn callout_stop(), do not forget to initialize not_running variable.
Julien Charbon [Thu, 27 Aug 2015 08:58:03 +0000 (08:58 +0000)]
In callout_stop(), do not forget to initialize not_running variable.
Thanks to hselasky for noticing that.

Differential Revision: https://reviews.freebsd.org/D3078 (Updated)
Submitted by: hselasky
Pointy hat to: jch

9 years agoReplay r286410. Change KPI of how device drivers that provide wireless
Gleb Smirnoff [Thu, 27 Aug 2015 08:56:39 +0000 (08:56 +0000)]
Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoIn callout_stop(), if a callout is both pending and currently
Julien Charbon [Thu, 27 Aug 2015 08:15:32 +0000 (08:15 +0000)]
In callout_stop(), if a callout is both pending and currently
being serviced return 0 (fail) but it is applicable only
mpsafe callouts.  Thanks to hselasky for finding this.

Differential Revision: https://reviews.freebsd.org/D3078 (Updated)
Submitted by: hselasky
Reviewed by: jch

9 years agoFix packets/bytes accounting on i386.
Alexander V. Chernikov [Thu, 27 Aug 2015 07:53:58 +0000 (07:53 +0000)]
Fix packets/bytes accounting on i386.

Spotted by: julian

9 years agoPlug a possible memory leak.
Xin LI [Thu, 27 Aug 2015 06:28:42 +0000 (06:28 +0000)]
Plug a possible memory leak.

MFC after: 2 weeks

9 years agoMore fixes to the new macros
Baptiste Daroussin [Thu, 27 Aug 2015 05:39:32 +0000 (05:39 +0000)]
More fixes to the new macros

9 years agoFix typo in new macros
Baptiste Daroussin [Thu, 27 Aug 2015 05:27:18 +0000 (05:27 +0000)]
Fix typo in new macros

9 years agoAn error of -1 from parse_mount() indicates that the specification
Marcel Moolenaar [Thu, 27 Aug 2015 04:25:27 +0000 (04:25 +0000)]
An error of -1 from parse_mount() indicates that the specification
was invalid. Don't trigger a mount failure (which by default means
a panic), but instead just move on to the next directive in the
configuration. This typically has us ask for the root mount.

PR: 163245

9 years agoFix freescale sdhc driver, and add it to the files list.
Justin Hibbits [Thu, 27 Aug 2015 03:47:56 +0000 (03:47 +0000)]
Fix freescale sdhc driver, and add it to the files list.

Also, add it to the mmc DRIVER_MODULE attachment list.

9 years agoUse the macro definition for EXC_PGM_TRAP, instead of the magic number.
Justin Hibbits [Thu, 27 Aug 2015 03:44:06 +0000 (03:44 +0000)]
Use the macro definition for EXC_PGM_TRAP, instead of the magic number.