aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/common.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-08-02 09:26:54 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-08-02 09:26:54 +0100
commit32ad2427ecda042a5eff93bae3773496ba5f44c1 (patch)
tree28c2a6723175aa0c6670c8ccd3a725b032ce1727 /com32/lib/sys/module/common.c
parent5c88d800a5d612ceb2339476c544f09410b5a454 (diff)
downloadsyslinux-32ad2427ecda042a5eff93bae3773496ba5f44c1.tar.gz
syslinux-32ad2427ecda042a5eff93bae3773496ba5f44c1.tar.xz
syslinux-32ad2427ecda042a5eff93bae3773496ba5f44c1.zip
ldlinux: Return to command prompt after loading COM32
The old COM32 loading code would drop the user at a command prompt once execution returned from the COM32 amodule. We need to replicate this because most callers of execute() don't expect it to return. This bug was noticed when loading a COM32 module from vesamenu.c32. Once execution returned from the COM32 module the display became garbled because no code exists to reinitialise the screen for VGA. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib/sys/module/common.c')
-rw-r--r--com32/lib/sys/module/common.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index 002b733a..b120bc73 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -422,6 +422,30 @@ int module_unload(struct elf_module *module) {
return _module_unload(module);
}
+struct elf_module *unload_modules_since(const char *name) {
+ struct elf_module *m, *mod, *begin = NULL;
+
+ for_each_module(mod) {
+ if (!strcmp(mod->name, name)) {
+ begin = mod;
+ break;
+ }
+ }
+
+ if (!begin)
+ return begin;
+
+ for_each_module_safe(mod, m) {
+ if (mod == begin)
+ break;
+
+ if (mod != begin)
+ module_unload(mod);
+ }
+
+ return begin;
+}
+
static Elf32_Sym *module_find_symbol_sysv(const char *name, struct elf_module *module) {
unsigned long h = elf_hash((const unsigned char*)name);
Elf32_Word *cr_word = module->hash_table;