Commit Graph

212742 Commits

Author SHA1 Message Date
Adrian Chadd
bcc2d75c36 [spigen] add the userland ioctl API for spigen. 2016-05-27 01:40:33 +00:00
Adrian Chadd
03c34e1b1d [gpiospi] add debug option.
This was missing from the previous commit that introduced gpiospi.
It's required for it to build.

Pointy-hat-to: me
2016-05-27 01:36:29 +00:00
Ian Lepore
3bf5c797c0 Only build gpio modules on armv6, until it's known that they can be built
succesfully on other arches.
2016-05-27 01:14:35 +00:00
Glen Barber
279dc9ca3d Make Makefile.mirrors -ALPHA${N}-aware.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-05-27 01:07:48 +00:00
Glen Barber
f40383e102 Update head from 11.0-CURRENT to 11.0-ALPHA1, marking the official
start of the code slush.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-05-27 00:01:48 +00:00
Ian Lepore
62e4e3735a Revert changes for local testing, inadvertantly commited in r300811. 2016-05-26 23:59:42 +00:00
Ian Lepore
128e3872b9 Add a PPS driver that takes the timing pulse from a gpio pin. Currently
supports only ofw/fdt systems.  Some day, hinted attachment for non-fdt
systems should be possible too.
2016-05-26 23:56:12 +00:00
John Baldwin
4e865d9eb0 Fix unit number of EFI net interfaces and ignore psuedo network interfaces.
In r277943, the efinet_match() routine was changed to use an off by one
when matching network interfaces.  The effect was that using "net1"
actually used the device attached to "net0".

Digging into the hardware that needed this workaround more, I found that
UEFI was creating two simple network protocol devices for each physical
NIC.  The first device was a "raw" Ethernet device and the second device
was a "IP" device that used the IP protocol on top of the underlying
"raw" device.  The PXE code in the firmware used the "IP" device to pull
across the loader.efi, so currdev was set to "net1" when booting from the
physical interface "net0".  (The loaded image's device handle referenced
the "IP" device that "net1" claimed.)

However, the IP device isn't suitable for doing raw packet I/O (and the
current code to open devices exclusively actually turns the "IP" devices
off on these systems).

To fix, change the efinet driver to only attach to "raw" devices.  This
is determined by fetching the DEVICE_PATH for each handle which supports
the simple network protocol and examining the last node in the path.  If
the last node in the path is a MAC address, the device is assumed to be
a "raw" device and is added as a 'netX' device.  If the last node is not
a MAC address, the device is ignored.

