ecd75653ad7d65bef172a319d9980f6d61b35119
[projects/cmucl/cmucl.git] / src / lisp / interrupt.h
1 /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.h,v 1.11 2007/01/01 11:53:03 cshapiro Rel $ */
2
3 #ifndef _INTERRUPT_H_
4 #define _INTERRUPT_H_
5
6 #include <signal.h>
7
8 #define MAX_INTERRUPTS (4096)
9
10 extern os_context_t *lisp_interrupt_contexts[MAX_INTERRUPTS];
11
12 union interrupt_handler {
13     lispobj lisp;
14     void (*c) (HANDLER_ARGS);
15 };
16
17 extern void interrupt_init(void);
18 extern void fake_foreign_function_call(os_context_t * context);
19 extern void undo_fake_foreign_function_call(os_context_t * context);
20 extern void interrupt_handle_now(HANDLER_ARGS);
21 extern void interrupt_handle_pending(os_context_t * scp);
22 extern void interrupt_internal_error(HANDLER_ARGS, boolean continuable);
23 extern boolean interrupt_maybe_gc(HANDLER_ARGS);
24 extern void interrupt_install_low_level_handler
25
26     (int signal, void handler(HANDLER_ARGS));
27 extern unsigned long install_handler(int signal, void handler(HANDLER_ARGS));
28
29 extern void build_fake_control_stack_frame(os_context_t * context);
30 extern void interrupt_handle_space_overflow(lispobj error,
31
32                                             os_context_t * context);
33
34 extern union interrupt_handler interrupt_handlers[NSIG];
35
36 #ifdef hpux
37 #define BLOCKABLE (sigmask(SIGHUP) | sigmask(SIGINT) | \
38                    sigmask(SIGQUIT) | sigmask(SIGPIPE) | \
39                    sigmask(SIGALRM) | sigmask(SIGURG) | \
40                    sigmask(SIGTSTP) | sigmask(SIGCHLD) | \
41                    sigmask(SIGIO) | sigmask(SIGVTALRM) | \
42                    sigmask(SIGPROF) | sigmask(SIGWINCH) | \
43                    sigmask(SIGUSR1) | sigmask(SIGUSR2))
44 #else
45 #define FILLBLOCKSET(s) (sigaddset(s,SIGHUP), sigaddset(s,SIGINT), \
46                    sigaddset(s,SIGQUIT), sigaddset(s,SIGPIPE), \
47                    sigaddset(s,SIGALRM), sigaddset(s,SIGURG), \
48                    sigaddset(s,SIGTSTP), sigaddset(s,SIGCHLD), \
49                    sigaddset(s,SIGIO), sigaddset(s,SIGXCPU), \
50                    sigaddset(s,SIGXFSZ), sigaddset(s,SIGVTALRM), \
51                    sigaddset(s,SIGPROF), sigaddset(s,SIGWINCH), \
52                    sigaddset(s,SIGUSR1), sigaddset(s,SIGUSR2))
53 #endif
54
55 #endif /* _INTERRUPT_H_ */