aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-08-11 20:45:12 +0300
committerStefan Bucur <stefan@stefan-ubumac.(none)>2009-03-15 10:10:51 +0200
commit1ed26aae0dd31768f6abc7634332eae2d5085f06 (patch)
tree5a0bf722404da3eaff1f13d9bc5a10c2c0fa6b52
parentb0205ca504b3df842e98bfd3e7b1525500596fe1 (diff)
downloadsyslinux-elf-1ed26aae0dd31768f6abc7634332eae2d5085f06.tar.gz
syslinux-elf-1ed26aae0dd31768f6abc7634332eae2d5085f06.tar.xz
syslinux-elf-1ed26aae0dd31768f6abc7634332eae2d5085f06.zip
Polished some debug messages.
-rw-r--r--com32/elflink/test_com32.c14
-rw-r--r--com32/lib/sys/module/common.c2
2 files changed, 11 insertions, 5 deletions
diff --git a/com32/elflink/test_com32.c b/com32/elflink/test_com32.c
index 639e0b33..ffdceaee 100644
--- a/com32/elflink/test_com32.c
+++ b/com32/elflink/test_com32.c
@@ -5,6 +5,8 @@
#include <sys/module.h>
+#define INFO_PRINT(fmt, args...) printf("[COM32] " fmt, ##args)
+
#define KLIBC_NAME "klibc.dyn"
#define ROOT_NAME "_root_.dyn"
@@ -55,9 +57,9 @@ int modules_com32_load(char *name) {
if (*(module->init_func) != NULL) {
res = (*(module->init_func))();
- printf("Initialization function returned: %d\n", res);
+ INFO_PRINT("Initialization function returned: %d\n", res);
} else {
- printf("No initialization function present.\n");
+ INFO_PRINT("No initialization function present.\n");
}
return res;
@@ -77,7 +79,7 @@ void modules_com32_unload(char *name) {
}
module_unload(module);
} else {
- printf("Cannot find module %s for unloading\n", full_name);
+ INFO_PRINT("Module %s is not loaded\n", full_name);
}
}
@@ -106,14 +108,20 @@ int main(int argc, char **argv) {
return 1;
}
+ INFO_PRINT("Setting up the module subsystem...\n");
+
// Initializing the module subsystem
res = modules_com32_setup();
+ INFO_PRINT("Loading all the specified modules...\n");
+
// Load the modules...
for (i = 0; i < argc; i++) {
modules_com32_load(argv[i]);
}
+ INFO_PRINT("Unloading all the specified modules...\n");
+
// ...then unload them
for (i = argc-1; i >= 0; i--) {
modules_com32_unload(argv[i]);
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index 7634cf30..7c588ef7 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -98,7 +98,6 @@ int image_read(void *buff, size_t size, struct elf_module *module) {
if (result < 1)
return -1;
- DBG_PRINT("[I/O] Read %u\n", size);
module->_cr_offset += size;
return 0;
}
@@ -117,7 +116,6 @@ int image_skip(size_t size, struct elf_module *module) {
if (result < 1)
return -1;
- DBG_PRINT("[I/O] Skipped %u\n", size);
module->_cr_offset += size;
return 0;
}