However, this causes a new problem as the device handle associated with
the loaded image no longer matches any of the handles enumerated by
efinet for systems that load the image via the "IP" device.  To handle
this case, expand the logic that resolves currdev from the loaded image
in main().  First, the existing logic of looking for a handle that
matches the loaded image's handle is tried.  If that fails, the device
path of the handle that loaded the loaded image is fetched via
efi_lookup_image_devpath().  This device path is then walked from the
end up to the beginning using efi_handle_lookup() to fetch the handle
associated with a path.  If the handle is found and is a known handle,
then that is used as currdev.  The effect for machines that load the
image via the "IP" device is that the first lookup fails (the handle
for the "IP" device isn't claimed by efinet), but walking up the
image's device path finds the handle of the raw MAC device which is used
as currdev.

With these fixes in place, the hack to subtract 1 from the unit can now
be removed, so that setting currdev to 'net0' actually uses 'net0'.

PR:		202097
Tested by:	ambrisko
Sponsored by:	Cisco Systems
2016-05-26 23:32:28 +00:00
Bryan Drewery
23ae5cd74e filemon exec: Use imgp->execpath rather than vn_fullpath(9).
This will be more accurate as the actual name is provided if ran
from an absolute path in do_execve().

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:27:08 +00:00
Bryan Drewery
6a0899c5ed DIRDEPS_BUILD: Add a Makefile.depend
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:44 +00:00
Bryan Drewery
38f6966b70 DIRDEPS_BUILD: Fix and hookup rescue/rescue to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:40 +00:00
Bryan Drewery
eb9b07bb77 WITH_AUTO_OBJ: Fix crunchgen builds.
Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse
WITH_AUTO_OBJ and cause it to create a recursed object directory that
then broke the actual prog build.  This is normally not a problem since
we do not call 'make -f prog.mk obj' before building anything in it.

Crunchgen(1) also assumes that if -o is not passed then if an object
directory does not already exist then it should build in the source
directories.  The normal buildworld process will have already ran 'make
obj' in each of the component directories so this is not a problem.
With WITH_AUTO_OBJ though this is not the case.  So we must tell
crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not
require it be present before generating its Makefile.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:36 +00:00
Bryan Drewery
b3d8f67703 Don't strip paths away from META_XTRAS.
This would otherwise disallow using meta files from a foreign build that
spread them around in directories outside our own .OBJDIR.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:33 +00:00
Bryan Drewery
8ab3985652 Avoid redundant 'make objs' tree-walk when building the main prog.
The main prog has a dependency on the submake targets to ensure they are
built.  From bsd.crunchgen.mk though we already have our own dependency
on 'make objs' so there is no need for another one.  Crunchgen(1) is
doing the right thing here so it is not modified.

This also prevents the CC fix tainting the submake environment with
META_MODE and causing rebuilds.  The CC passed is is only intended for
the main prog itself.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:30 +00:00
Bryan Drewery
ec02e5e3ba Pass CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS to the main crunch exec build.
This fixes --sysroot and other CFLAGS/LDFLAGS not being respected
in the crunchgen build since it is not including bsd.sys.mk and
other files.  For example, this fixes building rescue itself without
--sysroot and other CFLAGS.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:27 +00:00
Bryan Drewery
a13e2ac519 WITH_META_MODE: Only expect a .meta file for the main target.
Since multiple files are generated from one build command, only
the first to run will actually generate a .meta file.  This fix
prevents 'required but missing' rebuilds on each target.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:24 +00:00
Bryan Drewery
409bf2b097 DIRDEPS_BUILD: Don't show finished stats, which confuses crunchgen(1).
It would show 'make error:' lines for each auto object directory created.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:20 +00:00
Bryan Drewery
74c5734766 Use netinet/in.h to avoid include/arpa dependency for DIRDEPS_BUILD.
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:17 +00:00
Bryan Drewery
4977354760 Add some missing .PHONY.
These are relevant for WITH_META_MODE to ensure they are
always reran and don't generate a .meta file.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:14 +00:00
Bryan Drewery
863ad6d555 DIRDEPS_BUILD: Build the kernel in the same place as buildkernel would.
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:10 +00:00
Bryan Drewery
07ed5ac100 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:07 +00:00
Bryan Drewery
7c75c54f37 Fix MAKESYSPATH not being sent to sub-makes after r266566.
Because bmake defaults to .../share/mk now, this code was not doing anything
to help objdir builds (such as the rescue build).  Export the same default.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:04 +00:00
Bryan Drewery
016448a507 WITH_META_MODE: Move the kernel support to kern.pre.mk.
This allows using META_MODE directly from the kernel build directory.
This also allows removing a hack from the DIRDEPS_BUILD kernel target.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 23:20:01 +00:00
Bryan Drewery
2d86a958e2 Remove leftover _crunchide from r283108 2016-05-26 23:19:57 +00:00
Bryan Drewery
1afd78b34d exec: Provide execpath in imgp for the process_exec hook.
This was previously set after the hook and only if auxargs were present.
Now always provide it if possible.

MFC after:	2 weeks
Reviewed by:	kib
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6546
2016-05-26 23:19:39 +00:00
Bryan Drewery
881010f05d exec: Add credential change information into imgp for process_exec hook.
This allows an EVENTHANDLER(process_exec) hook to see if the new image
will cause credentials to change whether due to setgid/setuid or because
of POSIX saved-id semantics.

This adds 3 new fields into image_params:
  struct ucred *newcred		Non-null if the credentials will change.
  bool credential_setid		True if the new image is setuid or setgid.

This will pre-determine the new credentials before invoking the image
activators, where the process_exec hook is called.  The new credentials
will be installed into the process in the same place as before, after
image activators are done handling the image.

MFC after:	2 weeks
Reviewed by:	kib
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6544
2016-05-26 23:18:54 +00:00
John Baldwin
8f7ada2196 Use a unique error message if we fail to find the simple network protocol.
While here, fix the various net driver callbacks to return early instead
of crashing if this fails.  (The 'init' callback from the netif interface
doesn't return an error if the protocol lookup fails.)

Sponsored by:	Cisco Systems
2016-05-26 23:08:57 +00:00
John Baldwin
72bc6425a9 Apply the printf %S band-aid for efinet.c to fix the arm64 build. 2016-05-26 23:07:20 +00:00
John Baldwin
b4f9242404 Remove second copy of the -Wno-format band-aid for printf %S. 2016-05-26 23:06:36 +00:00
Andriy Voskoboinyk
0676206626 rtwn, urtwn: drop unused structures.
urtwn(4) uses another implementation of command queue; rtwn(4) don't need
it at all.
2016-05-26 22:43:02 +00:00
Ian Lepore
5030d499e7 Add a convenience function to get a gpio pin's capabilties. 2016-05-26 22:35:52 +00:00
Ian Lepore
e3f2d7af0e Add support for triggering interrupts on both rising and falling edges.
Also, EOI a gpio interrupt in the post_ithread routine before re-enabling.
2016-05-26 22:34:25 +00:00
John Baldwin
e06f8144fb Use routines from the recently added devpath.c.
These efipart layer did several devpath related operations inline.  This
just switches it over to using shared code for working with device paths.

Sponsored by:	Cisco Systems
2016-05-26 22:13:40 +00:00
Don Lewis
ef94ebfc88 Include the new AQM files when compiling a kernel with options DUMMYNET.
Reported by:	Nikolay Denev <nike_d AT cytexbg DOT com>
MFC after:	2 weeks (with r300779)
2016-05-26 22:07:09 +00:00
Don Lewis
248c72bfb8 Correct a typo in a comment.
MFC after:	2 weeks (with r300779)
2016-05-26 22:03:28 +00:00
John Baldwin
79ad8397ea Output the device path description for EFI network devices.
Lookup the DEVICE_PATH for each EFI network device handle and output the
string description using printf with '%S'.  To honor the pager, the newline
at the end of each line is still output with pager_output().

Sponsored by:	Cisco Systems
2016-05-26 21:48:39 +00:00
Don Lewis
4e59799e1b Modify BOUND_VAR() macro to wrap all of its arguments in () and tweak
its expression to work on powerpc and sparc64 (gcc compatibility).

Correct a typo in a nearby comment.

MFC after:	2 weeks (with r300779)
2016-05-26 21:44:52 +00:00
John Baldwin
3e5a19be71 Add some routines for working with EFI DEVICE_PATH objects.
- efi_lookup_devpath() uses the DEVICE_PATH_PROTOCOL to obtain the
  DEVICE_PATH for a given EFI handle.
- efi_lookup_image_devpath() uses the LOADED_IMAGE_DEVICE_PATH_PROTOCOL
  to lookup the device path of the device used to load a loaded image.
- efi_devpath_name() uses the DEVICE_PATH_TO_TEXT_PROTOCOL to generate
  a string description of a device path.  The returned string is a CHAR16
  string that can be printed via the recently added '%S' format in
  libstand's printf().  Note that the returned string is returned in
  allocated storage that should be freed by calling
  efi_free_devpath_name().
- efi_devpath_last_node() walks a DEVICE_PATH returning a pointer to the
  final node in the path (not counting the terminating node).  That is,
  it returns a pointer to the last meaninful node in a DEVICE_PATH.
- efi_devpath_trim() generates a new DEVICE_PATH from an existing
  DEVICE_PATH.  The new DEVICE_PATH does not include the last
  non-terminating node in the original path.  If the original DEVICE_PATH
  only contains the terminating node, this function returns NULL.
  The caller is responsible for freeing the returned DEVICE_PATH via
  free().
- efi_devpath_handle() attempts to find a handle that corresponds to a
  given device path.  However, if nodes at the end of the device path do
  not have valid handles associated with them, this function will return
  a handle that matches a node earlier in the device path.  In particular,
  this function returns a handle for the node closest to the end of the
  device path which has a valid handle.

Sponsored by:	Cisco Systems
2016-05-26 21:43:22 +00:00
Don Lewis
91336b403a Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE).
Centre for Advanced Internet Architectures

Implementing AQM in FreeBSD

* Overview <http://caia.swin.edu.au/freebsd/aqm/index.html>

* Articles, Papers and Presentations
  <http://caia.swin.edu.au/freebsd/aqm/papers.html>

* Patches and Tools <http://caia.swin.edu.au/freebsd/aqm/downloads.html>

Overview

Recent years have seen a resurgence of interest in better managing
the depth of bottleneck queues in routers, switches and other places
that get congested. Solutions include transport protocol enhancements
at the end-hosts (such as delay-based or hybrid congestion control
schemes) and active queue management (AQM) schemes applied within
bottleneck queues.

The notion of AQM has been around since at least the late 1990s
(e.g. RFC 2309). In recent years the proliferation of oversized
buffers in all sorts of network devices (aka bufferbloat) has
stimulated keen community interest in four new AQM schemes -- CoDel,
FQ-CoDel, PIE and FQ-PIE.

The IETF AQM working group is looking to document these schemes,
and independent implementations are a corner-stone of the IETF's
process for confirming the clarity of publicly available protocol
descriptions. While significant development work on all three schemes
has occured in the Linux kernel, there is very little in FreeBSD.

Project Goals

This project began in late 2015, and aims to design and implement
functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE
in FreeBSD (with code BSD-licensed as much as practical). We have
chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall
and traffic shaper. Implementation of these AQM schemes in FreeBSD
will:
* Demonstrate whether the publicly available documentation is
  sufficient to enable independent, functionally equivalent implementations

* Provide a broader suite of AQM options for sections the networking
  community that rely on FreeBSD platforms

Program Members:

* Rasool Al Saadi (developer)

* Grenville Armitage (project lead)

Acknowledgements:

This project has been made possible in part by a gift from the
Comcast Innovation Fund.

Submitted by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
X-No objection:	core
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6388
2016-05-26 21:40:13 +00:00
Emmanuel Vadot
30068a1de9 Add support for interrupts, sensors and GPIO for AXP209 PMIC.
Pressing the PEK (power enable key) will shutdown the board.
Some events are reported to devd via system "PMU" and subsystem
"Battery", "AC" and "USB" such as connected/disconnected.
Some sensors values (power source voltage/current) are reported via
sysctl (dev.axp209_pmu.X.)
It also expose a gpioc node usable in kernel and userland. Only 3 of
the 4 GPIO are exposed (The GPIO3 is different and mostly unused on
boards). Most popular boards uses GPIO1 as a sense pin for OTG power.
Add a dtsi file that adds gpio-controller capability to the device as
upstream doesn't defined it and include it in our custom DTS.

Reviewed by:	jmcneill
Approved by:	cognet (mentor)
Differential Revision:	https://reviews.freebsd.org/D6135
2016-05-26 21:09:07 +00:00
Glen Barber
32a4dda86d Remove vestigial cloudware-install bits missed in r300767.
Sponsored by:	The FreeBSD Foundation
2016-05-26 21:08:44 +00:00
Ed Schouten
3005a8755a Let l64a() properly null terminate its result.
Though the buffer used by l64a() is initialized with null bytes,
repetetive calls may end up having trailing garbage of previous
invocations because we don't end up terminating the string.

Instead of importing NetBSD's fix, use this opportunity to simplify this
function dramatically, for example by just storing the Base64 character
set in a string. There is also no need to do the bitmasking, as we can
just use the proper integer type from <stdint.h>.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D6511
2016-05-26 20:55:15 +00:00
Conrad Meyer
5f4ea90bbe Ifndef KERNEL the userspace-only routines in sys/md[45].h
A follow-up to r300773.  Nothing in the kernel uses those definitions, but
apparently libmd includes the sys/md45 headers.  Fix the build.

Reported by:	gjb
Pointy-hat:	cem
Sponsored by:	EMC / Isilon Storage Division
2016-05-26 20:37:49 +00:00
Conrad Meyer
571ebf7685 crypto routines: Hint minimum buffer sizes to the compiler
Use the C99 'static' keyword to hint to the compiler IVs and output digest
sizes.  The keyword informs the compiler of the minimum valid size for a given
array.  Obviously not every pointer can be validated (i.e., the compiler can
produce false negative but not false positive reports).

No functional change.  No ABI change.

Sponsored by:	EMC / Isilon Storage Division
2016-05-26 19:29:29 +00:00
Jung-uk Kim
ccabe8433f Fix style(9). 2016-05-26 19:17:51 +00:00
Jung-uk Kim
a42aa5facd Use bit_count(3) instead of four bitcount32() calls.
Reviewed by:	asomers, ngie
Differential Revision:	https://reviews.freebsd.org/D6543
2016-05-26 18:57:26 +00:00
Dimitry Andric
9729cf0934 Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision
numbers):

