aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-08-13 16:45:11 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-08-13 16:45:37 +0100
commitfe084791a5e8c0985717d990d26652f416d12f15 (patch)
treecae01d8061e6f8ef224ed98beb021e20d3e9b6c1 /com32/lib/sys
parentb6b97c945d171aebc30510249a77581cd57fc8e7 (diff)
parentd1d03dee6bc961b0afd8dfc68fd35772ecded8be (diff)
downloadsyslinux-fe084791a5e8c0985717d990d26652f416d12f15.tar.gz
syslinux-fe084791a5e8c0985717d990d26652f416d12f15.tar.xz
syslinux-fe084791a5e8c0985717d990d26652f416d12f15.zip
Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmware
Conflicts: com32/lib/sys/module/common.c
Diffstat (limited to 'com32/lib/sys')
-rw-r--r--com32/lib/sys/module/common.c26
-rw-r--r--com32/lib/sys/rawcon_read.c13
2 files changed, 34 insertions, 5 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index bc058a66..dc3754c4 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -57,7 +57,7 @@ void print_elf_symbols(struct elf_module *module) {
}
#endif //ELF_DEBUG
-static FILE *findpath(char *name)
+FILE *findpath(char *name)
{
char path[FILENAME_MAX];
FILE *f;
@@ -429,6 +429,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 Elf_Sym *module_find_symbol_sysv(const char *name, struct elf_module *module) {
unsigned long h = elf_hash((const unsigned char*)name);
Elf_Word *cr_word = module->hash_table;
diff --git a/com32/lib/sys/rawcon_read.c b/com32/lib/sys/rawcon_read.c
index 7eae95f1..51bb9536 100644
--- a/com32/lib/sys/rawcon_read.c
+++ b/com32/lib/sys/rawcon_read.c
@@ -44,15 +44,16 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
{
char *bufp = buf;
size_t n = 0;
- char hi = 0;
+ static char hi = 0;
+ static bool hi_key = false;
(void)fp;
while (n < count) {
- if (hi) {
+ if (hi_key) {
*bufp++ = hi;
n++;
- hi = 0;
+ hi_key = false;
continue;
}
@@ -61,7 +62,11 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
break;
/* We have data, go get it */
- *bufp++ = getchar(&hi);
+ *bufp = getchar(&hi);
+ if (!*bufp)
+ hi_key = true;
+
+ bufp++;
n++;
}