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

Last change on this file since 14261 was 14206, checked in by rme, 9 years ago

Rename lisp kernel functions allocate() and deallocate() to
lisp_malloc() and lisp_free() to make it clearer that they are
kernel imports.

Use regular C library functions (malloc/calloc/free) instead of
allocate/deallocate in other lisp kernel C files.

  • 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) 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) \
104  pthread_sigmask(SIG_SETMASK, &context->uc_sigmask, NULL);
105#endif
106
107void
108Fatal(StringPtr, StringPtr);
109
110void
111non_fatal_error( char * );
112
113void Bug(ExceptionInformation *, const char *format_string, ...);
114void FBug(ExceptionInformation *, const char *format_string, ...);
115signed_natural gc_from_xp(ExceptionInformation *, signed_natural);
116signed_natural purify_from_xp(ExceptionInformation *, signed_natural);
117signed_natural impurify_from_xp(ExceptionInformation *, signed_natural);
118
119
120
121void
122adjust_exception_pc(ExceptionInformation *, int);
123
124size_t
125symbol_name( unsigned, char *, size_t );
126
127
128size_t
129exception_fn_name( ExceptionInformation *, int, char *, size_t );
130
131
132
133#ifdef PPC
134#include "ppc-exceptions.h"
135#endif
136
137#ifdef X86
138#include "x86-exceptions.h"
139#endif
140
141#ifdef ARM
142#include "arm-exceptions.h"
143#endif
144
145void suspend_other_threads(Boolean);
146void resume_other_threads(Boolean);
147
148
149#endif /* __lisp_exceptions_h__ */
150
Note: See TracBrowser for help on using the repository browser.