History log of /freebsd-head/stand/libsa/stand.h
Revision Date Author Comments
bd07d9deb2ca6cf6fe294055eab155beb28a681a 29-Mar-2020 tsoome <tsoome@FreeBSD.org> loader: use #elif defined() in stand.h

Small cleanup.

Reported by: imp
5a3b5908df37fe27dfe64b6c0b790fdfb20b3d1a 28-Mar-2020 tsoome <tsoome@FreeBSD.org> loader: add knob to build with user malloc

This option is intended to aid development, to allow building with user malloc.
The use case would be to build userboot & test with libc (or other) malloc and
use extra malloc debug features.
d796054bd9f5e911d41eef7e03026dd4f91590d3 20-Feb-2020 imp <imp@FreeBSD.org> Create ptov() function.

Create a ptov() function. It's basically the same as the btx PTOV
macro, but works everywhere. smbios needs this to translate addresses,
but the translation differs between BIOS booting and EFI booting. Make
it a function so one smbios.o can be used everywhere. Provide
definitions for it in the two loaders affected.

Differential Revision: https://reviews.freebsd.org/D23660
e7dfb8eab46fe5a1f133d6da90972af7f4e269f4 24-Oct-2019 sjg <sjg@FreeBSD.org> Add support for hypervisor check on x86

Add ficl words for isvirtualized
and move ficl inb and outb words to ficl/x86/sysdep.c
so can be shared by i386 and amd64

Reviewed by: imp bdrewery
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D22069
05e4fd4021323adb17eff79e2b19553e7b516276 17-Sep-2019 tsoome <tsoome@FreeBSD.org> loader: add memalign() to libsa

Implement memalign(size_t alignment, size_t size) to allocate aligned memory.
4cfe6366237f3712a5645ac66bafd2c0ef8f257e 17-Sep-2019 tsoome <tsoome@FreeBSD.org> loader: stand.h should define reallocf as Reallocf

Use the same approach as other zalloc functions.
0ea6c510f82f43db625145219844d04fb47d0a9a 25-Jun-2019 imp <imp@FreeBSD.org> Remove NAND and NANDFS support

NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes: Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745
dcddd844b793c2cced93dbfbdde6de1ccbc5b3cc 24-Jun-2019 bcran <bcran@FreeBSD.org> loader: add HTTP support using UEFI

Add support for an HTTP "network filesystem" using the UEFI's HTTP
stack.

This also supports HTTPS, but TianoCore EDK2 implementations currently
crash while fetching loader files.
Only IPv4 is supported at the moment. IPv6 support is planned for a
follow-up changeset.

Note that we include some headers from the TianoCore EDK II project in
stand/efi/include/Protocol verbatim, including links to the license instead
of including the full text because that's their preferred way of
communicating it, despite not being normal FreeBSD project practice.

Submitted by: scottph
Reviewed by: imp, bcran
Differential Revision: https://reviews.freebsd.org/D20643
60c18c4d555cedbf351128a3b83db9bbe514adc1 24-May-2019 sjg <sjg@FreeBSD.org> ficl pfopen: verify file

If the file is verified - do not allow write
otherwise do not allow read.

Add O_ACCMODE to stand.h

Reviewed by: stevek, mindal_semihalf.com
MFC after: 3 days
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D20387
e9b9f14056349028ca14e521e2913ffbbe212310 17-Jan-2019 tsoome <tsoome@FreeBSD.org> libsa: add asprintf()

asprintf() is a nice tool for string processing.

MFC after: 2 weeks
98ec7f96c88d372812718e2f7addfd27e67b433b 05-Jun-2018 ian <ian@FreeBSD.org> Make the v*printf() functions in libsa return int instead of void.
This makes them compatible with the C standard signatures, avoiding
spurious mismatch errors in the places where the oddball requirements
of standalone code end up putting two declarations of the same function
in play.
c5e6cf93737eb0e424292725384cf618c14be595 05-Jun-2018 ian <ian@FreeBSD.org> Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h.

I'm not sure why the v*printf() functions in libsa return void instead of
int, but this maintains that convention for the new function.
9ee90910b81737de3630010624a15a97f628261f 12-Mar-2018 imp <imp@FreeBSD.org> Remove d_type from devdesc. It's not needed as we can fetch it from
d_dev->dv_type when we need it.
63b1228fa2653950cba1e7b4c7cfd2daa5dc7e2f 12-Mar-2018 imp <imp@FreeBSD.org> Minor cosmetic changes.

