liblua: Add loader.machine and loader.machine_arch properties

Provisioned from MACHINE/MACHINE_ARCH on the system, expose loader.machine
and loader.machine_arch respectively.

These may be used to hide ACPI option on non-applicable archs.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14446
This commit is contained in:
Kyle Evans 2018-02-20 18:24:20 +00:00
parent f2b32f473e
commit 2630b89b56
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329650

View File

@ -28,6 +28,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include "lua.h"
#include "lauxlib.h"
#include "lstd.h"
@ -263,6 +265,11 @@ int
luaopen_loader(lua_State *L)
{
luaL_newlib(L, loaderlib);
/* Add loader.machine and loader.machine_arch properties */
lua_pushstring(L, MACHINE);
lua_setfield(L, -2, "machine");
lua_pushstring(L, MACHINE_ARCH);
lua_setfield(L, -2, "machine_arch");
return 1;
}