summaryrefslogtreecommitdiff
path: root/proc/main.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-04-04 18:36:09 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-04-04 18:36:09 +0000
commit3afed5447bea8431325c74959aab4eb0659c55ec (patch)
treeb34541e40ae98867fb26b0482d562ba912696d16 /proc/main.c
parente03625d66647664d28055be13d3e625aac875542 (diff)
(main): Wire text and data segment on startup to avoid failure mode
during non-standalone pseudo-crash.
Diffstat (limited to 'proc/main.c')
-rw-r--r--proc/main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/proc/main.c b/proc/main.c
index f939518e..b3b8077f 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -1,5 +1,5 @@
/* Initialization of the proc server
- Copyright (C) 1993, 1994 Free Software Foundation
+ Copyright (C) 1993, 1994, 1995 Free Software Foundation
This file is part of the GNU Hurd.
@@ -100,6 +100,19 @@ main (int argc, char **argv, char **envp)
mach_port_deallocate (mach_task_self (), pset);
mach_port_deallocate (mach_task_self (), psetcntl);
+ {
+ extern void _start ();
+ vm_address_t text_start = (vm_address_t) &_start;
+ err = vm_wire (master_host_port, mach_task_self (),
+ (vm_address_t) text_start,
+ (vm_size_t) (&_etext - text_start),
+ VM_PROT_READ|VM_PROT_EXECUTE);
+ err = vm_wire (master_host_port, mach_task_self (),
+ (vm_address_t) &__data_start,
+ (vm_size_t) (&_edata - &__data_start),
+ VM_PROT_READ|VM_PROT_WRITE);
+ }
+
while (1)
mach_msg_server (message_demuxer, 0, request_portset);
}