summaryrefslogtreecommitdiff
path: root/hurd/hurdfault.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-02-12 10:00:30 +0000
committerRoland McGrath <roland@gnu.org>1996-02-12 10:00:30 +0000
commit63f89404026453219f74d425b0fb58a1fe59294b (patch)
tree97ee083bfba2802f54869cbe9babf3fbd3704e86 /hurd/hurdfault.c
parent808c413c9020d2c50abdb494ff224f8ec7348871 (diff)
* hurd/hurdfault.c (_hurdsig_fault_init): Set qlimit oncvs/libc-960212
FORWARD_SIGEXC to one. Uncomment setting of thread exc port, and move it to last thing.
Diffstat (limited to 'hurd/hurdfault.c')
-rw-r--r--hurd/hurdfault.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
index 2a30db085e..bb6fa9576d 100644
--- a/hurd/hurdfault.c
+++ b/hurd/hurdfault.c
@@ -113,6 +113,8 @@ _hurdsig_fault_init (void)
struct machine_thread_state state;
mach_port_t sigexc;
+ /* Allocate a port to receive signal thread exceptions.
+ We will move this receive right to the proc server. */
err = __mach_port_allocate (__mach_task_self (),
MACH_PORT_RIGHT_RECEIVE, &sigexc);
assert_perror (err);
@@ -120,16 +122,20 @@ _hurdsig_fault_init (void)
MACH_PORT_RIGHT_RECEIVE, &forward_sigexc);
assert_perror (err);
+ /* Allocate a port to receive the exception msgs forwarded
+ from the proc server. */
err = __mach_port_insert_right (__mach_task_self (), sigexc,
sigexc, MACH_MSG_TYPE_MAKE_SEND);
assert_perror (err);
-#if 0 /* XXX gdb bites */
- err = __thread_set_special_port (_hurd_msgport_thread,
- THREAD_EXCEPTION_PORT, sigexc);
-#endif
- __mach_port_deallocate (__mach_task_self (), sigexc);
+
+ /* Set the queue limit for this port to just one. The proc server will
+ notice if we ever get a second exception while one remains queued and
+ unreceived, and decide we are hopelessly buggy. */
+ err = __mach_port_set_qlimit (__mach_task_self (), forward_sigexc, 1);
assert_perror (err);
+ /* This state will be restored when we fault.
+ It runs the function above. */
memset (&state, 0, sizeof state);
MACHINE_THREAD_STATE_SET_PC (&state, faulted);
MACHINE_THREAD_STATE_SET_SP (&state, faultstack, sizeof faultstack);
@@ -143,5 +149,11 @@ _hurdsig_fault_init (void)
(natural_t *) &state,
MACHINE_THREAD_STATE_COUNT));
assert_perror (err);
+
+ /* Direct signal thread exceptions to the proc server. */
+ err = __thread_set_special_port (_hurd_msgport_thread,
+ THREAD_EXCEPTION_PORT, sigexc);
+ __mach_port_deallocate (__mach_task_self (), sigexc);
+ assert_perror (err);
}