[syslinux:lua] lua: update for Syslinux 4
syslinux-bot for Geert Stappers
stappers at stappers.nl
Thu Jul 1 14:30:03 PDT 2010
Commit-ID: 809c6671fc2e2eb156f2385d65becf756996cc1b
Gitweb: http://syslinux.zytor.com/commit/809c6671fc2e2eb156f2385d65becf756996cc1b
Author: Geert Stappers <stappers at stappers.nl>
AuthorDate: Thu, 1 Jul 2010 21:14:38 +0200
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Thu, 1 Jul 2010 14:27:31 -0700
lua: update for Syslinux 4
Update the lua code to work with Syslinux 4.
---
com32/lua/src/Makefile | 10 ++++++++--
com32/lua/src/dmi.c | 12 ++++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 07ae9e6..72f2a2a 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -31,6 +31,7 @@ CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
-fomit-frame-pointer -D__COM32__ \
-nostdinc -iwithprefix include \
-I../../libutil/include -I../../include \
+ -I../../gplinclude \
-Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
LNXCFLAGS = -W -Wall -O -g -I../../libutil/include
LNXSFLAGS = -g
@@ -39,7 +40,9 @@ SFLAGS = -D__COM32__ -march=i386
LDFLAGS = -T ../../lib/com32.ld
OBJCOPY = objcopy
LIBGCC := $(shell $(CC) --print-libgcc)
-LIBS = liblua.a ../../libutil/libutil_com.a ../../lib/libcom32.a $(LIBGCC)
+LIBS = liblua.a ../../libutil/libutil_com.a \
+ ../../gpllib/libcom32gpl.a \
+ ../../lib/libcom32.a $(LIBGCC)
LNXLIBS = ../../libutil/libutil_lnx.a
.SUFFIXES: .lss .c .o .elf .c32 .lnx
@@ -52,7 +55,7 @@ LIBLUA_OBJS += syslinux.o
LIBLUA_OBJS += lauxlib.o lbaselib.o ldblib.o ltablib.o \
lstrlib.o loadlib.o linit.o
LIBLUA_OBJS += liolib.o
-LIBLUA_OBJS += dmi.o ../../modules/dmi.o
+LIBLUA_OBJS += dmi.o
CFLAGS += -DLUA_ANSI
@@ -62,6 +65,8 @@ liblua.a: $(LIBLUA_OBJS)
$(AR) cq $@ $^
$(RANLIB) $@
+lua.elf: lua.o liblua.a
+ $(LD) --emit-relocs $(LDFLAGS) -o $@ lua.o $(LIBS) $(LNXLIBS)
.PRECIOUS: %.o
@@ -90,6 +95,7 @@ liblua.a: $(LIBLUA_OBJS)
%.c32: %.elf
$(OBJCOPY) -O binary $< $@
+ ../../tools/relocs $< >> $@ || ( rm -f $@ ; false )
tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d
diff --git a/com32/lua/src/dmi.c b/com32/lua/src/dmi.c
index b133740..0c89ea9 100644
--- a/com32/lua/src/dmi.c
+++ b/com32/lua/src/dmi.c
@@ -15,7 +15,8 @@ static int dmi_gettable(lua_State *L)
lua_newtable(L);
- if ( ! dmi_interate() ) {
+ /* FIXME initalize *dmi */
+ if ( ! dmi_iterate(&dmi) ) {
printf("No DMI Structure found\n");
return -1;
}
@@ -231,8 +232,8 @@ static int dmi_gettable(lua_State *L)
lua_pushnumber(L, dmi.processor.signature.minor_stepping);
lua_settable(L,-3);
- lua_pushstring(L, "processor.voltage");
- lua_pushnumber(L, dmi.processor.voltage);
+ lua_pushstring(L, "processor.voltage_mv");
+ lua_pushnumber(L, dmi.processor.voltage_mv);
lua_settable(L,-3);
lua_pushstring(L, "processor.status");
@@ -276,7 +277,10 @@ static int dmi_gettable(lua_State *L)
static int dmi_supported(lua_State *L)
{
- if ( dmi_interate() ) {
+ s_dmi dmi;
+
+ /* FIXME initalize *dmi */
+ if ( dmi_iterate(&dmi) ) {
lua_pushboolean(L, 1);
} else {
lua_pushboolean(L, 0);
More information about the Syslinux-commits
mailing list