add an MI api for atomic ops in the kernel. this api has its origins in solaris, but we found it via netbsd.
add an MI api for atomic ops in the kernel. this api has its origins in
solaris, but we found it via netbsd.

this provides an MI implementation by using gccs atomic builtins. if an
arch wants to provide a better implementation it can simply provide the
specific bit of the api it wants to replace as a macro.

we're being conservative with this API and only providing it in the
kernel, and only for uints, ulongs, and pointers.

discussed at n2k14 and with hackers at length.
ok kettenis@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars