summaryrefslogtreecommitdiff
path: root/laden
diff options
context:
space:
mode:
authorneal <neal>2007-07-26 20:48:41 +0000
committerneal <neal>2007-07-26 20:48:41 +0000
commita084d87a3692c39b8106b995705ca56a65cc0ea2 (patch)
tree624a47aaf79408ce9df8265bc525f996b9355461 /laden
parent45cb4f373b40d36664601e545dc485077cc73f83 (diff)
2007-07-26 Neal H. Walfield <neal@gnu.org>
* loader.h (loader_add_region): Take an additional parameter, the L4 descriptor type. Update callers. (loader_elf_load): Likewise. (loader_regions_reserve): New function. * loader.c: Add field desc_type. (loader_add_region): Take an additional parameter, an L4 descriptor type. Save it in the allocated descriptor. Round the start address to a page boundary. (loader_remove_region): Remove all regions with the name NAME, not just the first one. (loader_regions_reserve): New function. (loader_elf_load): Take an additional parameter, an L4 descriptor type. Mark regions that we allocate with this type. Coalesce regions where possible. * laden.h: Include <assert.h>. (add_memory_map): Improve comment. Add an assert. * ia32-cmain.c (module_relocate): Rename from this... (modules_relocate): ... to this. Handle relocating multiple modules. (find_components): When protecting module data areas, coalesce when possible. Fix an off by one error when calculating the upper memory bound. Rename the module meta data region to better reflect its nature. * kip-fixup.c (kip_fixup): Call loader_regions_reserve before copying the memory descriptors. Don't set KIP->MEMORY_INFO.NR * laden.c (load_components): Allocate a stack for sigma0 and the root server just beyond their highest address. * kip-fixup.c (kip_fixup): Only boot versions of L4 that we know how to boot. * ia32-cmain.c (find_components): Only reserve conventional memory for an X2 kernel.
Diffstat (limited to 'laden')
-rw-r--r--laden/ChangeLog38
-rw-r--r--laden/ia32-cmain.c84
-rw-r--r--laden/kip-fixup.c34
-rw-r--r--laden/laden.c28
-rw-r--r--laden/laden.h6
-rw-r--r--laden/loader.c99
-rw-r--r--laden/loader.h22
7 files changed, 251 insertions, 60 deletions
diff --git a/laden/ChangeLog b/laden/ChangeLog
index f6216c2..8285186 100644
--- a/laden/ChangeLog
+++ b/laden/ChangeLog
@@ -1,3 +1,41 @@
+2007-07-26 Neal H. Walfield <neal@gnu.org>
+
+ * loader.h (loader_add_region): Take an additional parameter, the
+ L4 descriptor type. Update callers.
+ (loader_elf_load): Likewise.
+ (loader_regions_reserve): New function.
+ * loader.c: Add field desc_type.
+ (loader_add_region): Take an additional parameter, an L4
+ descriptor type. Save it in the allocated descriptor. Round the
+ start address to a page boundary.
+ (loader_remove_region): Remove all regions with the name NAME, not
+ just the first one.
+ (loader_regions_reserve): New function.
+ (loader_elf_load): Take an additional parameter, an L4 descriptor
+ type. Mark regions that we allocate with this type. Coalesce
+ regions where possible.
+ * laden.h: Include <assert.h>.
+ (add_memory_map): Improve comment. Add an assert.
+ * ia32-cmain.c (module_relocate): Rename from this...
+ (modules_relocate): ... to this. Handle relocating multiple
+ modules.
+ (find_components): When protecting module data areas, coalesce
+ when possible. Fix an off by one error when calculating the upper
+ memory bound. Rename the module meta data region to better
+ reflect its nature.
+
+ * kip-fixup.c (kip_fixup): Call loader_regions_reserve before
+ copying the memory descriptors. Don't set KIP->MEMORY_INFO.NR
+
+ * laden.c (load_components): Allocate a stack for sigma0 and the
+ root server just beyond their highest address.
+
+ * kip-fixup.c (kip_fixup): Only boot versions of L4 that we know
+ how to boot.
+
+ * ia32-cmain.c (find_components): Only reserve conventional memory
+ for an X2 kernel.
+
2007-07-25 Neal H. Walfield <neal@gnu.org>
* laden.h (add_memory_map): Fix indentation.
diff --git a/laden/ia32-cmain.c b/laden/ia32-cmain.c
index 1207dfe..313fe76 100644
--- a/laden/ia32-cmain.c
+++ b/laden/ia32-cmain.c
@@ -49,8 +49,7 @@ start_kernel (l4_word_t ip)
see the loaded kernel code. */
__asm__ __volatile__ ("wbinvd\n");
/* Before jumping to IP, place the the address of the multiboot info
- structure in ebx and the magic number in eax. This is required
- by Fiasco (but not, e.g., Pistachio). */
+ structure in ebx and the magic number in eax. */
__asm__ __volatile__ ("jmp *%2\n"
: /* No output. */
: "a" (MULTIBOOT_BOOTLOADER_MAGIC),
@@ -219,15 +218,27 @@ cmdline_relocate (const char *name,
}
static void
-module_relocate (const char *name,
+modules_relocate (const char *name,
l4_word_t start, l4_word_t end, l4_word_t new_start,
void *cookie)
{
multiboot_info_t *mbi = (multiboot_info_t *) boot_info;
module_t *mod = (module_t *) mbi->mods_addr;
- l4_word_t i = (l4_word_t) cookie;
- mod[i].mod_start = new_start;
- mod[i].mod_end = new_start + (end - start);
+
+ /* First module in this block. */
+ l4_word_t i = ((l4_word_t) cookie) >> 16;
+ /* Number of modules. */
+ l4_word_t count = ((l4_word_t) cookie) & ((1 << 16) - 1);
+ l4_word_t offset = new_start - start;
+ while (count)
+ {
+ /* Adjust the offset. */
+ mod[i].mod_start += offset;
+ mod[i].mod_end += offset;
+
+ i ++;
+ count --;
+ }
}
/* Find the kernel, the initial servers and the other information
@@ -272,16 +283,46 @@ find_components (void)
}
/* Add the rest of the modules. */
+ /* Coalesce the modules as much as feasible (a page of
+ tolerance) to reduce the number of required memory map
+ descriptors. */
+ start = 0;
+ end = 0;
+ int count = 0;
int i;
for (i = 1; i < mbi->mods_count; i ++)
- loader_add_region ("module", mod[i].mod_start, mod[i].mod_end,
- module_relocate, (void *) (l4_word_t) i);
+ {
+ if (end == 0)
+ {
+ start = mod[i].mod_start;
+ count = 1;
+ }
+ else if (end < mod[i].mod_start
+ && mod[i].mod_start <= end + 0x1000)
+ count ++;
+ else
+ {
+ loader_add_region ("modules", start, end,
+ modules_relocate,
+ (void *) (l4_word_t) ((i << 16) | count),
+ L4_MEMDESC_BOOTLOADER);
+ start = mod[i].mod_start;
+ count = 1;
+ }
+ end = mod[i].mod_end;
+ }
+
+ if (count)
+ loader_add_region ("modules", start, end,
+ modules_relocate,
+ (void *) (l4_word_t) ((i << 16) | count),
+ L4_MEMDESC_BOOTLOADER);
}
/* Now create the memory map. */
- /* First, add the whole address space as shared memory by default to
- allow arbitrary device access. */
+ /* XXX: First (for now), add the whole address space as shared
+ memory by default to allow arbitrary device access. */
add_memory_map (0, -1, L4_MEMDESC_SHARED, 0);
/* Now add what GRUB tells us. */
@@ -330,7 +371,8 @@ find_components (void)
BIOS map. We add it here. */
add_memory_map (0xa0000, 0xf0000 - 1, L4_MEMDESC_SHARED, 0);
- /* The amount of conventional memory to be reserved for the kernel. */
+#ifdef _L4_X2
+ /* Reserve some conventional memory for the kernel. */
#define KMEM_SIZE (16 * 0x100000)
/* The upper limit for the end of the kernel memory. */
@@ -352,7 +394,7 @@ find_components (void)
&& ((uint32_t) mmap->base_addr) <= KMEM_MAX - KMEM_SIZE)
{
uint32_t high = ((uint32_t) mmap->base_addr)
- + ((uint32_t) mmap->length);
+ + ((uint32_t) mmap->length) - 1;
uint32_t low;
if (high > KMEM_MAX)
@@ -382,15 +424,16 @@ find_components (void)
add_memory_map (low, high, L4_MEMDESC_RESERVED, 0);
}
}
+#endif
- /* Now protect ourselves and the mulitboot info (at least the module
- configuration. */
+ /* Now protect ourselves and the mulitboot info. */
loader_add_region (program_name, (l4_word_t) &_start, (l4_word_t) &_end,
- NULL, NULL);
+ NULL, NULL, -1);
start = (l4_word_t) mbi;
end = start + sizeof (*mbi);
- loader_add_region ("grub-mbi", start, end, mbi_relocate, NULL);
+ loader_add_region ("grub-mbi", start, end, mbi_relocate, NULL,
+ L4_MEMDESC_BOOTLOADER);
if (CHECK_FLAG (mbi->flags, 3) && mbi->mods_count)
{
@@ -398,7 +441,9 @@ find_components (void)
start = (l4_word_t) mod;
end = ((l4_word_t) mod) + mbi->mods_count * sizeof (*mod);
- loader_add_region ("grub-mods", start, end, mods_relocate, NULL);
+ loader_add_region ("grub-mods-metadata", start, end,
+ mods_relocate, NULL,
+ L4_MEMDESC_BOOTLOADER);
l4_word_t nr;
for (nr = 0; nr < mbi->mods_count; nr++)
@@ -406,10 +451,11 @@ find_components (void)
loader_add_region ("grub-mods-cmdlines",
mod[nr].string,
mod[nr].string + strlen ((char *) mod[nr].string),
- cmdline_relocate, (void *) nr);
+ cmdline_relocate, (void *) nr,
+ L4_MEMDESC_BOOTLOADER);
}
/* Protect the first page. */
loader_add_region ("first-page", (l4_word_t) 0, (l4_word_t) 0xfff,
- NULL, NULL);
+ NULL, NULL, -1);
}
diff --git a/laden/kip-fixup.c b/laden/kip-fixup.c
index ff1b9a3..cb230ec 100644
--- a/laden/kip-fixup.c
+++ b/laden/kip-fixup.c
@@ -1,12 +1,12 @@
/* kip-fixup.c - Fixup the L4 KIP.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007 Free Software Foundation, Inc.
Written by Marcus Brinkmann.
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
+ published by the Free Software Foundation; either version 3, or (at
your option) any later version.
The GNU Hurd is distributed in the hope that it will be useful, but
@@ -46,6 +46,29 @@ kip_fixup (void)
if ((l4_word_t) kip2 < kernel.high)
panic ("More than one KIP found in kernel.\n");
+ l4_api_version_t api_version = l4_api_version_from (kip);
+ switch (api_version.version)
+ {
+#ifdef _L4_V2
+ case L4_API_VERSION_2:
+ case 0x87:
+ /* Booting a v2 kernel. */
+ debug ("Booting a v2 kernel.\n");
+ break;
+#endif
+
+#ifdef _L4_X2
+ case L4_API_VERSION_X2:
+ /* Booting an x2 kernel. */
+ debug ("Booting an x2 kernel.\n");
+ break;
+#endif
+
+ default:
+ panic ("Don't know how to boot kernel with API version %x.%x\n",
+ api_version.version, api_version.subversion);
+ }
+
/* Load the rootservers into the KIP. */
kip->sigma0 = sigma0;
kip->sigma1 = sigma1;
@@ -62,6 +85,11 @@ kip_fixup (void)
rootserver.low, rootserver.high, rootserver.ip, rootserver.sp);
/* Load the memory map into the KIP. */
+
+ /* Convert the reservations into memory maps. */
+ loader_regions_reserve ();
+
+ /* Copy the memory map descriptors into the KIP. */
if (memory_map_size > kip->memory_info.nr)
panic ("Memory map table in KIP is too small.");
@@ -69,7 +97,6 @@ kip_fixup (void)
(char *) memory_map,
sizeof (l4_memory_desc_t) * memory_map_size);
- kip->memory_info.nr = memory_map_size;
for (nr = 0; nr < memory_map_size; nr++)
debug ("Memory Map %i: Type %i/%i, Low 0x%llx, High 0x%llx\n",
nr + 1, memory_map[nr].type, memory_map[nr].subtype,
@@ -78,5 +105,4 @@ kip_fixup (void)
/* Load the boot info into the KIP. */
kip->boot_info = boot_info;
- debug ("Boot Info: 0x%x\n", boot_info);
}
diff --git a/laden/laden.c b/laden/laden.c
index 88b9874..7caf888 100644
--- a/laden/laden.c
+++ b/laden/laden.c
@@ -80,42 +80,54 @@ load_components (void)
if (!kernel.low)
panic ("No L4 kernel found");
loader_add_region ("kernel-mod", kernel.low, kernel.high,
- rootserver_relocate, &kernel);
+ rootserver_relocate, &kernel, -1);
if (!sigma0.low)
panic ("No sigma0 server found");
loader_add_region ("sigma0-mod", sigma0.low, sigma0.high,
- rootserver_relocate, &sigma0);
+ rootserver_relocate, &sigma0, -1);
if (sigma1.low)
loader_add_region ("sigma1-mod", sigma1.low, sigma1.high,
- rootserver_relocate, &sigma1);
+ rootserver_relocate, &sigma1, -1);
if (!rootserver.low)
panic ("No rootserver server found");
loader_add_region ("rootserver-mod", rootserver.low, rootserver.high,
- rootserver_relocate, &rootserver);
+ rootserver_relocate, &rootserver, -1);
/* Since we did not panic, there are no conflicts and we can now
unpack the images. */
loader_elf_load ("kernel", kernel.low, kernel.high,
- &kernel.low, &kernel.high, &kernel.ip);
+ &kernel.low, &kernel.high, &kernel.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("kernel-mod");
loader_elf_load ("sigma0", sigma0.low, sigma0.high,
- &sigma0.low, &sigma0.high, &sigma0.ip);
+ &sigma0.low, &sigma0.high, &sigma0.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("sigma0-mod");
+#ifdef _L4_V2
+ /* Use the page following the extracted image as the stack. */
+ sigma0.sp = ((sigma0.high + 0xfff) & ~0xfff) + 0x1000;
+#endif
if (sigma1.low)
{
loader_elf_load ("sigma1", sigma1.low, sigma1.high,
- &sigma1.low, &sigma1.high, &sigma1.ip);
+ &sigma1.low, &sigma1.high, &sigma1.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("sigma1-mod");
}
loader_elf_load ("rootserver", rootserver.low, rootserver.high,
- &rootserver.low, &rootserver.high, &rootserver.ip);
+ &rootserver.low, &rootserver.high, &rootserver.ip,
+ L4_MEMDESC_BOOTLOADER);
loader_remove_region ("rootserver-mod");
+#ifdef _L4_V2
+ /* Use the page following the extracted image as the stack. */
+ rootserver.sp = ((rootserver.high + 0xfff) & ~0xfff) + 0x1000;
+#endif
}
diff --git a/laden/laden.h b/laden/laden.h
index 1f9ad8c..dd0b832 100644
--- a/laden/laden.h
+++ b/laden/laden.h
@@ -23,6 +23,7 @@
#endif
#include <string.h>
+#include <assert.h>
#include <l4.h>
@@ -62,10 +63,15 @@ extern l4_word_t boot_info;
extern l4_memory_desc_t memory_map[MEMORY_MAP_MAX];
extern l4_word_t memory_map_size;
+/* START identifies the start of a region and must be 1k aligned. END
+ is the last byte of the region. END + 1 must be 1k aligned. */
#define add_memory_map(start, end, mtype, msubtype) \
({ \
if (memory_map_size == MEMORY_MAP_MAX) \
panic ("No more memory descriptor slots available.\n"); \
+ /* Make sure START and END are 1k aligned. */ \
+ assert (((start) & ((1 << 10) - 1)) == 0); \
+ assert (((end) & ((1 << 10) - 1)) == (1 << 10) - 1); \
memory_map[memory_map_size].low = (start) >> 10; \
memory_map[memory_map_size].high = (end) >> 10; \
memory_map[memory_map_size].virtual = 0; \
diff --git a/laden/loader.c b/laden/loader.c
index 5524bd9..ee8c655 100644
--- a/laden/loader.c
+++ b/laden/loader.c
@@ -112,17 +112,20 @@ static struct
/* If this descriptor is valid. */
int used;
+
+ /* What type of descriptor this is (L4_MEMDESC_RESERVED,
+ L4_MEMDESC_BOOTLOADER, etc.). If -1, added to the KIP's memory
+ descriptor table. */
+ int desc_type;
} used_regions[MAX_REGIONS];
static int nr_regions;
-/* Add the region with the name NAME from START to END to the table of
- regions to check against. Before doing that, check for overlaps
- with existing regions. */
void
loader_add_region (const char *name, l4_word_t start, l4_word_t end,
- relocate_region rr, void *cookie)
+ relocate_region rr, void *cookie,
+ int desc_type)
{
debug ("Protected Region: %s (0x%x - 0x%x)\n", name, start, end);
@@ -153,6 +156,7 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
used_regions[region].end = end;
used_regions[region].rr = rr;
used_regions[region].cookie = cookie;
+ used_regions[region].desc_type = desc_type;
used_regions[region].used = 1;
/* Check if the region overlaps with any established regions. */
@@ -188,8 +192,9 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
l4_word_t mem_low = l4_memory_desc_low (memdesc);
l4_word_t mem_high = l4_memory_desc_high (memdesc);
- printf ("memory_map: %d, %d, 0x%x-0x%x\n",
- j, memory_map[j].type, mem_low, mem_high);
+ debug ("consider memory_map: %d, %d, 0x%x-0x%x\n",
+ j, memory_map[j].type, mem_low, mem_high);
+
if (memory_map[j].type == L4_MEMDESC_CONVENTIONAL
&& mem_high - mem_low >= msize)
/* This memory map is useable and large enough. See if
@@ -222,7 +227,9 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
debug ("Can't use 0x%x, %s(0x%x-0x%x) in way\n",
ns, used_regions[k].name,
used_regions[k].start, used_regions[k].end);
- ns = used_regions[k].end + 1;
+ /* Try the page aligned after the end of this
+ region. */
+ ns = (used_regions[k].end + 1 + 0xfff) & ~0xfff;
debug ("Trying address 0x%x\n", ns);
goto restart;
}
@@ -230,10 +237,10 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
if (k == nr_regions && ns + msize - 1 <= mem_high)
/* NS is a good new start! */
{
- printf ("Moving %s(%d) from 0x%x-0x%x to 0x%x-0x%x\n",
- used_regions[i].name, i,
- used_regions[i].start, used_regions[i].end,
- ns, ns + msize - 1);
+ debug ("Moving %s(%d) from 0x%x-0x%x to 0x%x-0x%x\n",
+ used_regions[i].name, i,
+ used_regions[i].start, used_regions[i].end,
+ ns, ns + msize - 1);
memmove ((void *) ns, (void *) used_regions[i].start,
msize);
@@ -265,17 +272,35 @@ void
loader_remove_region (const char *name)
{
int i;
+ int found = 0;
for (i = 0; i < nr_regions; i++)
if (!strcmp (used_regions[i].name, name))
- break;
+ {
+ found = 1;
+ used_regions[i].used = 0;
+ }
- if (i == nr_regions)
+ if (! found)
panic ("Assertion failure: Could not find region %s for removal", name);
-
- used_regions[i].used = 0;
}
+void
+loader_regions_reserve (void)
+{
+ int i;
+ for (i = 0; i < nr_regions; i++)
+ if (used_regions[i].used && used_regions[i].desc_type != -1)
+ {
+ debug ("Reserving memory 0x%x-0x%x (%s)\n",
+ used_regions[i].start, used_regions[i].end,
+ used_regions[i].name);
+
+ add_memory_map (used_regions[i].start,
+ ((used_regions[i].end + 0x3ff) & ~0x3ff) - 1,
+ used_regions[i].desc_type, 0);
+ }
+}
/* Get the memory range to which the ELF image from START to END
(exclusive) will be loaded. NAME is used for panic messages. */
@@ -352,7 +377,7 @@ loader_elf_dest (const char *name, l4_word_t start, l4_word_t end,
void
loader_elf_load (const char *name, l4_word_t start, l4_word_t end,
l4_word_t *new_start_p, l4_word_t *new_end_p,
- l4_word_t *entry)
+ l4_word_t *entry, int desc_type)
{
l4_word_t new_start = -1;
l4_word_t new_end = 0;
@@ -395,7 +420,9 @@ loader_elf_load (const char *name, l4_word_t start, l4_word_t end,
if (elf->e_machine != elf_machine)
panic ("%s is not for this architecture", name);
- /* Determine the bounds of the extracted executable. */
+ /* Determine the bounds of the extracted executable. */
+ l4_word_t seg_start = 0;
+ l4_word_t seg_end = 0;
for (i = 0; i < elf->e_phnum; i++)
{
Elf32_Phdr *ph = (Elf32_Phdr *) (start + elf->e_phoff
@@ -405,19 +432,45 @@ loader_elf_load (const char *name, l4_word_t start, l4_word_t end,
/* FIXME: Add this as a bootloader specific memory type to L4's
memdesc list instead. */
/* Add the region. */
- loader_add_region (name, ph->p_paddr, ph->p_paddr + ph->p_memsz - 1,
- NULL, NULL);
+ if (seg_end == 0)
+ seg_start = ph->p_paddr;
+ else if (! (seg_end < ph->p_paddr
+ && ph->p_paddr <= seg_end + 0x1000))
+ /* Don't coalesce segments with more than a 4k separation. */
+ {
+ /* Protect last segment(s), rounding up the end. */
+ seg_end = ((seg_end + 1 + 0x3ff) & ~0x3ff) - 1;
+ loader_add_region (name, seg_start, seg_end, NULL, NULL,
+ desc_type);
+
+ /* Note start of new segment. */
+ seg_start = ph->p_paddr;
+ }
+ seg_end = ph->p_paddr + ph->p_memsz - 1;
+
+ if (ph->p_paddr < new_start)
+ new_start = ph->p_paddr;
+ if (ph->p_memsz + ph->p_paddr > new_end)
+ new_end = ph->p_memsz + ph->p_paddr;
+ }
+ }
+
+ if (seg_start != seg_end)
+ loader_add_region (name, seg_start, seg_end, NULL, NULL, desc_type);
+ /* Now load it. */
+ for (i = 0; i < elf->e_phnum; i++)
+ {
+ Elf32_Phdr *ph = (Elf32_Phdr *) (start + elf->e_phoff
+ + i * elf->e_phentsize);
+ if (ph->p_type == PT_LOAD)
+ {
memcpy ((char *) ph->p_paddr, (char *) start + ph->p_offset,
ph->p_filesz);
/* Initialize the rest. */
if (ph->p_memsz > ph->p_filesz)
memset ((char *) ph->p_paddr + ph->p_filesz, 0,
ph->p_memsz - ph->p_filesz);
- if (ph->p_paddr < new_start)
- new_start = ph->p_paddr;
- if (ph->p_memsz + ph->p_paddr > new_end)
- new_end = ph->p_memsz + ph->p_paddr;
}
}
diff --git a/laden/loader.h b/laden/loader.h
index 129c4ff..b600d72 100644
--- a/laden/loader.h
+++ b/laden/loader.h
@@ -48,20 +48,30 @@ typedef void (*relocate_region) (const char *name,
regions to check against. Before doing that, check for overlaps
with existing regions. If at some time an overlap is detected and
RR is not NULL, the region may be relocated. In this case RR is
- invoked providing for the possibility to update any pointers. */
+ invoked providing for the possibility to update any pointers. If
+ DESC_TYPE is not -1, then this region will be added as a memory
+ descriptor by loader_regions_reserve. */
void loader_add_region (const char *name, l4_word_t start, l4_word_t end,
- relocate_region rr, void *cookie);
+ relocate_region rr, void *cookie,
+ int desc_type);
-/* Remove the region with the name NAME from the table. */
+/* Remove the region(s) with the name NAME from the region descriptor
+ table. */
void loader_remove_region (const char *name);
+/* Setup memory descriptors corresponding to the current set of
+ reserved descriptors. Should be called once, immediately before
+ jumping into the kernel. */
+void loader_regions_reserve (void);
+
/* 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
- ENTRY. */
+ program in NEW_START_P and NEW_END_P, and the entry point in ENTRY.
+ The used regions are automatically added with the type DESC_TYPE
+ (cf., loader_add_region). */
void loader_elf_load (const char *name, l4_word_t start, l4_word_t end,
l4_word_t *new_start_p, l4_word_t *new_end_p,
- l4_word_t *entry);
+ l4_word_t *entry, int desc_type);
#endif /* _LOADER_H */