source: release/1.7/source/lisp-kernel/lisp-exceptions.h @ 15267

Last change on this file since 15267 was 14549, checked in by gb, 8 years ago

Android wants to pretend that Linux only supports 32 traditional
signals (and doesn't support RT signals.) Use traditional (non-RT)
signal numbers for CCL (so no #$SIGUSR2 for user code.)

That's bad enough, but they define #_pthread_sigmask in terms
of #_rt_sigprocmask, and get it wrong: #_pthread_sigmask always
fails. It's possible to waste lots of time tracking this down,
but it's been known for a long time:

<http://markmail.org/message/s657k4ogn7qtqghp#query:+page:1+mid:s657k4ogn7qtqghp+state:results>

Sadly, poor little Google can't afford to hire people who know
what they're doing.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/*
2   Copyright (C) 2009 Clozure Associates
3   Copyright (C) 1994-2001 Digitool, Inc
4   This file is part of Clozure CL. 
5
6   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
7   License , known as the LLGPL and distributed with Clozure CL as the
8   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9   which is distributed with Clozure CL as the file "LGPL".  Where these
10   conflict, the preamble takes precedence. 
11
12   Clozure CL is referenced in the preamble as the "LIBRARY."
13
14   The LLGPL is also available online at
15   http://opensource.franz.com/preamble.html
16*/
17
18#ifndef __lisp_exceptions_h__
19#define __lisp_exceptions_h__ 1
20
21
22#include <stdlib.h>
23#include "memprotect.h"
24#include "gc.h"
25
26#ifdef WINDOWS
27#include <windows.h>
28#endif
29
30typedef enum {
31  kDebugger,
32  kContinue,
33  kExit
34} ErrAction;
35
36
37#ifdef WINDOWS
38typedef EXCEPTION_RECORD siginfo_t;  /* Not even close to being the right thing to do */
39#endif
40
41
42void
43zero_page(BytePtr);
44
45void
46zero_heap_segment(BytePtr);
47
48extern protected_area_ptr AllProtectedAreas;
49
50protected_area_ptr find_protected_area(BytePtr);
51
52OSStatus
53lisp_Debugger(ExceptionInformation *, siginfo_t *, int, Boolean, char *, ...);
54
55OSStatus
56handle_protection_violation(ExceptionInformation *, siginfo_t *, TCR *, int);
57
58protected_area_ptr
59new_protected_area(BytePtr, BytePtr, lisp_protection_kind, natural, Boolean);
60
61void
62unprotect_area_prefix(protected_area_ptr, size_t);
63
64void
65protect_area_prefix(protected_area_ptr, size_t);
66
67void
68protect_area(protected_area_ptr);
69
70
71Boolean
72resize_dynamic_heap(BytePtr, natural);
73
74OSStatus
75PMCL_exception_handler(int, ExceptionInformation *, TCR *, siginfo_t *, int);
76
77TCR*
78get_tcr(Boolean);
79
80ErrAction
81error_action( void );
82
83void
84install_pmcl_exception_handlers(void);
85
86void
87unprotect_all_areas(void);
88
89void
90exception_cleanup(void);
91
92void
93exception_init();
94
95
96#define debug_entry_exception 0
97#define debug_entry_bug -1
98#define debug_entry_dbg -2
99
100#ifdef WINDOWS
101#define ALLOW_EXCEPTIONS(context) // blank stare for now
102#else
103#define ALLOW_EXCEPTIONS(context) \
104pthread_sigmask(SIG_SETMASK, (sigset_t *)(&context->uc_sigmask), NULL);
105#endif
106
107void
108Fatal(StringPtr, StringPtr);
109
110void fatal_oserr(StringPtr, OSErr);
111
112void
113non_fatal_error( char * );
114
115void Bug(ExceptionInformation *, const char *format_string, ...);
116void FBug(ExceptionInformation *, const char *format_string, ...);
117signed_natural gc_from_xp(ExceptionInformation *, signed_natural);
118signed_natural purify_from_xp(ExceptionInformation *, signed_natural);
119signed_natural impurify_from_xp(ExceptionInformation *, signed_natural);
120
121
122
123void
124adjust_exception_pc(ExceptionInformation *, int);
125
126size_t
127symbol_name( unsigned, char *, size_t );
128
129
130size_t
131exception_fn_name( ExceptionInformation *, int, char *, size_t );
132
133
134
135#ifdef PPC
136#include "ppc-exceptions.h"
137#endif
138
139#ifdef X86
140#include "x86-exceptions.h"
141#endif
142
143#ifdef ARM
144#include "arm-exceptions.h"
145#endif
146
147#ifdef DARWIN
148void darwin_exception_init(TCR *tcr);
149void darwin_exception_cleanup(TCR *tcr);
150#endif
151
152void thread_signal_setup(void);
153void suspend_other_threads(Boolean);
154void resume_other_threads(Boolean);
155void reset_lisp_process(ExceptionInformation *);
156void terminate_lisp(void);
157
158#endif /* __lisp_exceptions_h__ */
159
Note: See TracBrowser for help on using the repository browser.