PC-BSD/trueos 065b960stand/common part.c disk.c, stand/efi/libefi efi_console.c

MFC r345066, r347219-r347220, r347223, r347388-r347389, r347391, r347393,
r347553, r348040

r345066:
stand: Improve some debugging experience

Some of these files using <FOO>_DEBUG defined a DEBUG() macro to serve as a
debug-printf. -DDEBUG is useful to enable some debugging output across
multiple ELF/common parts, so switch the DEBUG-as-printf macros over to
something more like DPRINTF that is more commonly used for this kind of
thing and less likely to conflict.

userboot/elf64_freebsd debugging also assumed %llx for uint64; use PRIx64
instead.

r347219:
loader: use safer DPRINTF body for non-debug case

r347220:
loader: bcache code does not need to check argument for free()

r347223:
command_bcache() does not use argv

Therefore mark argv __unused.

r347388:
loader: implement proper 8 char tab stops

The current console code is printing out 8 spaces for tab, calculate
the amount of spaces based on tab stops.

r347389:
loader: ptable_print() needs two tabs sometimes

Since the partition/slice names do vary in length, check the length
of the fixed part of the line against 3 * 8, if the lenth is less than
3 tab stops, print out extra tab.

use snprintf() instead of sprintf.

r347391:
loader: no-TERM_EMU is broken now

If TERM_EMU is not defined, we do not have curx variable. Use conout mode
for efi and expose get_pos() for i386.

r347393:
loader: use DPRINTF in biosdisk.c and define safe DPRINTF

r345066 did miss biosdisk.c.

Also define DPRINTF as ((void)0) for case we do not want debug printouts.

r347553:
loader: fix memory handling errors in module.c

file_loadraw():
check for file_alloc() and strdup() results.
we leak 'name'.

mod_load() does leak 'filename'.

mod_loadkld() does not need to check fp, file_discard() does check.

r348040:
stand: TARGET_ARCH is spelled MACHINE_ARCH in Makefiles
DeltaFile
+35-35stand/common/part.c
+30-16stand/common/disk.c
+12-12stand/i386/libi386/biosdisk.c
+15-7stand/i386/libi386/vidconsole.c
+17-2stand/common/module.c
+8-10stand/common/bcache.c
+6-4stand/efi/libefi/efi_console.c
+4-4stand/common/interp_forth.c
+4-1stand/userboot/userboot/elf64_freebsd.c
+1-1stand/powerpc/Makefile
+132-9210 files

UnifiedSplitRaw