[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PATCH: only throw away page zero when needed
From: |
Johan Rydberg |
Subject: |
PATCH: only throw away page zero when needed |
Date: |
Wed, 1 Oct 2003 23:26:46 +0200 |
Hi,
Another fix for the PowerPC port.
2003-10-01 Johan Rydberg <address@hidden>
* wortel.c (serve_bootstrap_requests): Only throw away page
zero if it list as conventinal in memory descriptors.
Index: wortel.c
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/wortel/wortel.c,v
retrieving revision 1.18
diff -u -p -r1.18 wortel.c
--- wortel.c 25 Sep 2003 00:29:14 -0000 1.18
+++ wortel.c 1 Oct 2003 21:15:35 -0000
@@ -398,6 +398,8 @@ start_components (void)
static void
serve_bootstrap_requests (void)
{
+ int i, get_page_zero = 0;
+
/* The size of the region that we are currently trying to allocate
for GET_MEM requests. If this is smaller than L4_MIN_PAGE_SIZE,
no more memory is available. */
@@ -411,9 +413,17 @@ serve_bootstrap_requests (void)
hurd_task_id_t server_task = (mod_idx < mods_count)
? l4_version (mods[mod_idx].main_thread) : 0;
- /* Allocate a single page at address 0, because we don't want to
- bother anybody with that silly page. */
- sigma0_get_fpage (l4_fpage (0, l4_min_page_size ()));
+ /* If a conventinal page with address 0 exists in the memory
+ descriptors, allocate it because we don't want to bother anybody
+ with that silly page. */
+ for (i = 0; i < loader_get_num_memory_desc (); i++)
+ {
+ l4_memory_desc_t memdesc = loader_get_memory_desc (i);
+ if (memdesc->low == 0)
+ get_page_zero = (memdesc->type == L4_MEMDESC_CONVENTIONAL);
+ }
+ if (get_page_zero)
+ sigma0_get_fpage (l4_fpage (0, l4_min_page_size ()));
do
{
- PATCH: only throw away page zero when needed,
Johan Rydberg <=