r242679 Implement the plugin-based version of std::search. There are no
        searchers yet; those are coming soon.
r242682 Implement the default searcher for std::experimental::search.
r243728 Add <experimental/any> v2.
r245330 implement more of N4258 - Cleaning up noexcept in the standard
        library. Specifically add new noexcept stuff to vector and
	string's move-assignment operations
r245334 Fix PR22606 - Leak pthread_key with static storage duration to
        ensure all of thread-local destructors are called.
r245335 Fix PR23589: std::function doesn't recognize null pointer to
        varargs function.
r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool
        searchers for the LFTS.
r249325 Implement LWG#2063, and update the issues links to point to the
        github generated pages
r249738 Split <ctype.h> out of <cctype>.
r249739 Split <errno.h> out of <cerrno>.
r249740 Split <float.h> out of <cfloat>.
r249741 Split <inttypes.h> out of <cinttypes>.
r249742 Split <math.h> out of <cmath>.
r249743 Split <setjmp.h> out of <csetjmp>.
r249761 Split <stddef.h> out of <cstddef>.
r249798 Split <stdio.h> out of <cstdio>.
r249800 Split <stdlib.h> out of <cstdlib>.
r249889 Split <wchar.h> out of <cwchar>.
r249890 Split <wctype.h> out of <cwctype>.
r249929 Split <string.h> out of <cstring>.
r250254 ABI versioning macros for libc++.
r251246 Fix LWG#2244: basic_istream::seekg
r251247 Fix LWG#2127: Move-construction with raw_storage_iterator.
r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable
r251257 Fix LWG#2489: mem_fn() should be noexcept
r251618 Implement P0004R1 'Remove Deprecated iostreams aliases'
r251766 Implement the first part of P0006R0: Adopt Type Traits Variable
        Templates for C++17.
