From 7974fe2117b1308a46f16ae5803c64f75303521c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 4 Jan 1996 17:00:45 +0000 Subject: Thu Jan 4 11:35:18 1996 Roland McGrath * 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. --- hurd/hurdfault.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'hurd/hurdfault.h') diff --git a/hurd/hurdfault.h b/hurd/hurdfault.h index 00ec905..4b6aaed 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 #include /* 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 */ -- cgit v1.1