File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ SUBDIR.${MK_LOADER_IA32}+= libefi32
77SUBDIR.${MK_FDT}+ = fdt
88SUBDIR.yes+ = libacpi
99SUBDIR.${MK_LOADER_IA32}+ = libacpi32
10+ SUBDIR.yes+ = ../liblua
1011SUBDIR.yes+ = .WAIT
1112
1213SUBDIR.yes+ = boot1 gptboot
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ CFLAGS+= -DEFI
7272
7373.if ${MACHINE} == "amd64" && ${DO32 :U0} == 0
7474CFLAGS+ = -I${EFISRC}/libacpi/acpi/include
75+ CFLAGS+ = -I${EFISRC}/../liblua/acpi/include
7576.endif
7677
7778.if defined(HAVE_FDT) && ${MK_FDT} != "no"
@@ -127,6 +128,20 @@ LDFLAGS+= -Wl,--threads=1
127128
128129CLEANFILES+ = ${LOADER}.efi
129130
131+ # ACPI Lua bindings compile set
132+ .if ${__arch} == "amd64" && ${DO32 :U0} == 0 && ${LOADER} == "loader_lua"
133+ LACPI_COMPILE_SET = -j set_lua_acpi_modules
134+ .else
135+ LACPI_COMPILE_SET =
136+ .endif
137+
138+ # To protect ACPI init and lua bindings
139+ .if ${LOADER} == "loader_lua"
140+ CFLAGS+ = -DLACPI=1
141+ .else
142+ CFLAGS+ = -DLACPI=0
143+ .endif
144+
130145${LOADER}.efi : ${PROG}
131146 @if ${NM} ${.ALLSRC} | grep ' U ' ; then \
132147 echo " Undefined symbols in ${.ALLSRC} " ; \
@@ -137,6 +152,7 @@ ${LOADER}.efi: ${PROG}
137152 -j .dynamic -j .dynsym -j .rel.dyn \
138153 -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
139154 -j set_X${LOADER_INTERP} _compile_set \
155+ ${LACPI_COMPILE_SET} \
140156 --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
141157
142158LIBEFI = ${BOOTOBJ}/efi/libefi/libefi.a
Original file line number Diff line number Diff line change 6767#include "acconfig.h"
6868#define ACPI_SYSTEM_XFACE
6969
70- #if defined(__amd64__ )
70+ #if defined(__amd64__ ) && LACPI
7171#include <init_acpi.h>
72+ #include <lacpi.h>
7273#else
7374#include <acpi.h>
7475#endif
@@ -1235,11 +1236,13 @@ main(int argc, CHAR16 *argv[])
12351236
12361237 devinit ();
12371238
1238- #if defined(__amd64__ )
1239+ #if defined(__amd64__ ) && LACPI
12391240 /* Initialize ACPI Subsystem and Tables. */
12401241 if ((ret = init_acpi ()) != 0 ) {
12411242 printf ("Failed to initialize ACPI\n." );
12421243 }
1244+
1245+ lacpi_interp_ref ();
12431246#endif
12441247
12451248 /*
You can’t perform that action at this time.
0 commit comments