]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader: provide a features table for binary compatibility advertisement
authorKyle Evans <kevans@FreeBSD.org>
Fri, 8 Dec 2023 21:36:06 +0000 (15:36 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 8 Dec 2023 21:43:19 +0000 (15:43 -0600)
commit1631382cf2820245cc72965498ff174bb548dd63
tree3238efa8e062160fb3aaca4259736501aa2d3d38
parentf959fcafb506225be6b662516992edf8bf22b543
loader: provide a features table for binary compatibility advertisement

liblua now provides a loader.has_feature() function to probe the loader
binary for features advertised.  name => desc mappings are provided in
loader.features to get a list of all of the features loader *can*
support.  core.hasFeature is provided as a shim to loader.has_feature
so that individual consumers don't need to think about the logic of the
loader module not providing has_feature; we know that means the feature
isn't enabled.

The first consumer of this will be EARLY_ACPI to advertise that the
loader binary probes for ACPI presence before the interpreter has
started, so that we know whether we can trust the presence of acpi.rsdp
as relatively authoritative.  In general, it's intended to be used to
avoid breaking new scripts on older loaders within reason.

This will be used in lua as `core.hasFeature("EARLY_ACPI")`, while the
C bits of loader will `feature_enable(FEATURE_EARLY_ACPI)`.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42695
stand/liblua/lutils.c
stand/libsa/Makefile
stand/libsa/features.c [new file with mode: 0644]
stand/libsa/libsa.3
stand/libsa/stand.h
stand/lua/core.lua
stand/lua/core.lua.8