Commit Graph

15665 Commits

Author SHA1 Message Date
pfg
503271002c MFC r268945:
Fix hdestroy() compliance issue.

The hcreate(3) implementation and related functions we inherited
from NetBSD used to free() the key value, something that is not
supported by the standard implementation.

This would cause a segmentation fault when attempting to run
the examples from the opengroup and linux manpages.

There is no need to bump the __FreeBSD_version as we have
always claimed XPG4.2 compliance but if some reference is
required, the bump for r269484 can be used.

Reference:
http://bugs.dragonflybsd.org/issues/1398
2014-08-04 00:51:57 +00:00
pfg
1ae0bcf0e8 MFC r268066:
regex(3): Add support for \< and \> word delimiters

Solaris and other OSs have support for \< and \> as word
delimiters in utilities like sed(1). These are useful to
have for general compatiblity with Solaris but should be
avoided for portability with other systems, including the
traditional BSDs.

Bump __FreeBSD_version as this is likely to affect some
userland utilities.

Reference:
https://www.illumos.org/issues/516

PR:		bin/153257
Obtained from:	Illumos
2014-08-03 18:39:11 +00:00
pfg
4edbce8b34 MFC r269124:
strftime() xlocale cleanups.

Replace fprintf_l with fputs when output is unformatted.
Use locale_t in _conv() since it was using sprintf (now sprintf_l)
Use locale_t on _yconv() since it calls _conv()

Obtained from:	Apple Inc. (Libc 997.90.3)
CR:		D482
Reviewed by:	theraven
2014-08-03 18:31:52 +00:00
pfg
5c8726d1b2 MFC r268926, r268930, r268983:
Use a correct errno in freopen.
Use EBADF instead of EINVAL when working around incorrect O_ACCMODE.

Adjust errno on failed prepwrite.

rewind: always clear error indicator as required by POSIX.

Obtained from:	Apple Inc. (Libc 997.90.3)
Phabric:	D442
2014-08-03 18:28:10 +00:00
pfg
eabfc5bd75 MFC r268867, r268878:
Use more consistent type for optlen in getsourcefilter()

Proposed by:	bde
2014-08-03 18:03:00 +00:00
marcel
aef52ec818 MFC 264162: Accept RFC 2292 option values so that RFC 2292 compliant
programs that are unaware of RFC 3542 can construct control messages.

Obtained from:	Juniper Networks, Inc.
2014-08-03 02:24:52 +00:00
marcel
b37299ed78 MFC 264161: Handle the fact that the getlogin_basic() function can return
a 0 status with a NULL pointer for the login name (result).

Obtained from:	Juniper Networks, Inc.
2014-08-03 01:51:48 +00:00
marcel
b0acb5134f MFC 259910, 260023, 260028, 260600 & 260701:
o   Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM.
o   Allow building a cross libkvm for ia64.
o   Add support for virtual cores (aka minidumps).
o   We don't have to worry about page sizes when working on virtual cores.
o   Handle truncation of the size returned by _kvm_kvatop().
2014-08-02 22:25:24 +00:00
markj
7c889ea487 MFC r265276:
Fix a typo.
2014-07-29 22:29:31 +00:00
markj
cf4dd8790b MFC r268446:
Fix a typo.
2014-07-29 21:15:26 +00:00
des
fe6d937978 MFH (r266114, r266138): upgrade to latest ldns and unbound
MFH (r266139-r266143, r266145, r266149, r266150): fix props
MFH (r266179, r266180, r266193, r266238, r266777): misc cleanup
MFH (r266863): create and use /var/unbound/conf.d
MFH (r268839): import unblock-lan-zones patch from upstream
MFH (r268840): fix reverse lookups on private networks
MFH (r268883): avoid spamming source tree during build

PR:		190739 (for r268883)
2014-07-29 20:57:38 +00:00
pfg
26a3b70214 MFC r269016:
Fix mismatch.
2014-07-26 02:41:18 +00:00
ian
d599f4ba1e MFC r261530
Set the malloc alignment to 64 bytes on platforms that use the U-Boot API
  device drivers.  Recent versions of u-boot run with the MMU enabled, and
  require DMA-based I/O to be aligned to cache line boundaries.
2014-07-25 23:12:22 +00:00
pfg
414a4cb931 MFC r268985, r269001:
Avoid possible cast degradation.

Assign iov_len first, avoiding the cast to uio_resid
(int in stdio) from degrading the value.

Small cosmetical fix while here.
2014-07-25 03:24:00 +00:00
kevlo
0320ab1784 MFC r268643:
Document that listen(2) can fail with EDESTADDRREQ.
2014-07-24 05:59:32 +00:00
emaste
aa794b38fe MFC r262528: Update LLDB snapshot to upstream r202189
Highlights include (upstream revs in parens):

  - Improvements to the remote GDB protocol client
    (r196610, r197579, r197857, r200072, and others)

  - Bug fixes for big-endian targets
    (r196808)

  - Initial support for libdispatch (GCD) queues in the debuggee
    (r197190)

  - Add "step-avoid-libraries" setting
    (r199943)

  - IO subsystem improvements (including initial work on a curses gui)
    (r200263)

  - Support hardware watchpoints on FreeBSD
    (r201706)

  - Improved unwinding through hand-written assembly functions
    (r201839)

  - Handle DW_TAG_unspecified_parameters for variadic functions
    (r202061)

  - Fix Ctrl+C interrupting a running inferior process
    (r202086, r202154)

  - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler,
    ELF core files, DWARF debug info, and others.

Sponsored by:	DARPA, AFRL
2014-07-23 19:35:02 +00:00
emaste
68543b825e MFC r261799: Add bounds check for pteindex / pdeindex to amd64 kvm_minidump 2014-07-23 14:29:28 +00:00
pfg
797038915a MFC r268928:
Const-ify a character string.

Obtained from:	Apple Inc. (Libc 997.90.3)
2014-07-23 02:55:03 +00:00
jhb
ce450da430 MFC 266424,266476,266524,266573,266595,266626,266627,266633,266641,266642,
266708,266724,266934,266935,268521:
Emulation of the "ins" and "outs" instructions.

Various fixes for translating guest linear addresses to guest physical
addresses.
2014-07-22 04:39:16 +00:00
jhb
c1fe945ebd MFC 266125:
Implement a PCI interrupt router to route PCI legacy INTx interrupts to
the legacy 8259A PICs.
2014-07-22 03:14:37 +00:00
pfg
f5657a9f1c MFC r268644:
libc/stdlib: Minor cleanups to code originating in NetBSD

Mostly ANSIfication and typos.

Obtained from:	NetBSD
2014-07-21 22:47:59 +00:00
pfg
832f667130 MFC r268642:
libc/gen: small updates to code originating at OpenBSD

arc4random.c
- CVS rev. 1.22
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
- CVS rev. 1.23
Spacing

readpassphrase.c
-CVS rev. v 1.24
most obvious unsigned char casts for ctype

Obtained from:	OpenBSD
2014-07-21 22:37:33 +00:00
jhb
e6b48465b7 MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365,
265941,265951,266390,266550,266910:
Various bhyve fixes:
- Don't save host's return address in 'struct vmxctx'.
- Permit non-32-bit accesses to local APIC registers.
- Factor out common ioport handler code.
- Use calloc() in favor of malloc + memset.
- Change the vlapic timer frequency to be in the ballpark of contemporary
  hardware.
- Allow the guest to read the TSC via MSR 0x10.
- A VMCS is always inactive when it exits the vmx_run() loop.  Remove
  redundant code and the misleading comment that suggest otherwise.
- Ignore writes to microcode update MSR.  This MSR is accessed by RHEL7
  guest.
  Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.
- Provide an alias for the userboot console and name it 'comconsole'.
- Use EV_ADD to create an mevent and EV_ENABLE to enable it.
- abort(3) the process in response to a VMEXIT_ABORT.
- Don't include the guest memory segments in the bhyve(8) process core dump.
- Make the vmx asm code dtrace-fbt-friendly.
- Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in
  the VCPU_RUNNING state.
- Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR
  isn't locked.
2014-07-21 19:08:02 +00:00
jhb
888f6511e3 MFC 263780,264516,265062,265101,265203,265364:
Add an ioctl to suspend a virtual machine (VM_SUSPEND).

Add logic in the HLT exit handler to detect if the guest has put all vcpus
to sleep permanently by executing a HLT with interrupts disabled.

When this condition is detected the guest with be suspended with a reason of
VM_SUSPEND_HALT and the bhyve(8) process will exit.

This logic can be disabled via the tunable 'hw.vmm.halt_detection'.
2014-07-21 02:39:17 +00:00
bapt
d4cd64d84a MFC: r267376
Add a zlib pkg-config file (more and more ports requires it)

Approved by:	delphij
2014-07-20 00:32:22 +00:00
bapt
63350d40ce MFC: r267131, r267132, r267133, r268493, r268671
Use NULL instead of 0 (Patch by Sascha Wildner <saw at online.de> for Dragonfly)
Remove unnecessary semicolons (Patch by Sascha Wildner <saw at online.de> for Dragonfly)
Add support for arbitrary http requests [1]
Support EAGAIN in fetch_writev

Submitted by:	Alex Hornung <alex at alexhornung.com> [1]
Reviewed by:	des
2014-07-20 00:29:41 +00:00
bapt
6f718e3669 MFC: r263648, r264789, r266636
This brings:
- schema validation
- xpath-like interface for ucl objects

Adapt pkg(7) to the new libucl API
2014-07-19 23:44:57 +00:00
jhb
3da9c304ee MFC 259942,262274,263035,263054,263211,263744,264179,264324,264468,264631,
264648,264650,264651,266572,267558:
Flesh out the AT PIC and 8254 PIT emulations and move them into the kernel.
2014-07-19 22:06:46 +00:00
pfg
c62a7a5557 MFC r268569:
strfmon: reduce unnecessary snprintf.

No need for the snprintf/asprintf dance; use fixed width formats.

Obtained from:	NetBSD (CVS rev. 1.8)
2014-07-19 15:12:38 +00:00
pfg
30eedb40f8 MFC r268502:
Sync some (mostly cosmetical) changes from NetBSD

Makefile,v 1.37
tc1.c v 1.3
Rename TEST/test.c tc1.c

common.c,v 1.23
pass lint on _LP64.

emacs.c,v 1.22
pass lint on _LP64.

filecomplete.h,v 1.8
mv NetBSD ID back from 1.9 as we don't
have the widecharacter support.

prompt.c,v 1.14
prompt.h,v 1.9
term.h,v 1.20
read.h,v 1.6
Update NetBSD version strings

sys.h,v 1.12
Misc sun stuff.

tty.c 1.31
handle EINTR in the termios operations
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.
pass lint on _LP64.
Don't depend on side effects inside an assert

Obtained from:	NetBSD
2014-07-17 02:14:25 +00:00
dim
082dc1af3f MFC r268463:
In libproc, avoid calling __cxa_demangle(), and thus depending on either
libcxxrt or libsupc++, if WITHOUT_CXX is defined. [1]

Noticed by:	sbruno

[1] However, on stable/10 this is more accurately described by
WITHOUT_GNUCXX, so I've changed the test to that instead.
2014-07-16 21:04:31 +00:00
kib
369fe04016 MFC r268467:
Implement sysconf(_SC_GETGR_R_SIZE_MAX) and sysconf(_SC_GETPW_R_SIZE_MAX).
2014-07-16 08:52:44 +00:00
wblock
f454bd908f MFC r267618:
Fix syntax error.
2014-07-15 22:44:10 +00:00
pfg
8bbbab8fb3 MFC r268272:
minor perf enhancement for UTF-8

Reduce some duplicate code.

Reference:
https://www.illumos.org/issues/628

Obtained from:	Illumos
2014-07-12 17:39:13 +00:00
delphij
a8fc83ae7c MFC r267897: MFV r267843:
Update file/libmagic to 5.19.
2014-07-11 00:00:00 +00:00
kib
8674b3c2aa MFC r268212:
Note that most errors are possible for all syscalls from utimes(2)
family.  Minor wording corrections.
2014-07-10 09:09:37 +00:00
pluknet
48775398f2 MFC r268393: [mdoc] Fix previous. 2014-07-08 13:16:03 +00:00
ache
51242982da MFC 267756:
Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.
2014-07-07 05:31:50 +00:00
pfg
19e2403cf6 MFC r267745, r268268:
getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from:	NetBSD
MFC after:	2 weeks
2014-07-07 02:47:41 +00:00
pluknet
0d8378f52b MFC r267909: Document EINVAL.
PR:		191382
2014-07-03 17:35:01 +00:00
ume
e6568c7ce0 MFC r267912, r267915:
- Exclude loopback address rather than loopback interface.
- style(9)

Spotted by:	melifaro
2014-07-03 15:56:30 +00:00
ume
1af4339c2a MFC r267800:
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.
2014-06-30 16:53:12 +00:00
delphij
ab99acf70d MFC r267378:
Fix path for zlib examples, this have no runtime effect and was
overlooked when I was doing zlib update.
2014-06-30 16:31:28 +00:00
pfg
99efb6c39e MFC r267627:
strptime: add support for %t and %n

Posix strptime() requires support for %t and %n, which were added
to the illumos port.  Curiously we were skipping white spaces by
default in most other cases making %t meaningless.

We now skip spaces in the case of the %e specifier as strftime(3)
explicitly adds a space for the single digit case.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html

