summaryrefslogtreecommitdiff
path: root/laden
diff options
context:
space:
mode:
authorneal <neal>2007-08-02 12:26:11 +0000
committerneal <neal>2007-08-02 12:26:11 +0000
commitd7e61f1c4ee9d6a362162b00008c16993ba2bf2c (patch)
treeef11686b775302582a40eeaf68d2e06ba44521c5 /laden
parente8bfcaf343f30c8f60a3b19efea0d8fe121807d7 (diff)
2007-08-02 Neal H. Walfield <neal@gnu.org>
* ia32-cmain.c (find_components): Save the correct module number. * loader.c (loader_add_region): When relocating a region, set the new start and end after calling the callback. (loader_regions_reserve): Only convert region descriptors on a V2 kernel.
Diffstat (limited to 'laden')
-rw-r--r--laden/ChangeLog10
-rw-r--r--laden/ia32-cmain.c11
-rw-r--r--laden/loader.c6
3 files changed, 23 insertions, 4 deletions
diff --git a/laden/ChangeLog b/laden/ChangeLog
index 11bc15b..1999fd5 100644
--- a/laden/ChangeLog
+++ b/laden/ChangeLog
@@ -1,3 +1,13 @@
+2007-08-02 Neal H. Walfield <neal@gnu.org>
+
+ * ia32-cmain.c (find_components): Save the correct module number.
+
+ * loader.c (loader_add_region): When relocating a region, set the
+ new start and end after calling the callback.
+
+ (loader_regions_reserve): Only convert region descriptors on a V2
+ kernel.
+
2007-07-30 Neal H. Walfield <neal@gnu.org>
* kip-fixup.c (kip_fixup): Use a symbolic name rather than a magic
diff --git a/laden/ia32-cmain.c b/laden/ia32-cmain.c
index 313fe76..fc40668 100644
--- a/laden/ia32-cmain.c
+++ b/laden/ia32-cmain.c
@@ -230,6 +230,8 @@ modules_relocate (const char *name,
/* Number of modules. */
l4_word_t count = ((l4_word_t) cookie) & ((1 << 16) - 1);
l4_word_t offset = new_start - start;
+ debug ("Moving modules %d-%d from 0x%x-0x%x to 0x%x (+0x%x)\n",
+ i, i + count, start, end, new_start, offset);
while (count)
{
/* Adjust the offset. */
@@ -288,6 +290,7 @@ find_components (void)
descriptors. */
start = 0;
end = 0;
+ int start_module = 0;
int count = 0;
int i;
for (i = 1; i < mbi->mods_count; i ++)
@@ -295,6 +298,7 @@ find_components (void)
if (end == 0)
{
start = mod[i].mod_start;
+ start_module = i;
count = 1;
}
else if (end < mod[i].mod_start
@@ -304,9 +308,11 @@ find_components (void)
{
loader_add_region ("modules", start, end,
modules_relocate,
- (void *) (l4_word_t) ((i << 16) | count),
+ (void *) (l4_word_t) ((start_module << 16)
+ | count),
L4_MEMDESC_BOOTLOADER);
start = mod[i].mod_start;
+ start_module = i;
count = 1;
}
end = mod[i].mod_end;
@@ -315,7 +321,8 @@ find_components (void)
if (count)
loader_add_region ("modules", start, end,
modules_relocate,
- (void *) (l4_word_t) ((i << 16) | count),
+ (void *) (l4_word_t) ((start_module << 16)
+ | count),
L4_MEMDESC_BOOTLOADER);
}
diff --git a/laden/loader.c b/laden/loader.c
index 757def7..b590c4d 100644
--- a/laden/loader.c
+++ b/laden/loader.c
@@ -275,12 +275,12 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
memmove ((void *) ns, (void *) used_regions[i].start,
msize);
- used_regions[i].start = ns;
- used_regions[i].end = ns + msize - 1;
used_regions[i].rr (used_regions[i].name,
used_regions[i].start,
used_regions[i].end,
ns, used_regions[i].cookie);
+ used_regions[i].start = ns;
+ used_regions[i].end = ns + msize - 1;
break;
}
}
@@ -319,6 +319,7 @@ loader_remove_region (const char *name)
void
loader_regions_reserve (void)
{
+#ifdef _L4_V2
int i;
for (i = 0; i < nr_regions; i++)
if (used_regions[i].used && used_regions[i].desc_type != -1)
@@ -333,6 +334,7 @@ loader_regions_reserve (void)
add_memory_map (start, end, used_regions[i].desc_type, 0);
}
+#endif
}
/* Get the memory range to which the ELF image from START to END