source: trunk/source/lisp-kernel/lisp-exceptions.h @ 11522

Last change on this file since 11522 was 11522, checked in by gb, 12 years ago

PPC support for FLASH-FREEZE, which is like FREEZE without forcing
GC.

Incidentally, ensure that GC-related functions (things called via
the gc_like_from_xp() mechanism) return signed_natural results, not
just ints. (I think that in most cases the return values are currently
ignored, but they shouldn't be truncated to 32 bits, just in case something
uses them.)

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