Make sure { on the same line as struct for all struct *devdesc. Move
some type definitions to next to the dv_type define, since that's what
sets the d_type.
9ad97faf9e1c30f6f151fd28364fb5a65c518aae 24-Feb-2018 kevans <kevans@FreeBSD.org> liblua: Implement write support

Write support (even if it only works on UFS) will be needed for nextboot
functionality.

Reviewed by: cem, imp
Differential Revision: https://reviews.freebsd.org/D14478
28fcfa7aa28d9fef85118015ee1cf3575d91feea 24-Feb-2018 cem <cem@FreeBSD.org> libsa: Change write(2)-alike prototype to match definition

Broken in r329879.

Apparently old GCC detects this, but modern GCC didn't. Mea culpa.

Reported by: np
Sponsored by: Dell EMC Isilon
23d934d39200db1337a08b67cacbcd24279c7877 23-Feb-2018 cem <cem@FreeBSD.org> libsa: Const-ify buffer argument of write(2) analog

Reported by: kevans
Reviewed by: delphij, eadler, imp, kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14482
f701b3199c7604274a38bc1d0e3e593db4bbe5fa 02-Feb-2018 imp <imp@FreeBSD.org> Implement strcoll as strcmp.
086d3e503373da6ae64819f4a5403e2ec33f483d 31-Jan-2018 imp <imp@FreeBSD.org> Update stand.h for changes for strto*l

Move prototypes to proper section now that we don't have modified
versions of strtol and strtoul in libsa. Add prototypes for new
strtoll and strtoull. Use prototypes copied from stdlib.h instead of
the old hand-rolled ones.

(I forgot to move this file form my lua branch in r328613)
bd3d902d417c6b27d920734009a574a48551baff 26-Jan-2018 imp <imp@FreeBSD.org> abort() should be marked __dead2 since it won't return.
7ceca2a58a939dfd44e4d5a9c8fd2fb7312bfd81 26-Jan-2018 imp <imp@FreeBSD.org> Provide abs form stdlib.h.

Sponsored by: Netflix
8c8c3f558c94b7d58e55a87cad0c4e13532a088d 26-Jan-2018 imp <imp@FreeBSD.org> Implement abort() as a call to panic.

Sponsored by: Netflix
0c57de7acba37446d0a58b2b08c87bae87539b84 26-Jan-2018 imp <imp@FreeBSD.org> Split panic routine

Split panic routine so that the 'Hit Any Key to continue' behavior can
be overriden.

Sponsored by: Netflix
764185505bfbcb6c2840417a43eca7e080ff23c2 12-Jan-2018 imp <imp@FreeBSD.org> Move getsecs() prototype to stand.h from net.h so it can be used
everywhere.

Sponsored by: Netflix
97b17432b4cb956ba000b96c1c7d6e2c93ac6312 31-Dec-2017 ian <ian@FreeBSD.org> Add a validbcd() routine that uses the bcd2bin_data[] array and returns a
bool indicating whether the input value represents a valid BCD byte.

The existing bcd2bin() routine will KASSERT if asked to convert a bad value,
but sometimes the kernel has to handle BCD data from untrusted sources, so
this will provide a mechanism to validate data before attempting conversion.

This would be have easier/cleaner if the bcd2bin_data[] array contained an
out-of-range value (such as 0xff) in the infill locations that aren't valid,
but it's a global symbol that might be referenced by out-of-tree code
relying on the current scheme, so I'm leaving that alone.
614ead52a09fd0c0ab7e4558994a9c71d2524f63 15-Dec-2017 imp <imp@FreeBSD.org> 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
fdba3fb09c92a550c29298810a6d903fb6ee65b3 08-Dec-2017 imp <imp@FreeBSD.org> Provide implementations for iscntrl, ispunct and isgraph.

Sponsored by: Netflix
6bb46c6f8f2eb90f4b8a267be7879c3681dacdc4 08-Dec-2017 imp <imp@FreeBSD.org> Remove _KERNEL hack now that errno.h does the right thing when
_STANDALONE is defined.

Sponsored By: Netflix
1fb5990587bf77fd72d77a686dc37ec7c17ec52d 08-Dec-2017 imp <imp@FreeBSD.org> Add partial support signal.h functioanlity. Pull in machine/signal.h
to define sig_atomic_t.

Sponsored by: Netflix
8fcb35206976906a21596e5c79a0fa5a850f97cc 06-Dec-2017 imp <imp@FreeBSD.org> Fix random() prototype to match the system.

Sponsored by: Netflix
1f7bf6a7f693be54ed9a55acdeafd89870191cdc 06-Dec-2017 imp <imp@FreeBSD.org> Make putenv and getenv match the userland definition of these
functions, tweak man page and one variable that shouldn't be const
anymore.

Sponsored by: Netflix
20d9ab0d193a70b32508aa9b6a608e804e78bae4 02-Dec-2017 imp <imp@FreeBSD.org> Fix random() and srandom() prototypes to match the standard.

These prototypes were needlessly different from the standard. Fix them
to be the same, and fix the surrounding code after the changes.

Sponsored by: Netflix
433bd38e3a0349f9f89f9d54594172c75b002b74 14-Nov-2017 imp <imp@FreeBSD.org> Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix