Copy i386 psl.h to x86 and replace amd64/i386/pc98 psl.h with stubs.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233204 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Copy i386 specialreg.h to x86 and merge with amd64 specialreg.h. Replace
amd64/i386/pc98 specialreg.h with stubs.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233207 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a witness panic introduced in r231797.

Reported by:	bschmidt
Reviewed by:	jhb
Pointy hat to:	jkim
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233208 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Copy amd64 sysarch.h to x86 and merge with i386 sysarch.h. Replace
amd64/i386/pc98 sysarch.h with stubs.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Delay sequence number allocation for A-MPDU until just before the frame
is queued to the hardware.

Because multiple concurrent paths can execute ath_start(), multiple
concurrent paths can push frames into the software/hardware TX queue
and since preemption/interrupting can occur, there's the possibility
that a gap in time will occur between allocating the sequence number
and queuing it to the hardware.

Because of this, it's possible that a thread will have allocated a
sequence number and then be preempted by another thread doing the same.
If the second thread sneaks the frame into the BAW, the (earlier) sequence
number of the first frame will be now outside the BAW and will result
in the frame being constantly re-added to the tail of the queue.
There it will live until the sequence numbers cycle around again.

This also creates a hole in the RX BAW tracking which can also cause
issues.

This patch delays the sequence number allocation to occur only just before
the frame is going to be added to the BAW.  I've been wanting to do this
anyway as part of a general code tidyup but I've not gotten around to it.
This fixes the PR.

However, it still makes it quite difficult to try and ensure in-order
queuing and dequeuing of frames. Since multiple copies of ath_start()
can be run at the same time (eg one TXing process thread, one TX completion
task/one RX task) the driver may end up having frames dequeued and pushed
into the hardware slightly/occasionally out of order.

And, to make matters more annoying, net80211 may have the same behaviour -
in the non-aggregation case, the TX code allocates sequence numbers
before it's thrown to the driver.  I'll open another PR to investigate
this and potentially introduce some kind of final-pass TX serialisation
before frames are thrown to the hardware.  It's also very likely worthwhile
adding some debugging code into ath(4) and net80211 to catch when/if this
does occur.

PR:		kern/166190


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
o Xr siftr.4 in order to expose it to a wider audience.

Reviewed by:	lstewart


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233229 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve device tree blob (DTB) handling in loader(8).

Enable using the statically embedded blob from the kernel, if present. The KLD
loaded DTB takes precedence, but they are both recognized and handled in the
same way.

Submitted by:	Lukasz Wojcik
Obtained from:	Semihalf
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233230 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix several problems with our ELF filters implementation.

Do not relocate twice an object which happens to be needed by loaded
binary (or dso) and some filtee opened due to symbol resolution when
relocating need objects.  Record the state of the relocation
processing in Obj_Entry and short-circuit relocate_objects() if
current object already processed.

Do not call constructors for filtees loaded during the early
relocation processing before image is initialized enough to run
user-provided code.  Filtees are loaded using dlopen_object(), which
normally performs relocation and initialization.  If filtee is
lazy-loaded during the relocation of dso needed by the main object,
dlopen_object() runs too earlier, when most runtime services are not
yet ready.

Postpone the constructors call to the time when main binary and
depended libraries constructors are run, passing the new flag
RTLD_LO_EARLY to dlopen_object().  Symbol lookups callers inform
symlook_* functions about early stage of initialization with
SYMLOOK_EARLY.  Pass flags through all functions participating in
object relocation.

Use the opportunity and fix flags argument to find_symdef() in
arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of
true, which happen to have the same numeric value.

Reported and tested by:	theraven
Reviewed by:	kan
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update the list of struct ifnet fields.
- Document if_vnet, if_home_vnet, if_carp, if_vlantrunk, if_multiaddrs,
  if_amcount, if_addr, if_llsoftc stub, if_broadcastaddr, if_bridge,
  if_label, if_afdata, if_afdata_initialized, if_afdata_lock, if_linktask,
  if_addr_mtx (now if_addr_lock), if_clones, if_groups, if_pf_kif, if_lagg,
  if_alloctype
- G/c now defunct and/or commented out in the manual page if_ipending,
  if_poll_slowq, if_done, if_poll_recv, if_poll_xmit, if_poll_slowinput,
  if_poll_intren
- Update if_snd type changed with ALTQ integration.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Import new version of libcxxrt.  Now works correctly with libobjc2 to implement
the unified exception model for Objective-C++.

Approved by:	dim (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add sys/ofed to the 'make cscope' target.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233236 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix another witness panic.  We cannot enter critical section at all because
AcpiEnterSleepState() executes (optional) _GTS method since ACPICA 20120215
(r231844).  To evaluate the method, we need malloc(9), which may sleep.

Reported by:	bschmidt
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge ACPICA 20120320.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Re-commit this - store the alq payload in network order.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Eliminate vm.pmap.shpgperproc and vm.pmap.pv_entry_max because they no
longer serve any purpose.  Prior to r157446, they served a purpose
because there was a fixed amount of kernel virtual address space
reserved for pv entries at boot time.  However, since that change pv
entries are accessed through the direct map, and so there is no limit
imposed by a fixed amount of kernel virtual address space.

Fix a couple of nearby style issues.

Reviewed by:	jhb, kib
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233256 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't run through time checks when entry is definitely oversized. This
leads to newsyslog rotating on (size OR time) if both are specified.

PR:		100018, 160432


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a sentence in a paragraph that describes time and interval based
trimming. This sentence vaguely can be interpreted as if it was speaking
about time and size interaction, while it wasn't about it.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use version 2 of semaphore provided by kernel umtx code, now if there is
no waiters, we still increase and decrease count in user mode without
entering kernel, once there is a waiter, sem_post will enter kernel to
increase count and wake thread up, this is atomicy and allow us to
gracefully destroy semaphore after sem_wait returned.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert previous change. It is an incomplete change from old branch. :-(


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add multibyte char support.

PR:		165429
Submitted by:	amdmi3


git-svn-id: svn+ssh://svn.freebsd.org/base/head@233269 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f