[syslinux:master] libupload: New library to manage uploads
syslinux-bot for Erwan Velu
erwanaliasr1 at gmail.com
Mon Apr 25 15:27:44 PDT 2011
Commit-ID: 997985d79e5813e8a33e82fb0cc0c0f08cf2c55d
Gitweb: http://syslinux.zytor.com/commit/997985d79e5813e8a33e82fb0cc0c0f08cf2c55d
Author: Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Tue, 15 Mar 2011 21:51:46 +0100
Committer: Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Tue, 15 Mar 2011 21:58:47 +0100
libupload: New library to manage uploads
This commit creates a library to upload content via 3 backends
(srec/ymodem/tftp).
Code came from sysdump and got librarized for being used more easily
by more other com32 modules.
---
com32/Makefile | 2 +-
com32/libupload/.gitignore | 2 +
com32/{gpllib => libupload}/Makefile | 20 +++-----
com32/{sysdump => libupload}/cpio.c | 12 ++--
com32/{sysdump => libupload}/ctime.c | 0
com32/{sysdump => libupload}/ctime.h | 0
com32/{sysdump => libupload}/serial.c | 0
com32/{sysdump => libupload}/serial.h | 0
com32/{sysdump => libupload}/srecsend.h | 0
com32/libupload/upload_backend.h | 55 ++++++++++++++++++++
.../{sysdump/be_srec.c => libupload/upload_srec.c} | 8 ++--
.../{sysdump/be_tftp.c => libupload/upload_tftp.c} | 8 ++--
.../be_ymodem.c => libupload/upload_ymodem.c} | 8 ++--
com32/{sysdump => libupload}/ymodem.txt | 0
com32/{sysdump => libupload}/zout.c | 10 ++--
com32/sysdump/Makefile | 2 +-
com32/sysdump/acpi.c | 10 ++--
com32/sysdump/backend.h | 55 --------------------
com32/sysdump/cpuid.c | 4 +-
com32/sysdump/dmi.c | 8 ++--
com32/sysdump/main.c | 20 ++++----
com32/sysdump/memmap.c | 6 +-
com32/sysdump/memory.c | 6 +-
com32/sysdump/pci.c | 6 +-
com32/sysdump/sysdump.h | 16 +++---
com32/sysdump/vesa.c | 4 +-
26 files changed, 129 insertions(+), 133 deletions(-)
diff --git a/com32/Makefile b/com32/Makefile
index b090c40..da632a1 100644
--- a/com32/Makefile
+++ b/com32/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = tools lib gpllib libutil modules mboot menu samples rosh cmenu \
+SUBDIRS = libupload tools lib gpllib libutil modules mboot menu samples rosh cmenu \
hdt gfxboot sysdump lua/src
all tidy dist clean spotless install:
diff --git a/com32/libupload/.gitignore b/com32/libupload/.gitignore
new file mode 100644
index 0000000..e0292b1
--- /dev/null
+++ b/com32/libupload/.gitignore
@@ -0,0 +1,2 @@
+*.o
+*.a
diff --git a/com32/gpllib/Makefile b/com32/libupload/Makefile
similarity index 58%
copy from com32/gpllib/Makefile
copy to com32/libupload/Makefile
index a174061..c009b6b 100644
--- a/com32/gpllib/Makefile
+++ b/com32/libupload/Makefile
@@ -1,15 +1,11 @@
-#
-# LGPL/GPL code library
-#
-
# Include configuration rules
topdir = ../..
include ../lib/MCONFIG
-REQFLAGS += -I../gplinclude
+REQFLAGS += -I./
-GPLDIRS := . disk dmi vpd acpi
-LIBOBJS := $(foreach dir,$(GPLDIRS),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
+SUBDIRS := .
+LIBOBJS := $(foreach dir,$(SUBDIRS),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
BINDIR = /usr/bin
LIBDIR = /usr/lib
@@ -18,9 +14,9 @@ AUXDIR = $(DATADIR)/syslinux
INCDIR = /usr/include
COM32DIR = $(AUXDIR)/com32
-all: libcom32gpl.a
+all: libcom32upload.a
-libcom32gpl.a : $(LIBOBJS)
+libcom32upload.a : $(LIBOBJS)
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
@@ -33,12 +29,10 @@ spotless: clean
rm -f *.a
rm -f *~ \#* */*~ */\#*
-# Mixing in the GPL include files is suboptimal, but I'm not sure
-# there is a better way to do it.
install: all
mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
- install -m 644 libcom32gpl.a $(INSTALLROOT)$(COM32DIR)
+ install -m 644 libcom32upload.a $(INSTALLROOT)$(COM32DIR)
mkdir -p $(INSTALLROOT)$(COM32DIR)/include/
- cp -r ../gplinclude $(INSTALLROOT)$(COM32DIR)/include/
+ cp -r *.h $(INSTALLROOT)$(COM32DIR)/include/
-include .*.d */.*.d */*/.*.d
diff --git a/com32/sysdump/cpio.c b/com32/libupload/cpio.c
similarity index 80%
rename from com32/sysdump/cpio.c
rename to com32/libupload/cpio.c
index 81d0d4b..b3e1eb7 100644
--- a/com32/sysdump/cpio.c
+++ b/com32/libupload/cpio.c
@@ -9,10 +9,10 @@
#include <inttypes.h>
#include <stdbool.h>
#include <zlib.h>
-#include "backend.h"
+#include "upload_backend.h"
#include "ctime.h"
-int cpio_pad(struct backend *be)
+int cpio_pad(struct upload_backend *be)
{
static char pad[4]; /* Up to 4 zero bytes */
if (be->dbytes & 3)
@@ -21,7 +21,7 @@ int cpio_pad(struct backend *be)
return 0;
}
-int cpio_hdr(struct backend *be, uint32_t mode, size_t datalen,
+int cpio_hdr(struct upload_backend *be, uint32_t mode, size_t datalen,
const char *filename)
{
static uint32_t inode = 2;
@@ -52,12 +52,12 @@ int cpio_hdr(struct backend *be, uint32_t mode, size_t datalen,
return rv;
}
-int cpio_mkdir(struct backend *be, const char *filename)
+int cpio_mkdir(struct upload_backend *be, const char *filename)
{
return cpio_hdr(be, MODE_DIR, 0, filename);
}
-int cpio_writefile(struct backend *be, const char *filename,
+int cpio_writefile(struct upload_backend *be, const char *filename,
const void *data, size_t len)
{
int rv;
@@ -69,7 +69,7 @@ int cpio_writefile(struct backend *be, const char *filename,
return rv;
}
-int cpio_close(struct backend *be)
+int cpio_close(struct upload_backend *be)
{
return cpio_hdr(be, 0, 0, "TRAILER!!!");
}
diff --git a/com32/sysdump/ctime.c b/com32/libupload/ctime.c
similarity index 100%
rename from com32/sysdump/ctime.c
rename to com32/libupload/ctime.c
diff --git a/com32/sysdump/ctime.h b/com32/libupload/ctime.h
similarity index 100%
rename from com32/sysdump/ctime.h
rename to com32/libupload/ctime.h
diff --git a/com32/sysdump/serial.c b/com32/libupload/serial.c
similarity index 100%
rename from com32/sysdump/serial.c
rename to com32/libupload/serial.c
diff --git a/com32/sysdump/serial.h b/com32/libupload/serial.h
similarity index 100%
rename from com32/sysdump/serial.h
rename to com32/libupload/serial.h
diff --git a/com32/sysdump/srecsend.h b/com32/libupload/srecsend.h
similarity index 100%
rename from com32/sysdump/srecsend.h
rename to com32/libupload/srecsend.h
diff --git a/com32/libupload/upload_backend.h b/com32/libupload/upload_backend.h
new file mode 100644
index 0000000..968e2c6
--- /dev/null
+++ b/com32/libupload/upload_backend.h
@@ -0,0 +1,55 @@
+#ifndef BACKEND_H
+#define BACKEND_H
+
+#include <stddef.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <zlib.h>
+#include "serial.h"
+
+/* Backend flags */
+#define BE_NEEDLEN 0x01
+
+struct upload_backend {
+ const char *name;
+ const char *helpmsg;
+ int minargs;
+
+ size_t dbytes;
+ size_t zbytes;
+ const char **argv;
+
+ uint32_t now;
+
+ int (*write)(struct upload_backend *);
+
+ z_stream zstream;
+ char *outbuf;
+ size_t alloc;
+};
+
+/* zout.c */
+int init_data(struct upload_backend *be, const char *argv[]);
+int write_data(struct upload_backend *be, const void *buf, size_t len);
+int flush_data(struct upload_backend *be);
+
+/* cpio.c */
+#define cpio_init init_data
+int cpio_hdr(struct upload_backend *be, uint32_t mode, size_t datalen,
+ const char *filename);
+int cpio_mkdir(struct upload_backend *be, const char *filename);
+int cpio_writefile(struct upload_backend *be, const char *filename,
+ const void *data, size_t len);
+int cpio_close(struct upload_backend *be);
+#define MODE_FILE 0100644
+#define MODE_DIR 0040755
+
+/* backends.c */
+struct upload_backend *get_upload_backend(const char *name);
+
+/* backends */
+extern struct upload_backend upload_tftp;
+extern struct upload_backend upload_ymodem;
+extern struct upload_backend upload_srec;
+
+#endif /* BACKEND_H */
diff --git a/com32/sysdump/be_srec.c b/com32/libupload/upload_srec.c
similarity index 91%
rename from com32/sysdump/be_srec.c
rename to com32/libupload/upload_srec.c
index fc69c88..c190713 100644
--- a/com32/sysdump/be_srec.c
+++ b/com32/libupload/upload_srec.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <inttypes.h>
#include <minmax.h>
-#include "backend.h"
+#include "upload_backend.h"
/* Write a single S-record */
static int write_srecord(unsigned int len, unsigned int alen,
@@ -43,7 +43,7 @@ static int write_srecord(unsigned int len, unsigned int alen,
return 0;
}
-static int be_srec_write(struct backend *be)
+static int upload_srec_write(struct upload_backend *be)
{
char name[33];
const char *buf;
@@ -77,9 +77,9 @@ static int be_srec_write(struct backend *be)
return 0;
}
-struct backend be_srec = {
+struct upload_backend upload_srec = {
.name = "srec",
.helpmsg = "[filename]",
.minargs = 0,
- .write = be_srec_write,
+ .write = upload_srec_write,
};
diff --git a/com32/sysdump/be_tftp.c b/com32/libupload/upload_tftp.c
similarity index 96%
rename from com32/sysdump/be_tftp.c
rename to com32/libupload/upload_tftp.c
index 36a91eb..d97cbd3 100644
--- a/com32/sysdump/be_tftp.c
+++ b/com32/libupload/upload_tftp.c
@@ -9,7 +9,7 @@
#include <netinet/in.h>
#include <sys/times.h>
-#include "backend.h"
+#include "upload_backend.h"
enum tftp_opcode {
TFTP_RRQ = 1,
@@ -107,7 +107,7 @@ done:
return err;
}
-static int be_tftp_write(struct backend *be)
+static int upload_tftp_write(struct upload_backend *be)
{
static uint16_t local_port = 0x4000;
struct tftp_state tftp;
@@ -170,9 +170,9 @@ static int be_tftp_write(struct backend *be)
return 0;
}
-struct backend be_tftp = {
+struct upload_backend upload_tftp = {
.name = "tftp",
.helpmsg = "filename [tftp_server]",
.minargs = 1,
- .write = be_tftp_write,
+ .write = upload_tftp_write,
};
diff --git a/com32/sysdump/be_ymodem.c b/com32/libupload/upload_ymodem.c
similarity index 96%
rename from com32/sysdump/be_ymodem.c
rename to com32/libupload/upload_ymodem.c
index 316b3d4..c42327d 100644
--- a/com32/sysdump/be_ymodem.c
+++ b/com32/libupload/upload_ymodem.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
-#include "backend.h"
+#include "upload_backend.h"
#include "serial.h"
enum {
@@ -98,7 +98,7 @@ static void send_ack(struct ymodem_state *ym, const uint8_t *blk, size_t bytes)
} while (ack_buf == NAK);
}
-static int be_ymodem_write(struct backend *be)
+static int upload_ymodem_write(struct upload_backend *be)
{
static const uint8_t eot_buf = EOT;
uint8_t ack_buf;
@@ -167,9 +167,9 @@ static int be_ymodem_write(struct backend *be)
return 0;
}
-struct backend be_ymodem = {
+struct upload_backend upload_ymodem = {
.name = "ymodem",
.helpmsg = "filename [port [speed]]",
.minargs = 1,
- .write = be_ymodem_write,
+ .write = upload_ymodem_write,
};
diff --git a/com32/sysdump/ymodem.txt b/com32/libupload/ymodem.txt
similarity index 100%
rename from com32/sysdump/ymodem.txt
rename to com32/libupload/ymodem.txt
diff --git a/com32/sysdump/zout.c b/com32/libupload/zout.c
similarity index 87%
rename from com32/sysdump/zout.c
rename to com32/libupload/zout.c
index ece934c..b5575a9 100644
--- a/com32/sysdump/zout.c
+++ b/com32/libupload/zout.c
@@ -8,12 +8,12 @@
#include <inttypes.h>
#include <stdbool.h>
#include <zlib.h>
-#include "backend.h"
+#include "upload_backend.h"
#include "ctime.h"
#define ALLOC_CHUNK 65536
-int init_data(struct backend *be, const char *argv[])
+int init_data(struct upload_backend *be, const char *argv[])
{
be->now = posix_time();
be->argv = argv;
@@ -33,7 +33,7 @@ int init_data(struct backend *be, const char *argv[])
return 0;
}
-static int do_deflate(struct backend *be, int flush)
+static int do_deflate(struct upload_backend *be, int flush)
{
int rv;
char *buf;
@@ -55,7 +55,7 @@ static int do_deflate(struct backend *be, int flush)
}
-int write_data(struct backend *be, const void *buf, size_t len)
+int write_data(struct upload_backend *be, const void *buf, size_t len)
{
int rv = Z_OK;
@@ -75,7 +75,7 @@ int write_data(struct backend *be, const void *buf, size_t len)
}
/* Output the data and shut down the stream */
-int flush_data(struct backend *be)
+int flush_data(struct upload_backend *be)
{
int rv = Z_OK;
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index bffee3a..b2093de 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -19,7 +19,7 @@ topdir = ../..
include ../MCONFIG
-include $(topdir)/version.mk
-LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
+LIBS = ../libutil/libutil_com.a ../lib/libcom32.a ../libupload/libcom32upload.a $(LIBGCC)
LNXLIBS = ../libutil/libutil_lnx.a
MODULES = sysdump.c32
diff --git a/com32/sysdump/acpi.c b/com32/sysdump/acpi.c
index 8671fc8..f2be4f4 100644
--- a/com32/sysdump/acpi.c
+++ b/com32/sysdump/acpi.c
@@ -18,7 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
#include "rbtree.h"
struct acpi_rsdp {
@@ -151,7 +151,7 @@ static const struct acpi_rsdp *find_rsdp(void)
return scan_for_rsdp(0xe0000, 0x100000);
}
-static void dump_table(struct backend *be,
+static void dump_table(struct upload_backend *be,
const char name[], const void *ptr, uint32_t len)
{
char namebuf[64];
@@ -171,7 +171,7 @@ static void dump_table(struct backend *be,
write_data(be, ptr, len);
}
-static void dump_rsdt(struct backend *be, const struct acpi_rsdp *rsdp)
+static void dump_rsdt(struct upload_backend *be, const struct acpi_rsdp *rsdp)
{
const struct acpi_rsdt *rsdt;
uint32_t i, n;
@@ -196,7 +196,7 @@ static void dump_rsdt(struct backend *be, const struct acpi_rsdp *rsdp)
}
}
-static void dump_xsdt(struct backend *be, const struct acpi_rsdp *rsdp)
+static void dump_xsdt(struct upload_backend *be, const struct acpi_rsdp *rsdp)
{
const struct acpi_xsdt *xsdt;
uint32_t rsdp_len = rsdp->rev > 0 ? rsdp->len : 20;
@@ -231,7 +231,7 @@ static void dump_xsdt(struct backend *be, const struct acpi_rsdp *rsdp)
}
}
-void dump_acpi(struct backend *be)
+void dump_acpi(struct upload_backend *be)
{
const struct acpi_rsdp *rsdp;
uint32_t rsdp_len;
diff --git a/com32/sysdump/backend.h b/com32/sysdump/backend.h
deleted file mode 100644
index f2b3bc2..0000000
--- a/com32/sysdump/backend.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef BACKEND_H
-#define BACKEND_H
-
-#include <stddef.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <zlib.h>
-#include "serial.h"
-
-/* Backend flags */
-#define BE_NEEDLEN 0x01
-
-struct backend {
- const char *name;
- const char *helpmsg;
- int minargs;
-
- size_t dbytes;
- size_t zbytes;
- const char **argv;
-
- uint32_t now;
-
- int (*write)(struct backend *);
-
- z_stream zstream;
- char *outbuf;
- size_t alloc;
-};
-
-/* zout.c */
-int init_data(struct backend *be, const char *argv[]);
-int write_data(struct backend *be, const void *buf, size_t len);
-int flush_data(struct backend *be);
-
-/* cpio.c */
-#define cpio_init init_data
-int cpio_hdr(struct backend *be, uint32_t mode, size_t datalen,
- const char *filename);
-int cpio_mkdir(struct backend *be, const char *filename);
-int cpio_writefile(struct backend *be, const char *filename,
- const void *data, size_t len);
-int cpio_close(struct backend *be);
-#define MODE_FILE 0100644
-#define MODE_DIR 0040755
-
-/* backends.c */
-struct backend *get_backend(const char *name);
-
-/* backends */
-extern struct backend be_tftp;
-extern struct backend be_ymodem;
-extern struct backend be_srec;
-
-#endif /* BACKEND_H */
diff --git a/com32/sysdump/cpuid.c b/com32/sysdump/cpuid.c
index 372a70d..53c54f2 100644
--- a/com32/sysdump/cpuid.c
+++ b/com32/sysdump/cpuid.c
@@ -8,7 +8,7 @@
#include <com32.h>
#include <sys/cpu.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
struct cpuid_data {
uint32_t eax, ebx, ecx, edx;
@@ -29,7 +29,7 @@ static void get_cpuid(uint32_t eax, uint32_t ecx, struct cpuid_data *data)
#define CPUID_CHUNK 128
-void dump_cpuid(struct backend *be)
+void dump_cpuid(struct upload_backend *be)
{
struct cpuid_info *buf = NULL;
int nentry, nalloc;
diff --git a/com32/sysdump/dmi.c b/com32/sysdump/dmi.c
index be4cce4..64fcffb 100644
--- a/com32/sysdump/dmi.c
+++ b/com32/sysdump/dmi.c
@@ -6,7 +6,7 @@
#include <string.h>
#include <stdlib.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
struct dmi_header {
char signature[5];
@@ -60,7 +60,7 @@ static bool is_smbios(size_t dptr)
is_old_dmi(dptr+16);
}
-static void dump_smbios(struct backend *be, size_t dptr)
+static void dump_smbios(struct upload_backend *be, size_t dptr)
{
const struct smbios_header *smb = (void *)dptr;
struct smbios_header smx = *smb;
@@ -82,7 +82,7 @@ static void dump_smbios(struct backend *be, size_t dptr)
write_data(be, (const void *)smb->dmi.tbladdr, smb->dmi.tbllen);
}
-static void dump_old_dmi(struct backend *be, size_t dptr)
+static void dump_old_dmi(struct upload_backend *be, size_t dptr)
{
const struct dmi_header *dmi = (void *)dptr;
struct fake {
@@ -108,7 +108,7 @@ static void dump_old_dmi(struct backend *be, size_t dptr)
write_data(be, (const void *)dmi->tbladdr, dmi->tbllen);
}
-void dump_dmi(struct backend *be)
+void dump_dmi(struct upload_backend *be)
{
size_t dptr;
diff --git a/com32/sysdump/main.c b/com32/sysdump/main.c
index d0d40a7..4931024 100644
--- a/com32/sysdump/main.c
+++ b/com32/sysdump/main.c
@@ -20,7 +20,7 @@
#include <console.h>
#include <sys/cpu.h>
#include "../../version.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
#include "sysdump.h"
const char program[] = "sysdump";
@@ -32,7 +32,7 @@ __noreturn die(const char *msg)
exit(1);
}
-static void dump_all(struct backend *be, const char *argv[])
+static void dump_all(struct upload_backend *be, const char *argv[])
{
cpio_init(be, argv);
@@ -50,20 +50,20 @@ static void dump_all(struct backend *be, const char *argv[])
flush_data(be);
}
-static struct backend *backends[] =
+static struct upload_backend *upload_backends[] =
{
- &be_tftp,
- &be_ymodem,
- &be_srec,
+ &upload_tftp,
+ &upload_ymodem,
+ &upload_srec,
NULL
};
__noreturn usage(void)
{
- struct backend **bep, *be;
+ struct upload_backend **bep, *be;
printf("Usage:\n");
- for (bep = backends ; (be = *bep) ; bep++)
+ for (bep = upload_backends ; (be = *bep) ; bep++)
printf(" %s %s %s\n", program, be->name, be->helpmsg);
exit(1);
@@ -71,7 +71,7 @@ __noreturn usage(void)
int main(int argc, char *argv[])
{
- struct backend **bep, *be;
+ struct upload_backend **bep, *be;
openconsole(&dev_null_r, &dev_stdcon_w);
fputs(version, stdout);
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
if (argc < 2)
usage();
- for (bep = backends ; (be = *bep) ; bep++) {
+ for (bep = upload_backends ; (be = *bep) ; bep++) {
if (!strcmp(be->name, argv[1]))
break;
}
diff --git a/com32/sysdump/memmap.c b/com32/sysdump/memmap.c
index 251107d..7a21a31 100644
--- a/com32/sysdump/memmap.c
+++ b/com32/sysdump/memmap.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <com32.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
#define E820_CHUNK 128
struct e820_info {
@@ -16,7 +16,7 @@ struct e820_info {
uint8_t data[24];
};
-static void dump_e820(struct backend *be)
+static void dump_e820(struct upload_backend *be)
{
com32sys_t ireg, oreg;
struct e820_info *curr;
@@ -63,7 +63,7 @@ static void dump_e820(struct backend *be)
lfree(curr);
}
-void dump_memory_map(struct backend *be)
+void dump_memory_map(struct upload_backend *be)
{
com32sys_t ireg, oreg;
diff --git a/com32/sysdump/memory.c b/com32/sysdump/memory.c
index 6552e7f..20b20c6 100644
--- a/com32/sysdump/memory.c
+++ b/com32/sysdump/memory.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <sys/cpu.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
static char *lowmem;
static size_t lowmem_len;
@@ -29,7 +29,7 @@ void snapshot_lowmem(void)
}
}
-static void dump_memory_range(struct backend *be, const void *where,
+static void dump_memory_range(struct upload_backend *be, const void *where,
const void *addr, size_t len)
{
char filename[32];
@@ -38,7 +38,7 @@ static void dump_memory_range(struct backend *be, const void *where,
cpio_writefile(be, filename, where, len);
}
-void dump_memory(struct backend *be)
+void dump_memory(struct upload_backend *be)
{
printf("Dumping memory... ");
diff --git a/com32/sysdump/pci.c b/com32/sysdump/pci.c
index 1d68727..7646a75 100644
--- a/com32/sysdump/pci.c
+++ b/com32/sysdump/pci.c
@@ -7,9 +7,9 @@
#include <stdlib.h>
#include <sys/pci.h>
#include "sysdump.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
-static void dump_pci_device(struct backend *be, pciaddr_t a, uint8_t hdrtype)
+static void dump_pci_device(struct upload_backend *be, pciaddr_t a, uint8_t hdrtype)
{
unsigned int bus = pci_bus(a);
unsigned int dev = pci_dev(a);
@@ -31,7 +31,7 @@ static void dump_pci_device(struct backend *be, pciaddr_t a, uint8_t hdrtype)
cpio_writefile(be, filename, data, sizeof data);
}
-void dump_pci(struct backend *be)
+void dump_pci(struct upload_backend *be)
{
int cfgtype;
unsigned int nbus, ndev, nfunc, maxfunc;
diff --git a/com32/sysdump/sysdump.h b/com32/sysdump/sysdump.h
index a5b963f..15bb899 100644
--- a/com32/sysdump/sysdump.h
+++ b/com32/sysdump/sysdump.h
@@ -1,15 +1,15 @@
#ifndef SYSDUMP_H
#define SYSDUMP_H
-struct backend;
+struct upload_backend;
-void dump_memory_map(struct backend *);
+void dump_memory_map(struct upload_backend *);
void snapshot_lowmem(void);
-void dump_memory(struct backend *);
-void dump_dmi(struct backend *);
-void dump_acpi(struct backend *);
-void dump_cpuid(struct backend *);
-void dump_pci(struct backend *);
-void dump_vesa_tables(struct backend *);
+void dump_memory(struct upload_backend *);
+void dump_dmi(struct upload_backend *);
+void dump_acpi(struct upload_backend *);
+void dump_cpuid(struct upload_backend *);
+void dump_pci(struct upload_backend *);
+void dump_vesa_tables(struct upload_backend *);
#endif /* SYSDUMP_H */
diff --git a/com32/sysdump/vesa.c b/com32/sysdump/vesa.c
index 017f9e4..aebed18 100644
--- a/com32/sysdump/vesa.c
+++ b/com32/sysdump/vesa.c
@@ -1,10 +1,10 @@
#include <string.h>
#include <stdio.h>
#include "../lib/sys/vesa/vesa.h"
-#include "backend.h"
+#include "../libupload/upload_backend.h"
#include "sysdump.h"
-void dump_vesa_tables(struct backend *be)
+void dump_vesa_tables(struct upload_backend *be)
{
com32sys_t rm;
struct vesa_info *vip;
More information about the Syslinux-commits
mailing list