aboutsummaryrefslogtreecommitdiff
path: root/hurd/hurdfault.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-04 17:00:45 +0000
committerRoland McGrath <roland@gnu.org>1996-01-04 17:00:45 +0000
commit7974fe2117b1308a46f16ae5803c64f75303521c (patch)
tree74144df8a67fabc8cc766351fffa87baaa8c909a /hurd/hurdfault.h
parentfb8e70d6dd3a9c3a0e0d2713b5be3cbc9d7a6409 (diff)
downloadglibc-7974fe2117b1308a46f16ae5803c64f75303521c.tar
glibc-7974fe2117b1308a46f16ae5803c64f75303521c.tar.gz
glibc-7974fe2117b1308a46f16ae5803c64f75303521c.tar.bz2
glibc-7974fe2117b1308a46f16ae5803c64f75303521c.zip
Thu Jan 4 11:35:18 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/mach/hurd/setitimer.c: Code rearranged a bit to use new preemption interface. * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Use _hurdsig_catch_memory_fault. * hurd/Makefile (headers): Add hurd/sigpreempt.h. (sig): Add catch-signal. * hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Rewritten using a preempter in new interface. * hurd/hurdfault.h (_hurdsig_catch_fault): Likewise. (_hurdsig_catch_memory_fault): New macro.
Diffstat (limited to 'hurd/hurdfault.h')
-rw-r--r--hurd/hurdfault.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/hurd/hurdfault.h b/hurd/hurdfault.h
index 00ec905925..4b6aaed6ae 100644
--- a/hurd/hurdfault.h
+++ b/hurd/hurdfault.h
@@ -1,5 +1,5 @@
/* Declarations for handling faults in the signal thread.
-Copyright (C) 1994 Free Software Foundation, Inc.
+Copyright (C) 1994, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
#ifndef _HURD_FAULT_H
#define _HURD_FAULT_H
+#include <hurd/sigpreempt.h>
#include <setjmp.h>
/* Call this before code that might fault in the signal thread; SIGNO is
@@ -27,23 +28,24 @@ Cambridge, MA 02139, USA. */
returns zero the first time, and returns again nonzero if the signal
does arrive. */
-#define _hurdsig_catch_fault(signo) \
- (_hurdsig_fault_expect_signo = (signo), setjmp (_hurdsig_fault_env))
+#define _hurdsig_catch_fault(sigset, firstcode, lastcode) \
+ (_hurdsig_fault_preempter.signals = (sigset), \
+ _hurdsig_fault_preempter.first = (long int) (firstcode), \
+ _hurdsig_fault_preempter.last = (long int) (lastcode), \
+ setjmp (_hurdsig_fault_env))
/* Call this at the end of a section protected by _hurdsig_catch_fault. */
#define _hurdsig_end_catch_fault() \
- (_hurdsig_fault_expect_signo = 0)
+ (_hurdsig_fault_preempter.signals = 0)
extern jmp_buf _hurdsig_fault_env;
-extern int _hurdsig_fault_expect_signo;
+extern struct hurd_signal_preempter _hurdsig_fault_preempter;
-/* If _hurdsig_catch_fault returns nonzero, these variables
- contain information about the signal that arrived. */
+#define _hurdsig_catch_memory_fault(object) \
+ _hurdsig_catch_fault (sigmask (SIGSEGV) | sigmask (SIGBUS), \
+ (object), (object) + 1)
-extern long int _hurdsig_fault_sigcode;
-extern int _hurdsig_fault_sigerror;
-
-#endif /* hurd/fault.h */
+#endif /* hurdfault.h */