File tree Expand file tree Collapse file tree 6 files changed +21
-20
lines changed Expand file tree Collapse file tree 6 files changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ SUBDIR.${MK_LOADER_IA32}+= libefi32
7
7
SUBDIR.${MK_FDT}+ = fdt
8
8
SUBDIR.yes+ = libacpi
9
9
SUBDIR.${MK_LOADER_IA32}+ = libacpi32
10
+ SUBDIR.yes+ = ../liblua
10
11
SUBDIR.yes+ = .WAIT
11
12
12
13
SUBDIR.yes+ = boot1 gptboot
@@ -17,7 +18,9 @@ SUBDIR.${MK_LOADER_IA32}+= loader_ia32
17
18
SUBDIR.yes+ = loader_simp
18
19
19
20
.if !defined(MK_FORTH) && !defined(MK_LOADER_IA32) && defined(MK_LOADER_LUA)
20
- SUBDIR.yes+ = liblua
21
+ CFLAGS+ = -DLACPI=1
22
+ .else
23
+ CFLAGS+ = -DLACPI=0
21
24
.endif
22
25
23
26
.include <bsd.subdir.mk>
Original file line number Diff line number Diff line change @@ -128,6 +128,12 @@ LDFLAGS+= -Wl,--threads=1
128
128
129
129
CLEANFILES+ = ${LOADER}.efi
130
130
131
+ .if ${__arch} == "amd64" && ${DO32 :U0} == 0
132
+ LACPI_COMPILE_SET = -j set_lua_acpi_modules
133
+ .else
134
+ LACPI_COMPILE_SET =
135
+ .endif
136
+
131
137
${LOADER}.efi : ${PROG}
132
138
@if ${NM} ${.ALLSRC} | grep ' U ' ; then \
133
139
echo " Undefined symbols in ${.ALLSRC} " ; \
@@ -138,6 +144,7 @@ ${LOADER}.efi: ${PROG}
138
144
-j .dynamic -j .dynsym -j .rel.dyn \
139
145
-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
140
146
-j set_X${LOADER_INTERP} _compile_set \
147
+ ${LACPI_COMPILE_SET} \
141
148
--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
142
149
143
150
LIBEFI = ${BOOTOBJ}/efi/libefi/libefi.a
@@ -155,9 +162,4 @@ LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBSAFDT} ${LIBEFI_FDT} ${LIBSA} \
155
162
${LIBACPI}
156
163
.endif
157
164
158
- .if ${__arch} == "amd64" && ${DO32 :U0} == 0
159
- DPADD+ = ${LIBLUA}
160
- LDADD+ = ${LIBLUA}
161
- .endif
162
-
163
165
.include <bsd.prog.mk>
Original file line number Diff line number Diff line change 68
68
#define ACPI_SYSTEM_XFACE
69
69
70
70
// If defined amd64 && loader_lua
71
- #if defined(__amd64__ ) && defined( MK_LOADER_LUA )
71
+ #if defined(__amd64__ ) && LACPI
72
72
#include <init_acpi.h>
73
73
#include <lacpi.h>
74
74
#else
@@ -1237,7 +1237,7 @@ main(int argc, CHAR16 *argv[])
1237
1237
1238
1238
devinit ();
1239
1239
1240
- #if defined(__amd64__ ) && defined( MK_LOADER_LUA )
1240
+ #if defined(__amd64__ ) && LACPI
1241
1241
/* Initialize ACPI Subsystem and Tables. */
1242
1242
if ((ret = init_acpi ()) != 0 ) {
1243
1243
printf ("Failed to initialize ACPI\n." );
Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ SRCS+= lhash.c
32
32
# ACPI
33
33
.if ${MACHINE_CPUARCH} == "amd64" && ${DO32 :U0} == 0
34
34
.PATH : ${LIBLUASRC}/acpi
35
+
35
36
SRCS+ = lacpi.c lacpi_object.c lacpi_utils.c lacpi_walk.c lacpi_data.c
37
+
36
38
CFLAGS+ = -I${SYSDIR}/contrib/dev/acpica/include \
37
39
-I${EFISRC}/libacpi/acpi/include -I${EFISRC}/include \
38
40
-I${EFISRC}/include/amd64 -I${LIBLUASRC}/acpi/include
41
+
39
42
DPADD+ = ${LIBACPI}
40
43
LDADD+ = ${LIBACPI}
41
44
.endif
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ lua_acpi_bindings(lua_State *L)
46
46
(* mod )-> init (L );
47
47
lua_setglobal (L , (* mod )-> mod_name );
48
48
}
49
-
50
- luaopen_lacpi (L );
51
- lua_setglobal (L , "lacpi" );
52
49
}
53
50
54
51
/*
@@ -57,9 +54,7 @@ lua_acpi_bindings(lua_State *L)
57
54
void
58
55
lua_acpi_register_hook (void )
59
56
{
60
- if (acpi_is_initialized ()) {
61
- lua_acpi_register = lua_acpi_bindings ;
62
- }
57
+ lua_acpi_register = lua_acpi_bindings ;
63
58
}
64
59
65
60
LUA_ACPI_COMPILE_SET (lacpi , luaopen_lacpi );
Original file line number Diff line number Diff line change 1
- local lacpi = require (" lacpi" )
2
-
3
1
local function test_walk_namespace ()
4
- local nodes = lacpi .walk .dump_namespace () -- returns table of tables
2
+ local nodes = lacpi .walk .namespace () -- returns table of tables
5
3
6
4
-- Print them in Lua
7
5
for _ , node in ipairs (nodes ) do
8
- print (node .level , node .path , node .HID or " " , node .UID or " " )
6
+ print (node .level , node .path , node .HID , node .UID )
9
7
end
10
8
11
- return " SUCCESS" ;
9
+ return " SUCCESS"
12
10
end
13
11
14
- print (" --- TEST BEGIN: WALK NS ---" );
12
+ print (" --- TEST BEGIN: WALK NS ---" )
15
13
16
14
status = test_walk_namespace ()
17
15
You can’t perform that action at this time.
0 commit comments