vt(4): Adjust the cursor position after changing the window size

A new terminal_set_cursor() is added: it wraps the existing
teken_set_cursor() function.

In vtbuf_grow(), the cursor position is adjusted at the end of the
function. In vt_change_font(), we call terminal_set_cursor() just after
terminal_set_winsize_blank(), while the terminal is mute.

This fixes a bug where, after loading a kernel video driver which
increases the terminal window size, the cursor remains at its old
position, in other words, in the middle of the display content.

PR:		194421
MFC after:	1 week
Don't prune duplicate services in the expected output from /etc/services on
FreeBSD

Submitted by: pho
Start to allow platforms other than U-Boot to use the FDT code in loader by
moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This
needs to be a new library for linking to work correctly.

Differential Revision:	https://reviews.freebsd.org/D1054
Reviewed by:	ian, rpaulo (earlier version)
MFC after:	1 week
Port tests to FreeBSD/Linux

Some of the testcases don't work outside of NetBSD, and the behavior of
ether_aton_r differs between FreeBSD, Linux, and NetBSD, and the calls to the
API need to be massaged for FreeBSD and Linux.

Submitted by: pho
Port lib/libc/net/h_dns_server to FreeBSD

Submitted by: pho
HBSD: change console from secure to insecure in etc/ttys

github-issue: #5
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
Port lib/libc/sys/t_dup to FreeBSD/Linux

- The requirements differ between FreeBSD/Linux when dealing with oldd/newd
  being equal (both fail with EINVAL, not EBADF)
- Add an EBADF testcase
- Fix compilation issues on clang

In collaboration with: pho
getitimer on FreeBSD returns the last set time instead of the remaining time;
test for that instead

Submitted by: pho
HBSD AMD64: increase VM_MIN_ADDRESS from 0 to 65536

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
Remove duplicate macro settings (probably due to an SVN merge /faux pas/ on my part.

Spotted by: DES
Approved by:	DES(implicit)
HBSD: change /var/run/dmesg.boot permissions in security.bsd.unprivileged_read_msgbuf != 1 case

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
HBSD: verbose HBSD/PaX logs may contains sensitive informations, change
the log files permissions

github-issue: #3
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
HBSD: OP-HBSD kernel config - fixed annoying compile error with custom keymaps

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
Change the order of the arguments to file_loadraw(). They were swapped
as of r262345 when file_loadraw() was made public and this little detail
got overlooked during porting.

Obtained from:	Juniper Networks, Inc.
Updates to the list of CPUs supported by the amd64 platform

MFC after:	3 days
Skip :sethostname_basic because it messes up the test host's hostname

Convert code from #if defined(__FreeBSD__) to #ifdef __FreeBSD__
Port t_kevent to FreeBSD

Submitted by: pho
Port t_mincore to FreeBSD

Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug
discovered in running the tests (it succeeded from earlier on in the year to
September/October on FreeBSD, at least)

Submitted by: pho
Port h_atexit to FreeBSD

__cxa_atexit varies between FreeBSD and NetBSD, and thus we must use pointers
instead of static fields in the BSS. More extensive discussion is included in
the source code

In collaboration with: kib
Submitted by: pho
Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes