summaryrefslogtreecommitdiff
path: root/laden
diff options
context:
space:
mode:
authormarcus <marcus>2003-09-15 19:24:01 +0000
committermarcus <marcus>2003-09-15 19:24:01 +0000
commitd538236b17aa1a52aef04fa015dc74fa94f4157b (patch)
tree011de3e7738699996b139124ad3690723c73bd48 /laden
parentfe2967ebd009ce630c5ec0cfc2a7926aa0dc85d9 (diff)
Change the semantics of END of a region (to be in line with grub modules and
L4 memdescs high address) to exclude the byte with address END.
Diffstat (limited to 'laden')
-rw-r--r--laden/ia32-cmain.c8
-rw-r--r--laden/loader.c18
2 files changed, 13 insertions, 13 deletions
diff --git a/laden/ia32-cmain.c b/laden/ia32-cmain.c
index f4b95d0..d3de59a 100644
--- a/laden/ia32-cmain.c
+++ b/laden/ia32-cmain.c
@@ -331,7 +331,7 @@ find_components (void)
loader_add_region (program_name, (l4_word_t) &_start, (l4_word_t) &_end);
start = (l4_word_t) mbi;
- end = start + sizeof (*mbi) - 1;
+ end = start + sizeof (*mbi);
loader_add_region ("grub-mbi", start, end);
if (CHECK_FLAG (mbi->flags, 3) && mbi->mods_count)
@@ -344,7 +344,7 @@ find_components (void)
loader_add_region ("grub-mods", start, end);
start = (l4_word_t) mod[0].string;
- end = start;
+ end = start + 1;
for (nr = 0; nr < mbi->mods_count; nr++)
{
char *str = (char *) mod[nr].string;
@@ -355,8 +355,8 @@ find_components (void)
start = (l4_word_t) str;
while (*str)
str++;
- if (((l4_word_t) str) > end)
- end = (l4_word_t) str;
+ if (((l4_word_t) str) + 1 > end)
+ end = (l4_word_t) str + 1;
}
}
loader_add_region ("grub-mods-cmdlines", start, end);
diff --git a/laden/loader.c b/laden/loader.c
index 32a0f7e..6b35e8f 100644
--- a/laden/loader.c
+++ b/laden/loader.c
@@ -26,7 +26,7 @@
-/* Verify that the memory region START to END (inclusive) is valid. */
+/* Verify that the memory region START to END (exclusive) is valid. */
static void
mem_check (const char *name, unsigned long start, unsigned long end)
{
@@ -49,7 +49,7 @@ mem_check (const char *name, unsigned long start, unsigned long end)
{
/* Check if the region fits into conventional memory. */
if (start >= (memdesc->low << 10) && start < (memdesc->high << 10)
- && end >= (memdesc->low << 10) && end < (memdesc->high << 10))
+ && end > (memdesc->low << 10) && end <= (memdesc->high << 10))
fits = 1;
}
else
@@ -57,7 +57,7 @@ mem_check (const char *name, unsigned long start, unsigned long end)
/* Check if the region overlaps with non-conventional
memory. */
if ((start >= (memdesc->low << 10) && start < (memdesc->high << 10))
- || (end >= (memdesc->low << 10) && end < (memdesc->high << 10))
+ || (end > (memdesc->low << 10) && end <= (memdesc->high << 10))
|| (start < (memdesc->low << 10) && end > (memdesc->high << 10)))
{
conflicts = 1;
@@ -102,8 +102,8 @@ check_region (const char *name, l4_word_t start, l4_word_t end)
for (i = 0; i < nr_regions; i++)
{
if ((start >= used_regions[i].start && start < used_regions[i].end)
- || (end >= used_regions[i].start && end < used_regions[i].end)
- || (start < used_regions[i].start && end >= used_regions[i].start))
+ || (end >= used_regions[i].start && end <= used_regions[i].end)
+ || (start < used_regions[i].start && end > used_regions[i].start))
panic ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)",
name, start, end, used_regions[i].name, used_regions[i].start,
used_regions[i].end);
@@ -153,10 +153,10 @@ loader_remove_region (const char *name)
}
-/* Load the ELF image from START to END into memory under the name
- NAME (also used as the name for the region of the resulting ELF
- program). Return the lowest and highest address used by the
- program in NEW_START_P and NEW_END_P, and the entry point in
+/* Load the ELF image from START to END (exclusive) into memory under
+ the name NAME (also used as the name for the region of the
+ resulting ELF program). Return the lowest and highest address used
+ by the program in NEW_START_P and NEW_END_P, and the entry point in
ENTRY. */
void
loader_elf_load (const char *name, l4_word_t start, l4_word_t end,