PR:		173421
Obtained from:	Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
2014-06-30 14:52:40 +00:00
pluknet
b39fb82c62 MFC r261140:
Add MLINK for fdclosedir.3 to directory.3 and sort fdopendir(3) entry.
2014-06-27 09:11:24 +00:00
kib
15d33955d2 MFC r267630:
Add MAP_EXCL flag for mmap(2).
2014-06-26 08:30:08 +00:00
kib
b371ec04aa MFC r267629:
Tidy up code of the wrapper.
2014-06-26 08:27:01 +00:00
ume
ec8b74659a MFC r267616, 267640:
Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
  does.
- Exclude addresses assigned on interfaces which are ifdisabled.

Use SOCK_CLOEXEC.

PR:		190824
Submitted by:	Justin McOmie
2014-06-25 17:10:26 +00:00
pfg
f1ff231dba MFC r267601:
stdtime: style(9) fixes.

Obtained from:	illumos
2014-06-23 15:03:51 +00:00
pfg
fac80b6943 MFC r267544:
Update license to strptime(3) implementation.

Our strptime(3) implementation was the base for the illumos
implementation and after contacting the author, Kevin Rudy
stated the code is under a 2-Clause BSD License [1]

After reviewing our local changes to the file in question,
the FreeBSD Foundation has agreed that their contributions
to this file are not required to carry clause 3 or 4 so
the file can be relicensed as in Illumos [2].

References:

[1] https://www.illumos.org/issues/357
[2] Illumos Revision:		13222:02526851ba75

Approved:	core (jhb)
Approved:	FreeBSD Foundation (emaste)
2014-06-20 15:43:58 +00:00
tijl
de4e2206d5 MFC r267436-267439:
- Replace malloc+memset with calloc.
- iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared
  struct after allocation with malloc.
- iconvlist(3): reduce a memory leak by copying strings only once.
- iconv(1):
  - Make invalids variable local to do_conv such that it prints the number
    of invalid characters of the current file instead of an accumulated
    value.
  - Make do_conv return an error when invalid characters have been found.
    Return EXIT_FAILURE from main if any file contained invalid characters.
    This matches the behaviour of GNU iconv.
  - Mark usage with __dead2 attribute.
  - Make the long_options array const.

Tested by:	Pavel Timofeev <timp87@gmail.com>
2014-06-20 07:32:03 +00:00
kib
adb3a0aab0 MFC r267062:
Disable existing uncore hwpmc code for Nehalem and Westmere EX.
2014-06-18 05:35:09 +00:00
dim
7e5254e136 MFC r267335:
In some scenarios, when generating llvm/clang .inc.h files, multiple
source files could be passed to tblgen or clang-tblgen, leading to a
"Too many positional arguments specified" error message.  Fix this by
replacing the too-generic ${.ALLSRC} sources with explicit paths.

Reported by:	rysto32@gmail.com, rodrigc
2014-06-14 11:20:41 +00:00
pfg
b890481de0 MFC r266865;
Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.

POSIX.1-2008 specifies that those two functions should be declared by
including <strings.h>, not <string.h> (the latter only has strcoll_l()
and strxfrm_l()):

http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html

Bump __FreeBSD_version for ports that may be using the non-standard
reference.

Obtained from:	DragonFlyBSD
Reviewed by:	theraven
2014-06-14 02:57:40 +00:00
hselasky
3eab83e1a2 MFC r263191:
Add libusb_log_level enum.
2014-06-13 07:33:43 +00:00
jhb
3e1f2ae835 MFC 261638,262144,262506,266765:
Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and
XSAVE-enabled features like AVX.
- Store a per-cpu guest xcr0 register and handle xsetbv VM exits by emulating
  the instruction.
- Only expose XSAVE to guests if XSAVE is enabled in the host.  Only expose
  a subset of XSAVE features currently supported by the guest and for which
  the proper emulation of xsetbv is known.  Currently this includes X87, SSE,
  AVX, AVX-512, and Intel MPX.
- Add support for injecting hardware exceptions into the guest and use this
  to trigger exceptions in the guest for invalid xsetbv operations instead
  of potentially faulting in the host.
- Queue pending exceptions in the 'struct vcpu' instead of directly updating
  the processor-specific VMCS or VMCB. The pending exception will be delivered
  right before entering the guest.
- Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict
  it to only deliver x86 hardware exceptions. This new ioctl is now used to
  inject a protection fault when the guest accesses an unimplemented MSR.
- Expose a subset of known-safe features from leaf 0 of the structured
  extended features to guests if they are supported on the host including
  RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM.  Aside
  from AVX-512, these features are all new instructions available for use
  in ring 3 with no additional hypervisor changes needed.
2014-06-12 19:58:12 +00:00
jhb
fa121e2a05 MFC 261504:
Add support for FreeBSD/i386 guests under bhyve.
2014-06-12 15:20:59 +00:00
jhb
835cb387cc MFC 260239,261268,265058:
Expand the support for PCI INTx interrupts including providing interrupt
routing information for INTx interrupts to I/O APIC pins and enabling
INTx interrupts in the virtio and AHCI backends.
2014-06-12 13:13:15 +00:00
nwhitehorn
dc45432cd4 MFC r260913,266895:
Add a new flag to /etc/ttys: onifconsole. This is equivalent to "on" if the
device is an active kernel console and "off" otherwise. This is designed to
allow serial-booting x86 systems to provide a login prompt on the serial line
by default without providing one on all systems by default. Set this flag
on x86 systems for ttyu0.

Comments and suggestions by:	grehan, dteske, jilles
2014-06-08 17:50:07 +00:00
kib
8d9dc2de3a MFC r266609:
Change the _rtld_atfork() to lock the bind lock in write mode.
2014-06-07 02:45:24 +00:00
jilles
83925746a3 MFC r264417: realpath(): Properly fail "." or ".." components after
non-directories.

If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR:		82980
2014-06-06 13:37:40 +00:00
ume
6f5c5395e9 MFH r266813: Don't break the legacy applications which set
just 2 bytes to salt.
2014-06-05 15:16:44 +00:00
hselasky
105e4e05fc MFC r266664:
Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API
from sourceforge.

PR:		usb/190204
2014-06-04 10:40:43 +00:00
bjk
5eb02565b3 MFC r266285,266866:
------------------------------------------------------------------------
    r266285 | bjk | 2014-05-16 23:05:52 -0400 (Fri, 16 May 2014) | 9 lines

    Correct documentation of the limit on how much memory can be mlock()ed

    vm.max_wired is a system-wide limit, not per-process.  Reword the
    section to make this more clear.

    PR:             docs/189214
    Submitted by:   Lawrence Chen (original text)
    Approved by:    hrs (mentor)

    ------------------------------------------------------------------------
    r266866 | bjk | 2014-05-29 22:16:28 -0400 (Thu, 29 May 2014) | 5 lines

    Minor mdoc fix

    Submitted by:   hrs
    Approved by:    hrs (mentor, implicit)

    ------------------------------------------------------------------------

PR:		docs/189214
Approved by:	hrs (mentor)
2014-06-01 18:41:33 +00:00
hiren
21dae9b420 MFC r263446
Update hwpmc to support core events for Atom Silvermont microarchitecture.
(Model 0x4D as per Intel document 330061-001 01/2014)
2014-05-31 00:40:13 +00:00
dim
a3e27ae6a9 MFC r265925:
Upgrade our copy of llvm/clang to 3.4.1 release.  This release contains
mostly fixes, for the following upstream bugs:

http://llvm.org/PR16365 http://llvm.org/PR17473 http://llvm.org/PR18000
http://llvm.org/PR18068 http://llvm.org/PR18102 http://llvm.org/PR18165
http://llvm.org/PR18260 http://llvm.org/PR18290 http://llvm.org/PR18316
http://llvm.org/PR18460 http://llvm.org/PR18473 http://llvm.org/PR18515
http://llvm.org/PR18526 http://llvm.org/PR18600 http://llvm.org/PR18762
http://llvm.org/PR18773 http://llvm.org/PR18860 http://llvm.org/PR18994
http://llvm.org/PR19007 http://llvm.org/PR19010 http://llvm.org/PR19033
http://llvm.org/PR19059 http://llvm.org/PR19144 http://llvm.org/PR19326
2014-05-26 20:45:44 +00:00
des
d65c1b420a MFH (r266291): look for root certs in /usr/local first 2014-05-24 22:50:58 +00:00
pho
a3e5dd5421 MFC r265534:
msync(2) must return ENOMEM and not EINVAL when the address is outside the
allowed range or when one or more pages are not mapped. This according to
The Open Group Base Specifications Issue 7.

Sponsored by:	EMC / Isilon storage division
2014-05-21 09:19:05 +00:00
ian
de1f6cfd90 MFC 257233: Use size of the MACHINE_ARCH string instead of sizeof(uint32_t). 2014-05-18 16:43:47 +00:00
ian
05acb76bb3 MFC 265059: Set the new floating point exception mask correctly. 2014-05-17 23:20:29 +00:00
ian
fd20bf61ea MFC 264696, 264721,
Add the deprecated fp{get,set}* functions, a few ports use them.

  Rename the fp{get,set}* files so they no longer conflict with the
  softfloat version of these files.
2014-05-17 22:19:16 +00:00
ian
1253f26158 MFC 263631, 263637, 263664, 263676, 263679, 263698, 263711,
Implement __flt_rounds for ARMv6 hard-float. The fpscr register stores the
  current rounding mode used by the VFP unit.

  Simplify how we build MACHINE_ARCH. There are 3 options that may be set
  however only arm, armeb, armv6, and soon armv6hf will be used.

  Add the llvm/clang patch for r263619.

  Reorder the pmap macros so "ARM_MMU_V6 + ARM_MMU_V7" is first. As they are
  identical this allows us to build for both v6 and v7 together.

  Add code for enabling second CPU core for A20 SoC.
  Enable SMP on Cubieboard2.

  Switch to freebsd.org emal address in copyright.
2014-05-17 18:53:36 +00:00
ian
ad5edf36f1 MFC 262989, 263210, 263230, 263231, 263239, 263242, 263243,
Export _libc_arm_fpu_present as a private symbol to be used by other
  system libraries, for example libm.

  On armv6 access both the softfloat and, when available, the vfp to get and
  set the floating-point environment.

  Build fenv-vfp.c with the softfp float abi. Without this gcc generates an
  incorrect assembly file that doesn't allow for vfp instructions.

  Only build the vfp/softfp switching code on armv6 as we don't support vfp
  on anything earlier than this. This should fix the armeb and arm builds
  when using gcc.

  Add an optimised version of the float and double helper functions.
2014-05-17 14:22:37 +00:00
dim
6341a2d92b MFC r266053:
Use the new -d option that was added to tblgen between llvm/clang 3.3
and 3.4 to generate dependency files for the '.inc.h' files generated
from .td files, and .sinclude those dependency files in clang.build.mk.

This will make future incremental builds of lib/clang and usr.bin/clang
work correctly, whenever any of the .td files get modified.

Note that this will not fix any problems with incremental builds from
*before* this revision, since there will not yet be any generated
dependency files.  A quick workaround is to run the following:

  find /usr/obj -type f -name '*.inc.h' | xargs rm

and then a regular incremental buildworld (e.g. with -DNO_CLEAN).
2014-05-17 12:47:11 +00:00
kib
de734013ee MFC r265847:
Fix sem_unlink(3) to properly invalidate the semaphores name cache.

PR:	standards/189353
2014-05-17 11:43:14 +00:00
kib
0bc598bf79 MFC r265845:
Style.
2014-05-17 11:38:26 +00:00
brueffer
0e330f2d70 MFC: r265238, r265240
Properly free resources in case of error.

CID:		1007032
Found with:	Coverity Prevent(tm)
2014-05-16 15:48:45 +00:00
ian
72ce30b8f8 MFC r257207, r261161, r261163:
Update the hard-float version of the fenv functions to use the VFP unit.
  Any other floating-point unit is unsupported on ARM.

  Use __fenv_static for all static inline functions.

  Correctly shift the mask when masking/unmasking exceptions.
