summaryrefslogtreecommitdiff
path: root/com32/lua
diff options
context:
space:
mode:
authorGeert Stappers <stappers@stappers.nl>2010-07-01 21:14:38 +0200
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-01 14:27:31 -0700
commit809c6671fc2e2eb156f2385d65becf756996cc1b (patch)
tree67649eedf2017b768c5a6c43e1455f5a68dc631f /com32/lua
parentd5872766e499376994c7a56a1c4c9e8fcc6c874c (diff)
downloadsyslinux-809c6671fc2e2eb156f2385d65becf756996cc1b.tar.gz
lua: update for Syslinux 4
Update the lua code to work with Syslinux 4.
Diffstat (limited to 'com32/lua')
-rw-r--r--com32/lua/src/Makefile10
-rw-r--r--com32/lua/src/dmi.c12
2 files changed, 16 insertions, 6 deletions
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 07ae9e6b..72f2a2a7 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 b1337401..0c89ea9a 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);