source: branches/arm/lisp-kernel/lisp-exceptions.h @ 13923

Last change on this file since 13923 was 13737, checked in by gb, 9 years ago

Get the kernel to compile/link/run on ARM Linux; remove some PPC-isms and
add some ARM-isms, though there's likely more of the latter to be done
to support exceptions/GC.

Raise subprim addresses to start at #x9000, since some distributions
set vm.mmap_min_addr to #x8000 and others act as if they do. This means
that some subprims (whose addresses are above #x10000) will be spaced 1K
apart; maybe not so bad for keyword handling/FFI/some other things.

Re-partition UUOs, so that those that require direct action from a kernel
handler are easier to distinguish from lisp-level errors.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 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
110
111Ptr
112allocate(natural);
113
114Ptr
115zalloc(natural);
116
117void
118deallocate(Ptr);
119
120
121
122void
123non_fatal_error( char * );
124
125void Bug(ExceptionInformation *, const char *format_string, ...);
126void FBug(ExceptionInformation *, const char *format_string, ...);
127signed_natural gc_from_xp(ExceptionInformation *, signed_natural);
128signed_natural purify_from_xp(ExceptionInformation *, signed_natural);
129signed_natural impurify_from_xp(ExceptionInformation *, signed_natural);
130
131
132
133void
134adjust_exception_pc(ExceptionInformation *, int);
135
136size_t
137symbol_name( unsigned, char *, size_t );
138
139
140size_t
141exception_fn_name( ExceptionInformation *, int, char *, size_t );
142
143
144
145#ifdef PPC
146#include "ppc-exceptions.h"
147#endif
148
149#ifdef X86
150#include "x86-exceptions.h"
151#endif
152
153#ifdef ARM
154#include "arm-exceptions.h"
155#endif
156
157void suspend_other_threads(Boolean);
158void resume_other_threads(Boolean);
159
160
161#endif /* __lisp_exceptions_h__ */
162
Note: See TracBrowser for help on using the repository browser.