Commit Graph

6 Commits

Author SHA1 Message Date
Kyle Evans
054564747d beri loader: Replace getc/putc with beri_ prefixed versions
This matches a convention that we use, at least in ubldr, to prefix
getc/putc with a loader-specific prefix to avoid collisions. This was
encountered while trying to build the beri loader with MK_LOADER_LUA=yes.

No objection from:	brooks
Reported by:	emaste
2018-03-12 03:54:38 +00:00
John Baldwin
349b6dad63 Use <stand.h> instead of <inttypes.h> and <stdio.h> in boot code.
In the freestanding boot compile environment, standard headers are not
available.  Curiously, only building with clang exposed this as compiles
with external GCC still succeeded.

Sponsored by:	DARPA / AFRL
2018-01-08 18:47:35 +00:00
John Baldwin
48ccf80238 Use 'extern uint8_t' instead of 'extern void' for external symbols.
The beri boot loaders depend on symbols defined in linker scripts or
assembly files.  The boot loaders do not care about the type of these
symbols but just want to extract a pointer to them.  Older versions of
GCC permitted external symbols to be declared of type 'void' and then
'&foo' generated a void pointer to the memory at the symbol's address.
However, void objects are not valid C and newer versions of GCC error if
these are used.  Instead, declare these symbols as being bytes (or
an array of bytes in the cheri_sdcard_vaddr case).

Sponsored by:	DARPA / AFRL
2018-01-03 17:40:51 +00:00
Warner Losh
6562843997 Remove the 'mini libstand in libstand' that util.[ch] provided. These
weren't needed, and their existance interfered with things in subtle
ways. One of these subtle ways was that malloc could be different
based on what files were included when (even within the same .c file,
it turns out). Move to a single malloc implementation as well by
adding the calls to setheap() to gptboot.c and zfsboot.c. Once upon a
time, these boot loaders strove to not use libstand. However, with the
proliferation of features, that striving is too hard for too little
gain and lead to stupid mistakes.

This fixes the GELI-enabled (but not even using) boot environment. The
geli routines were calling libstand malloc but zfsboot.c and gptboot.c
were using the mini libstand malloc, so this failed when we tried to
probe for GELI partitions. Subtle changes in build order when moving
to self-contained stand build in r326593 toggled what it used from one
type to another due to odd nesting of the zfs implementation code that
differed subtly between zfsloader and zfsboot.

Sponsored by: Netflix
2017-12-15 23:16:53 +00:00
Warner Losh
0979948fe2 Tweaks to the beri boot loader so that it builds w/o warnings.
Sponsored by: Netflix
2017-12-02 00:07:31 +00:00
Warner Losh
ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00