r252195 Implement P0092R1 for C++1z
r252350 Allow deque to handle incomplete types.
r252406 More of P0006R0: type traits variable aliases for C++17.
r252407 Implement LWG#2353: std::next is over-constrained
r252905 Implement P0074: Making owner_less more flexible
r253215 Implement P0013R1: Logical Operator Type Traits.
r253274 Implement P0007: Constant View: A proposal for a std::as_const
        helper function template.
r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque
        that the allocator's value_type match the container's value_type.
r254283 Implement more of P0006; Type Traits Variable Templates.
r255941 LWG2485: get() should be overloaded for const tuple&&.
r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default
        constructors.
r256652 Fix for ALL undefined behavior in <list>.
r256859 First half of LWG#2354: 'Unnecessary copying when inserting
        into maps with braced-init syntax'

Exp-run:	antoine
Relnotes:	yes
2016-05-26 18:52:49 +00:00
Luiz Otavio O Souza
d3dd020425 Only do the touch screen setup when the 'ti,wires' property is present.
While here fix a typo in a debug message.
2016-05-26 18:52:26 +00:00
Glen Barber
4a6675067d Update a commented line to replace recently-removed images with
images that are published.

Sponsored by:	The FreeBSD Foundation
2016-05-26 18:50:57 +00:00
Glen Barber
7a2a1785bd Remove the cw*-install target.
All operations are performed on the original output file,
and nothing is ever done with the copied file (as in, no
modifications and/or publication from the copied file).

Sponsored by:	The FreeBSD Foundation
2016-05-26 18:48:37 +00:00