Add counter to keep track of the number of timer interrupts generated by
the local apic for each virtual cpu.


git-svn-id: svn://svn.freebsd.org/base/head@248938 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix xdev. Clang and libc were not building correctly on older worlds, for
example, on 9.1.
 * To fix clang add an _xb-bootstrap-tools target that mirrors the existing
   bootstrap-tools target in the full world.
 * For libc have the compiler use the newly installed includes, and, while
   here, tell the compiler about the xdev library path as some other
   libraries will link against the installed libraries.


git-svn-id: svn://svn.freebsd.org/base/head@248940 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix xdev-install when installing to a location other than /


git-svn-id: svn://svn.freebsd.org/base/head@248941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a typo in the CF device driver name that prevented instantiation.


git-svn-id: svn://svn.freebsd.org/base/head@248944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rename do_pipe() to kern_pipe2() and declare it properly.


git-svn-id: svn://svn.freebsd.org/base/head@248951 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a macro for checking for IPv4 link local addresses.

MFC after: 1 week


git-svn-id: svn://svn.freebsd.org/base/head@248953 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When running on armv6, set alignment checking to modulo-4 mode rather
than modulo-8, because clang emits ldrd and strd instructions for
addresses that are only 4-byte aligned.


git-svn-id: svn://svn.freebsd.org/base/head@248961 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When running on armv6, set alignment checking to modulo-4 mode rather
than modulo-8, because clang emits ldrd and strd instructions for
addresses that are only 4-byte aligned


git-svn-id: svn://svn.freebsd.org/base/head@248962 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Accommodate uart devices with large FIFOs (or DMA buffers which amount
to the same thing) by allocating the uart(4) rx buffer based on the
device's rxfifosz rather than using a hard-coded size of 384 bytes.

The  historical 384 byte size is 3 times the largest hard-coded fifo
size in the tree, so use that ratio as a guide and allocate the buffer
as three times rxfifosz, but never smaller than the historical size.


git-svn-id: svn://svn.freebsd.org/base/head@248963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable hardware flow control and high speed bulk data transfer in at91 uarts.

Changes to make rtc/cts flow control work...

This does not turn on the builtin hardware flow control on the SoC's usart
device, because that doesn't work on uart1 due to a chip erratum (they
forgot to wire up pin PA21 to RTS0 internally).  Instead it uses the
hardware flow control logic where the tty layer calls the driver to assert
and de-assert the flow control lines as needed.  This prevents overruns at
the tty layer (app doesn't read fast enough), but does nothing for overruns
at the driver layer (interrupts not serviced fast enough).

To work around the wiring problem with RTS0, the driver reassigns that pin
as a GPIO and controls it manually.  It only does so if given permission via
hint.uart.1.use_rts0_workaround=1, to prevent accidentally driving the pin
if uart1 is used without flow control (because something not related to
serial IO could be wired to that pin).

In addition to the RTS0 workaround, driver changes were needed in the area
of reading the current set of DCE signals.  A priming read is now done at
attach() time, and the interrupt routine now sets SER_INT_SIGCHG when any
of the DCE signals change.  Without these changes, nothing could ever be
transmitted, because the tty layer thought CTS was de-asserted (when in fact
we had just never read the status register, and the hwsig variable was
init'd to CTS de-asserted).

Changes to support bulk high-speed (230kbps and higher) data reception...

Allow the receive fifo size to be tuned with hint.uart.<dev>.fifo_bytes.
For high speed receive, a fifo size of 1024 works well.  The default is
still 128 bytes if no hint is provided.  Using a value larger than 384
requires a change in dev/uart/uart_core.c to size the intermediate
buffer as MAX(384, 3*sc->sc_rxfifosize).

Recalculate the receive timeout whenever the baud rate changes.  At low
baud rates (19.2kbps and below) the timeout is the number of bits in 2
characters.  At higher speed it's calculated to be 500 microseconds
worth of bits.  The idea is to compromise between being responsive in
interactive situations and not timing out prematurely during a brief
pause in bulk data flow.  The old fixed timeout of 1.5 characters was
just 32 microseconds at 460kbps.

At interrupt time, check for receiver holding register overrun status
and set the corresponding status bit in the return value.

When handling a buffer overrun, get a single buffer emptied and handed
back to the hardware as quickly as possible, then deal with the second
buffer.  This at least minimizes data loss compared to the old logic
that fully processed both buffers before restarting the hardware.

Rewrite the logic for handling buffers after a receive timeout.  The
original author speculated in a comment that there may be a race with
high speed data.  There was, although it was rare.  The code now handles
all three possible scenarios on receive timeout: two empty buffers, one
empty and one partial buffer, or one full and one partial buffer.

Reviewed by:	imp


git-svn-id: svn://svn.freebsd.org/base/head@248964 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix low-level uart drivers that set their fifo sizes in the softc too late.

uart(4) allocates send and receiver buffers in attach() before it calls
the low-level driver's attach routine.  Many low-level drivers set the
fifo sizes in their attach routine, which is too late.  Other drivers set
them in the probe() routine, so that they're available when uart(4)
allocates buffers.  This fixes the ones that were setting the values too
late by moving the code to probe().


git-svn-id: svn://svn.freebsd.org/base/head@248965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'