diff options
-rw-r--r-- | .topdeps | 2 | ||||
-rw-r--r-- | .topmsg | 20 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 28 |
3 files changed, 28 insertions, 22 deletions
@@ -1 +1 @@ -9a869d822025be8e43b78234997b10bf0cf9d859 +baseline @@ -1,16 +1,6 @@ -Subject: Baseline for our topic branches. +From: Samuel Thibault <samuel.thibault@ens-lyon.org> +Subject: [PATCH] Allow the kernel to start earlier than VM_MAX_ADDRESS ---- - -This need not strictly be a TopGit branch, but it is for easy synchronization -between different machines. - -As the baseline is merged into the topic branches, it is forward-only. - -To advance it: - - $ echo [SHA1] > .topdeps - $ git commit -m Advance. -- .topdeps - $ tg update - ---- +VM_MAX_ADDRESS shouldn't be hardcoded in libc, the kernel should be able to +decide about it dynamically. This fixes glibc into supporting that. It's however +a bit hackish. diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index b72913d3ba..d82f3609d3 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -92,12 +92,28 @@ static void fmh(void) { max=a; break;} fmha=a+=fmhs;} if (err) assert(err==KERN_NO_SPACE); - if (!fmha)fmhs=0;else{ - fmhs=max-fmha; - err = __vm_map (__mach_task_self (), - &fmha, fmhs, 0, 0, MACH_PORT_NULL, 0, 1, - VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY); - assert_perror(err);} + if (!fmha) + fmhs=0; + else + while (1) { + fmhs=max-fmha; + if (fmhs == 0) + break; + err = __vm_map (__mach_task_self (), + &fmha, fmhs, 0, 0, MACH_PORT_NULL, 0, 1, + VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY); + if (!err) + break; + if (err != KERN_INVALID_ADDRESS && err != KERN_NO_SPACE) + assert_perror(err); + vm_address_t new_max = (max - 1) & 0xf0000000U; + if (new_max >= max) { + fmhs = 0; + fmha = 0; + break; + } + max = new_max; + } } /* XXX loser kludge for vm_map kernel bug */ #endif |