diff mbox series

[hurd,commited] hurd: Drop fmh kludge

Message ID 20210816092215.2960797-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] hurd: Drop fmh kludge | expand

Commit Message

Samuel Thibault Aug. 16, 2021, 9:22 a.m. UTC
Gnumach's 0650a4ee30e3 implements support for high bits being set in the
mask parameter of vm_map. This allows to remove the fmh kludge that was
masking away the address range by mapping a dumb area there.
---
 sysdeps/mach/hurd/dl-sysdep.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)
diff mbox series

Patch

diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 4b2072e5d5..968a58f668 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -66,37 +66,6 @@  void *_dl_random attribute_relro = NULL;
 
 struct hurd_startup_data *_dl_hurd_data;
 
-#define FMH defined(__i386__)
-#if ! FMH
-# define fmh()		((void)0)
-# define unfmh()	((void)0)
-#else
-/* XXX loser kludge for vm_map kernel bug, fixed by gnumach's 0650a4ee30e3 */
-#undef	ELF_MACHINE_USER_ADDRESS_MASK
-#define ELF_MACHINE_USER_ADDRESS_MASK	0
-static vm_address_t fmha;
-static vm_size_t fmhs;
-static void unfmh(void){
-__vm_deallocate(__mach_task_self(),fmha,fmhs);}
-static void fmh(void) {
-    error_t err;int x;vm_offset_t o;mach_port_t p;
-    vm_address_t a=0x08000000U,max=VM_MAX_ADDRESS;
-    while (!(err=__vm_region(__mach_task_self(),&a,&fmhs,&x,&x,&x,&x,&p,&o))){
-      __mach_port_deallocate(__mach_task_self(),p);
-      if (a+fmhs>=0x80000000U){
-	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);}
-  }
-/* XXX loser kludge for vm_map kernel bug */
-#endif
-
 
 ElfW(Addr)
 _dl_sysdep_start (void **start_argptr,
@@ -147,8 +116,6 @@  _dl_sysdep_start (void **start_argptr,
 	  && _dl_hurd_data->user_entry == 0)
 	_dl_hurd_data->user_entry = (vm_address_t) ENTRY_POINT;
 
-unfmh();			/* XXX */
-
 #if 0				/* XXX make this work for real someday... */
       if (_dl_hurd_data->user_entry == (vm_address_t) ENTRY_POINT)
 	/* We were invoked as a command, not as the program interpreter.
@@ -257,8 +224,6 @@  unfmh();			/* XXX */
   /* Initialize frequently used global variable.  */
   GLRO(dl_pagesize) = __getpagesize ();
 
-fmh();				/* XXX */
-
   /* See hurd/hurdstartup.c; this deals with getting information
      from the exec server and slicing up the arguments.
      Then it will call `go', above.  */