2014-05-15 15:02:48 +00:00
kevlo
69da76e9e5 MFC r264212,r264213,r264248,r265776,r265811,r265909:
- Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks.
  Tested with vlc and a test suite [1].
  [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz

  Reviewed by:	jhb, glebius, adrian

- Fix a logic bug which prevented the sending of UDP packet with 0 checksum.

- Disable TX checksum offload for UDP-Lite completely. It wasn't used for
  partial checksum coverage, but even for full checksum coverage it doesn't
  work.
2014-05-13 06:05:53 +00:00
des
b6c03d4ad7 MFH (r261913): switch default to sha512
MFH (r264964): rewrite so DES still works when not the default
MFH (r262945): clean up man page
2014-05-11 14:54:17 +00:00
delphij
628e16b68d MFC r265464:
Sort .ALLSRC before concatenating files together.  This makes sure that the
file are always built the same.

(Note that Header and Localstuff must appear first and in that order, the
sorting does not affect as a coincident effect).

Submitted by:	sjg
2014-05-09 07:24:39 +00:00
pfg
f3f247f508 MFC r265202:
Remove some unreachable breaks in regex.

This is based on a much bigger cleanup done in Illumos.

Reference:
https://www.illumos.org/issues/2077
2014-05-09 01:20:39 +00:00
pfg
9fe5eca952 MFC r265095, r265167;
citrus: Avoid invalid code points.

The UTF-8 decoder should not accept byte sequences which decode to
unicode code positions U+D800 to U+DFFF (UTF-16 surrogates).[1]

Contrary to the original OpenBSD patch, we do pass U+FFFE and U+FFFF,
both values are valid "non-characters" [2] and must be mapped through
UTFs.

[1] http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
[2] http://www.unicode.org/faq/private_use.html

Reported by:	Stefan Sperling [1]
Thanks to:	jilles [2]
Obtained from:	OpenBSD
2014-05-05 14:50:53 +00:00
markj
652284a343 MFC r264436:
Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the
first address after the end of the map entry and should therefore be
excluded.
2014-04-29 03:36:04 +00:00
brueffer
95bfeaca5a MFC: r264585
Add a missing break in the TCP case.

Reviewed by:	bms
2014-04-24 10:23:35 +00:00
brueffer
031977611b MFC: r264507
Mention Capsicum.
2014-04-23 12:11:14 +00:00
hselasky
562a6a9fe9 MFC r264344:
Tune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0
APIs to increase the maximum bandwidth limit.
2014-04-18 07:50:25 +00:00
jmmv
9ae7565292 MFC r263989: Add atf m4 files from the vendor branch. 2014-04-17 17:20:56 +00:00
jmmv
8181a88b7a MFC r263090: Make ether_line really report an error when all input is invalid. 2014-04-17 11:49:19 +00:00
tijl
1cbbe6f2d4 MFC r263986:
- In the libiconv module for ISO 2022 restore the original order of the
  fields of a private struct such that variables of this type are
  initialised correctly.  Fixes conversion from ISO 2022.
  Also do this in the BIG5 module to prevent similar errors in the future.
- In the libiconv module for EUC-TW replace 2^cs with 1<<cs.  Fixes
  conversion from EUC-TW.
- Synchronise iconv code with NetBSD.  In most cases this only updates
  the RCS id because the changes are already there or are NetBSD specific.
  + libc/iconv/citrus_csmapper.c: Add a comment.
  + libc/iconv/citrus_db_factory.c: Remove put16().
  + libc/iconv/citrus_iconv.c: Return EINVAL on error.
  + libc/iconv/citrus_mapper.c: Return EINVAL on error.
  + libc/iconv/citrus_memstream.c: Fix type of a variable.
  + libc/iconv/citrus_prop.h: Sync definition of _CITRUS_PROP_HINT_END.
  + libc/iconv/citrus_stdenc.c: Return EINVAL on error.
  + libiconv_modules/mapper_std/citrus_mapper_std.c: Plug memory leak.

Obtained from:	NetBSD
2014-04-15 09:49:44 +00:00
jmmv
63fa6c9a5b MFC refactoring of the *.test.mk files.
- r263161 Make bsd.test.mk the only public mk fragment for the building of tests.
- r263172 Move FreeBSD Test Suite-specific code to a suite.test.mk file.
- r263204 Add some documentation for bsd.test.mk.
- r263217 Document support for TAP-compliant Perl test programs.

This is "make tinderbox" clean.
2014-04-14 23:51:57 +00:00
dim
b4a5074609 MFC r263778:
Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially.  Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

		before    stddev       after    stddev
		=======   ======       =======  ======
real time        1741.1     16.5         959.8     2.7
user time       12468.7     16.4       14393.0    16.8
sys  time        1825.0     54.8        2110.6    22.8

(user+sys)/real     8.2                   17.1

E.g. the build was approximately 45% faster in real time.  On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive.  But at least you can now almost max out a machine with
buildworld!

Submitted by:	jilles

MFC r263833:

Enable parallel building for gnu/usr.bin and usr.bin/clang too.
2014-04-09 18:16:58 +00:00
jilles
a3f8ed8103 MFC r262872: fts: Don't abort if an empty pathname is given.
Make fts_open(3) treat an empty pathname like any other pathname that cannot
be lstatted because of [ENOENT].

It is rather confusing if  rm -rf file1 "" file2  does not remove file1 and
file2.

PR:		bin/187264
2014-04-05 20:26:17 +00:00
jilles
15366d2a0d MFC r258794: chmod(2): Document S_ISVTX following SUSv3/SUSv4.
S_ISTXT is non-standard.

While here, also update fchmodat() standards entry to POSIX.1-2008.
2014-04-05 20:11:40 +00:00
jilles
738573dde6 waitid(2): Do not tell userland programmers to include <sys/signal.h>.
Userland should get these definitions by including <signal.h>.
2014-04-05 20:09:51 +00:00
gjb
8a8ec2ebba MFC r263863:
Dereference nonexistent md2(3) manual.

Sponsored by:	The FreeBSD Foundation
2014-03-31 00:28:54 +00:00
dim
fb422e6d31 MFC r262613:
Merge the projects/clang-sparc64 branch back to head.  This brings in
several updates from the llvm and clang trunks to make the sparc64
backend fully functional.

Apart from one patch to sys/sparc64/include/pcpu.h which is still under
discussion, this makes it possible to let clang fully build world and
kernel for sparc64.

Any assistance with testing this on actual sparc64 hardware is greatly
appreciated, as there will unavoidably be bugs left.

Many thanks go to Roman Divacky for his upstream work on getting the
sparc64 backend into shape.

MFC r262985:

Repair a few minor mismerges from r262261 in the clang-sparc64 project
branch.  This is also to minimize differences with upstream.
2014-03-26 07:31:57 +00:00
emaste
f9534c5185 MFC r263289: Update NetBSD Foundation copyrights to 2-clause BSD
The NetBSD Foundation states "Third parties are encouraged to change the
  license on any files which have a 4-clause license contributed to the
  NetBSD Foundation to a 2-clause license."

  This change removes clauses 3 and 4 from copyright / license blocks that
  list The NetBSD Foundation as the only copyright holder.

Sponsored by:	The FreeBSD Foundation
2014-03-24 13:48:04 +00:00
dim
9cedb8bb69 MFC 261991:
Upgrade our copy of llvm/clang to 3.4 release.  This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC 262121 (by emaste):

Update lldb for clang/llvm 3.4 import

This commit largely restores the lldb source to the upstream r196259
snapshot with the addition of threaded inferior support and a few bug
fixes.

Specific upstream lldb revisions restored include:
   SVN      git
  181387  779e6ac
  181703  7bef4e2
  182099  b31044e
  182650  f2dcf35
  182683  0d91b80
  183862  15c1774
  183929  99447a6
  184177  0b2934b
  184948  4dc3761
  184954  007e7bc
  186990  eebd175

Sponsored by:	DARPA, AFRL

MFC 262186 (by emaste):

Fix mismerge in r262121

A break statement was lost in the merge.  The error had no functional
impact, but restore it to reduce the diff against upstream.

MFC 262303:

Pull in r197521 from upstream clang trunk (by rdivacky):

  Use the integrated assembler by default on FreeBSD/ppc and ppc64.

Requested by:	jhibbits

MFC 262611:

Pull in r196874 from upstream llvm trunk:

  Fix a crash that occurs when PWD is invalid.

  MCJIT needs to be able to run in hostile environments, even when PWD
  is invalid. There's no need to crash MCJIT in this case.

  The obvious fix is to simply leave MCContext's CompilationDir empty
  when PWD can't be determined. This way, MCJIT clients,
  and other clients that link with LLVM don't need a valid working directory.

  If we do want to guarantee valid CompilationDir, that should be done
  only for clients of getCompilationDir(). This is as simple as checking
  for an empty string.

  The only current use of getCompilationDir is EmitGenDwarfInfo, which
  won't conceivably run with an invalid working dir. However, in the
  purely hypothetically and untestable case that this happens, the
  AT_comp_dir will be omitted from the compilation_unit DIE.

This should help fix assertions occurring with ports-mgmt/tinderbox,
when it is using jails, and sometimes invalidates clang's current
working directory.

Reported by:	decke

MFC 262809:

Pull in r203007 from upstream clang trunk:

  Don't produce an alias between destructors with different calling conventions.

  Fixes pr19007.

(Please note that is an LLVM PR identifier, not a FreeBSD one.)

This should fix Firefox and/or libxul crashes (due to problems with
regparm/stdcall calling conventions) on i386.

Reported by:	multiple users on freebsd-current
PR:		bin/187103

MFC 263048:

Repair recognition of "CC" as an alias for the C++ compiler, since it
was silently broken by upstream for a Windows-specific use-case.

Apparently some versions of CMake still rely on this archaic feature...

Reported by:	rakuco

MFC 263049:

Garbage collect the old way of adding the libstdc++ include directories
in clang's InitHeaderSearch.cpp.  This has been superseded by David
Chisnall's commit in r255321.

Moreover, if libc++ is used, the libstdc++ include directories should
not be in the search path at all.  These directories are now only used
if you pass -stdlib=libstdc++.
2014-03-21 17:53:59 +00:00
delphij
ede49d4106 MFC r260150: MFV r259170:
4370 avoid transmitting holes during zfs send

4371 DMU code clean up

illumos/illumos-gate@43466aae47

NOTE: Make sure the boot code is updated if a zpool upgrade is
done on boot zpool.
2014-03-19 23:55:03 +00:00
emaste
6bffb42503 MFC r258892: lldb: Threaded inferior support for FreeBSD
This is in the process of being submitted to the upstream LLDB
  repository.  The thread list functionality is modelled in part on
  GDBRemoteCommunicationClient.

  LLDB bug pr16696 and code review D2267

Sponsored by:	DARPA, AFRL
2014-03-19 13:19:56 +00:00
emaste
de2662087f MFC r258884: Update LLDB to upstream r196259 snapshot
Sponsored by:	DARPA, AFRL
2014-03-19 13:18:42 +00:00
emaste
958843c32b MFC r258054: Update LLDB to upstream r194122 snapshot
Inludes minor changes relative to upstream, for compatibility with
  FreeBSD's in-tree LLVM 3.3:

  - Reverted LLDB r191806, restoring use of previous API.
  - Reverted part of LLDB r189317, restoring previous enum names.
  - Work around missing LLVM r192504, using previous registerEHFrames API
    (limited functionality).
  - Removed PlatformWindows header include and init/terminate calls.

Sponsored by:	DARPA, AFRL
2014-03-19 13:11:35 +00:00
bdrewery
109ba62b95 MFC r263021:
Support Last-Modified behind proxies which return UTC instead of GMT.
2014-03-19 00:53:24 +00:00
davidxu
fedd035484 MFC r263107:
To avoid missing a chance to cancel thread, call _pthread_testcancel at the
beginning of _sem_timedwait.

Submitted by:	Eric van Gyzen &lt; eric at vangyzen dot net &gt;
2014-03-17 05:03:53 +00:00
jhibbits
74bf659c83 MFC r261342
Add hwpmc(4) support for the PowerPC 970 class processors, direct events.
This also fixes asserts on removal of the module for the mpc74xx.

The PowerPC 970 processors have two different types of events: direct events
and indirect events.  Thus far only direct events are supported.  I included
some documentation in the driver on how indirect events work, but support is
for the future.
2014-03-14 00:12:53 +00:00
bapt
f5e5e1abc3 MFC: r262398,r262399,r262410,r262975
Import libucl into head

UCL is heavily infused by nginx configuration as the example of a convenient
configuration system. However, UCL is fully compatible with JSON format and is
able to parse json files.

UCL is used by pkg(8) for its configuration file as well for the manifest format
in packages, it will be used in base for the pkg boostrap (signature checking
and configuration file parsing.)

libucl has been developped and is maintained by vsevolod@
2014-03-11 13:06:09 +00:00
eadler
4ff78f8cbc MFC r262890:
libc man pages: Remove reference to non-existent FreeBSD Security
	Architecture
2014-03-10 00:53:37 +00:00
rwatson
f3010cfb7d Merge r262690 from head to stable/10:
When querying a process's umask via sysctl in libprocstat(), don't
  print a warning if EPERM is returned as this is an expected failure
  mode rather than error -- similar to current handling of ESRCH.
  This makes the output of 'procstat -as' vastly more palatable.

  Sponsored by: DARPA, AFRL
2014-03-09 13:23:49 +00:00
jilles
a48226bb43 MFC r261859: fts: Fix double-free with conflicting concurrent modifications.
If rare conditions such as concurrent conflicting manipulation of the
filesystem occur, fts_read() frees the current FTSENT without adjusting
the pointers in the FTS accordingly. A later fts_close() then frees the
same FTSENT again.
2014-03-07 16:43:08 +00:00
jmmv
fe643776c1 Import atf-0.20.
This is a MFC of r261897 and r262000 and should allow all of the atf
tests to pass.
2014-03-06 14:11:44 +00:00
jmmv
16411e2c80 MFC various fixes for the ATF tests.
- r260505 Allow tests to provide a Kyuafile when they relied on auto-generation.
- r260525 Respect the original layout of the atf-{c,c++} tests.
- r260526 Fix path to the process_helpers for the libatf-c++ tests.
- r260576 Generate and install pkg-config files for atf.
- r260577 Add atf pkg-config files from the vendor branch.
- r260584 Prevent misc_helpers from running as a test.
2014-03-06 13:20:38 +00:00
dim
22ca1336dc MFC r261283:
Import libc++ 3.4 release.  This contains a lot of bugfixes, and some
preliminary support for C++1y.

MFC r261604:

HEAD is not buildable for the past day.  Commit a 'quick fix' in order to permit
buildworld to complete.

Reviewed by:	theraven

MFC r261608:

Apply a cleaner solution for the sign warnings that can occur when
compiling libc++'s <locale> header with -Wsystem-headers on.

This has also been submitted upstream.

Reported by:	asomers

MFC r261801:

An ABI incompatibility crept into the libc++ 3.4 import in r261283.  It
was caused by upstream libc++ commit r194536, which aimed to make the
headers more standards-compliant, by making std::pair's copy constructor
trivial.  Unfortunately, this could cause certain C++ applications using
shared libraries built against the previous version of libc++ to crash.

Fix the ABI incompatibility by making std::pair's copy constructor
non-trivial again.

Please note: Any C++ applications or shared libraries built with libc++
between r261283 and this revision should be recompiled.

Reported by:	stefanf
2014-03-05 19:30:36 +00:00
glebius
1b9278cc98 Merge r261796 from head:
While it isn't too late and kvm_read_zpcpu() function isn't yet used
  outside libkvm(3), change its order of arguments, so that it is the
  same as in kvm_read().
Merge r261805 from head:
  Add kvm_getncpus() to obtain mp_ncpus.
2014-03-04 14:49:05 +00:00
tijl
64a908c935 MFC r262441-262442,262447,262461-262464,262655:
- Consistently pass around context information using a simple pointer.
  This fixes some dereferencing bugs in Chinese character set conversions.
- Fix Simplified Chinese character set conversions by switching around the
  fields of an internal struct so it corresponds with the way variables of
  this type are initialised.
- Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module.
- Silence gcc warning about unsigned comparison with 0.

Also record r258316 and r258587 as merged so they no longer show up as
eligible.

PR:		185964
Submitted by:	Manuel Mausz <manuel-freebsd@mausz.at>
2014-03-04 11:43:01 +00:00
brooks
12b5ca7c28 MFC r261296:
Merge from CheriBSD:
commit c1acf022c533c5ae27e0cd556977eafe3f5959eb
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Jan 17 21:46:44 2014 +0000

	Add an option WITHOUT_NCURSESW to suppress building and linking to
	libncursesw.  While wide character support it useful we'd like to
	only need one ncurses library on embedded systems.

Sponsored by:	DARPA, AFRL
2014-03-01 03:09:16 +00:00
brueffer
691ab829cc MFC: r262296
Match the correct variable to the variable description.

PR:		121173
Submitted by:	Thomas Mueller <tmueller at sysgo.com>
2014-02-28 00:43:27 +00:00
des
f03d4b82a2 MFH (r260904): fix format string
MFH (r261230, r261263): fix buffering issues
MFH (r261284): bump copyright
2014-02-27 13:27:04 +00:00
jhb
69d17427ca MFC 258859,259081,259085,259205,259213,259275,259482,259537,259702,259779:
Several changes to the local APIC support in bhyve:
- Rename 'vm_interrupt_hostcpu()' to 'vcpu_notify_event()'.
- If a vcpu disables its local apic and then executes a 'HLT' then spin
  down the vcpu and destroy its thread context. Also modify the 'HLT'
  processing to ignore pending interrupts in the IRR if interrupts have
  been disabled by the guest.  The interrupt cannot be injected into the
  guest in any case so resuming it is futile.
- Use callout(9) to drive the vlapic timer instead of clocking it on each
  VM exit.
- When the guest is bringing up the APs in the x2APIC mode a write to the
  ICR register will now trigger a return to userspace with an exitcode of
  VM_EXITCODE_SPINUP_AP.
- Change the vlapic timer lock to be a spinlock because the vlapic can be
  accessed from within a critical section (vm run loop) when guest is using
  x2apic mode.
- Fix the vlapic version register.
- Add a command to bhyvectl to inject an NMI on a specific vcpu.
- Add an API to deliver message signalled interrupts to vcpus. This allows
  callers to treat the MSI 'addr' and 'data' fields as opaque and also lets
  bhyve implement multiple destination modes: physical, flat and clustered.
- Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
  'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively.
- Consolidate the virtual apic initialization in a single function:
  vlapic_reset()
- Add a generic routine to trigger an LVT interrupt that supports both
  fixed and NMI delivery modes.
- Add an ioctl and bhyvectl command to trigger local interrupts inside a
  guest.  In particular, a global NMI similar to that raised by SERR# or
  PERR# can be simulated by asserting LINT1 on all vCPUs.
- Extend the LVT table in the vCPU local APIC to support CMCI.
- Flesh out the local APIC error reporting a bit to cache errors and
  report them via ESR when ESR is written to.  Add support for asserting
  the error LVT when an error occurs.  Raise illegal vector errors when
  attempting to signal an invalid vector for an interrupt or when sending
  an IPI.
- Export table entries in the MADT and MP Table advertising the stock x86
  config of LINT0 set to ExtInt and LINT1 wired to NMI.
2014-02-23 00:46:05 +00:00
eadler
b16d23de19 MFC r261824:
libutil/pw_util.3: Fix two prototypes.
2014-02-16 02:33:59 +00:00
brueffer
abe08fc946 MFC: r261447
Fix a typo.
2014-02-10 22:16:22 +00:00
dim
6ceb8edc35 MFC r260553 (by theraven):
Add missing C++11 typeinfos to the libcxxrt version script.

PR:		185663
2014-02-09 00:34:21 +00:00
kib
2adfb67dc9 MFC r261354:
In _pthread_kill(), if passed pthread is current thread, do not send
the signal second time, by adding the missed else before if statement.

PR:	threads/186309
2014-02-08 15:51:24 +00:00
kib
ce48f3b35d MFC r261080:
The posix_fallocate(2) syscall should return error number on error,
without modifying errno.

MFC r261290:
The posix_madvise(3) and posix_fadvise(2) should return error on
failure, same as posix_fallocate(2).
2014-02-06 19:47:17 +00:00
hselasky
4cf659f127 MFC r260315:
Implement two new libusb API functions.

PR:		usb/185454
2014-02-04 10:18:29 +00:00
hselasky
32eb5ff7ac MFC r261224:
Comply to the official LibUSB v1.0 API:
"It is legal to attempt to claim an already-claimed interface."
2014-02-04 08:59:42 +00:00
eadler
ec294fd7f5 MFC r258779,r258780,r258787,r258822:
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.
2014-02-04 03:36:42 +00:00
gshapiro
956642d7ed MFC: Add new sendmail 8.14.8 file 2014-02-01 22:29:04 +00:00
pluknet
3368a0c181 Update EINVAL description. 2014-01-30 05:35:12 +00:00
jhb
e1016866c7 MFC 257422,257661,258075,258476,258494,258579,258609,258699:
Several enhancements to the I/O APIC support in bhyve including:
- Move the I/O APIC device model from userspace into vmm.ko and add
  ioctls to assert and deassert I/O APIC pins.
- Add HPET device emulation including a single timer block with 8 timers.
- Remove the 'vdev' abstraction.

Approved by:	neel
2014-01-23 20:21:39 +00:00
mav
4202d51e16 MFC r258578, r258580, r258581 (by hrs):
Replace Sun RPC license in TI-RPC library with a 3-clause BSD license
with the explicit permissions.
2014-01-22 23:45:27 +00:00
glebius
3b6c6cb1cd Merge r258702: Fix some misinformation in netgraph manual pages. 2014-01-22 10:31:56 +00:00
jilles
f972275c13 MFC r260556: Add some missing .Nm for newer syscalls in existing man pages. 2014-01-18 22:47:25 +00:00
pluknet
a7224392fd MFC r259921,259950:
Provide the manual page for aio_fsync(2).
2014-01-14 09:49:42 +00:00
dim
01c13c7d48 MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc.  This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-09 23:08:56 +00:00
tuexen
c4f2c365c9 MFC r260257:
Fix several bugs in sctp_bindx():
* Set errno to EAFNOSUPPORT if an address is provided which is neither
  AF_INET nor AF_INET6.
* Don't modify the arguments.
* Don't smash the stack when provided with a non-zero port.
* Handle the case correctly where the first address provided is
  an IPv6 address.
2014-01-07 23:51:41 +00:00
dim
1e7deba555 MFC r260003:
In libiconv_modules, surround unused static _citrus_XXX_pack_state() and
_citrus_XXX_unpack_state() functions with #if 0, for now.
2014-01-04 17:27:43 +00:00
pluknet
74494d9239 MFC r259872:
The compile time constant limit on number of swap devices was removed in 5.2.
 As such, remove the EINVAL error saying so.  Currently the vm.nswapdev sysctl
 just represents the number of added swap devices.
2014-01-02 16:37:23 +00:00
dim
5fce04bd49 MFC r257532 (by adrian):
Fix this build for clang.

MFC r259730:

To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:

CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc

In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.

MFC r259913:

For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.

MFC r259927:

Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's
Makefile.

Pointy hat to:	dim
2013-12-30 20:15:46 +00:00
pluknet
5b37933bb7 MFC r259922: Fix an apparent typo. 2013-12-29 09:17:43 +00:00
jmmv
2cc168fb9f Update atf to 0.18 and remove the code of the deprecated tools.
This is a MFC into stable/10 of:
- r258286 Update notes for imports of atf.
- r258289 MFV: Import atf-0.18.
- r258290 Drop all ATF tools code.

This is "make tinderbox" clean as run on ref10-amd64 with the default
WITHOUT_TESTS option.  A "make buildworld" with WITH_TESTS set now works
as well.
2013-12-29 02:57:10 +00:00
jmmv
17b80845b0 Plug the ATF tests into the build.
This is a MFC into stable/10 of:
- r257849 Add libatf-c++ to the prebuild libs.
- r257853 Build and install the atf tests.
- r258233 Move all atf directories to the tests mtree.
- r258285 Fix the build of some ATF tests.

This change is "make tinderbox" clean on ref10-amd64 with the default
settings of WITHOUT_TESTS.  It is likely for the WITH_TESTS build to
still be broken because not all relevant changes have been merged yet.
2013-12-28 23:08:58 +00:00
jmmv
b8ce141a40 Set up the /usr/tests hierarchy.
This is a MFC of the following into stable/10:
- r257097 Set up the /usr/tests hierarchy.
- r257098 Add missing WITHOUTTESTS file.
- r257100 Add a tests(7) manual page.
- r257105 Disable WITHTESTS= for now.
- r257848 Fix buildworld when WITHTESTS is enabled.
- r257850 Subsume the functionality of MKATF into MKTESTS.
- r257851 Handle the removal of the test suite when WITHOUTTESTS=yes.
- r257852 Install category Kyuafiles from their category directories.
- r258232 Install BSD.tests.mtree when MKTESTS is yes.

Note that building with WITH_TESTS is still broken at this point (and
hence why WITHOUT_TESTS is the set as the default).  Subsequent pullups
will fix the remaining issues.
2013-12-28 20:05:31 +00:00
markj
62fbf016fd MFC r258000:
Consistently add the relocation offset only when the ELF type is not
ET_EXEC. This fixes several problems with the DTrace pid provider not
being able to match probes.
2013-12-27 23:00:56 +00:00
markj
c911703d60 MFC r257670:
Modify the libproc breakpoint add/remove functions to stop the target
process if it has not already been stopped, since this is required for
ptrace(2) to work.

libdtrace does not seem to stop target processes before trying to remove
their breakpoints, so we were previously failing to remove the breakpoint
on r_debug_state() in rtld. This was causing processes to die with SIGTRAP
if they called dlopen(3) after dtrace(1) had detached.
2013-12-27 22:30:36 +00:00
markj
c8ab069033 MFC r257300:
Fix an off-by-one error when checking whether a given address is within
the extent of a symbol.
2013-12-27 22:19:19 +00:00
jmmv
e125f95c9c Split and extend bsd.test.mk into {atf,plain,tap}.test.mk.
This is a MFC of:

- r256761 Clearly split the logic to build ATF and plain tests apart.
- r256762 Add the automatic generation of Atffile files.
- r256763 Add the automatic generation of Kyuafile files.
- r256764 Plug atf-run into the 'test' target.
- r256765 Plug kyua into the 'test' target.
- r257096 Move the TESTSBASE definition to bsd.own.mk.
- r257099 Add missing plain.test.mk.
- r258297 Remove registration of C++ test programs into PROGS.
- r258298 Fix the build of plain test programs.
- r258551 Install plain.test.mk.
- r259208 Add tap.test.mk.

Approved by:	rpaulo (mentor)
2013-12-27 22:00:22 +00:00
markj
d6a22c4af9 MFC r256661 r257222 r257235 r257248 r257298.
MFC r256661:
Fix the libproc build when DEBUG is defined.

MFC r257222:
Clean up the debug printing in libproc a bit. In particular:

* Don't print any error messages to stderr unless DEBUG is defined.
* Add a DPRINTFX macro for use when errno isn't set.
* Print the error string from libelf when appropriate.

MFC r257235:
Remove an incorrect debug printf.

MFC r257248:
Fix the build with gcc.

MFC r257298:
Revert r257248 and fix the problem in a way that doesn't violate style(9).
2013-12-25 22:36:27 +00:00
dim
fef52f4b6c MFC r259473:
Enable llvm's integrated assembler for PowerPC, since it should now be
good enough for typical usage.

Requested by:	rdivacky
2013-12-24 14:26:31 +00:00
kib
a455348768 MFC r259042:
Do not force to run atexit handlers, which text comes from a dso owning
the handle passed to __cxa_finalize() but which are registered by other
dso, when the process is inside exit(3).
2013-12-13 05:54:30 +00:00