source: release/1.9/source/lisp-kernel/lisp.h @ 16083

Last change on this file since 16083 was 15470, checked in by gb, 7 years ago

Try to minimize Mach dependencies on Darwin; in particular, use POSIX
signal handling to handle exceptions (as is done on other *nix platforms.)

Use sigaltstack() on Darwin; it still seems to have problems, but at least
doesn't (usually) try to force all threads to use the same alt stack. (That
just never gets old somehow ...)

Lots of stuff removed; lots of (mostly small, mostly obvious) changes to
support the above.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 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__
19#define __lisp__
20
21/* a platform-specific header file is pre-included via -include */
22
23#ifndef LOWMEM_BIAS
24#define LOWMEM_BIAS (0)
25#endif
26
27
28#include "macros.h"
29
30
31extern int page_size, log2_page_size;
32
33static inline natural
34_align_to_power_of_2(natural n, unsigned power)
35{
36  natural align = (1<<power) -1;
37
38  return (n+align) & ~align;
39}
40
41#define align_to_power_of_2(n,p) _align_to_power_of_2(((natural)(n)),p)
42
43static inline natural
44_truncate_to_power_of_2(natural n, unsigned power)
45{
46  return n & ~((1<<power) -1);
47}
48
49#define truncate_to_power_of_2(n,p) _truncate_to_power_of_2((natural)(n),p)
50
51LispObj start_lisp(TCR*, LispObj);
52
53size_t
54ensure_stack_limit(size_t);
55
56char *
57print_lisp_object(LispObj);
58
59#include "kernel-globals.h"
60
61#define PLATFORM_WORD_SIZE_32 0
62#define PLATFORM_WORD_SIZE_64 64
63#define PLATFORM_CPU_PPC (0<<3)
64#define PLATFORM_CPU_SPARC (1<<3)
65#define PLATFORM_CPU_X86 (2<<3)
66#define PLATFORM_CPU_ARM (3<<3)
67#define PLATFORM_OS_VXWORKS 0
68#define PLATFORM_OS_LINUX 1
69#define PLATFORM_OS_SOLARIS 2
70#define PLATFORM_OS_DARWIN 3
71#define PLATFORM_OS_FREEBSD 4
72#define PLATFORM_OS_WINDOWS 5
73#define PLATFORM_OS_ANDROID 6
74
75
76
77#define PLATFORM (PLATFORM_OS|PLATFORM_CPU|PLATFORM_WORD_SIZE)
78
79#ifdef WINDOWS
80Boolean check_for_embedded_image (wchar_t *);
81#else
82Boolean check_for_embedded_image (char *);
83#endif
84natural xStackSpace();
85void init_threads(void *, TCR *);
86
87#ifdef WINDOWS
88void wperror(char *);
89#endif
90
91void ensure_static_conses(ExceptionInformation *, TCR *,natural);
92
93#include <stdio.h>
94
95extern FILE *dbgout;
96
97#define RESERVE_FOR_LISP 1
98#define ON_ALTSTACK 2
99#define RESTART_SYSCALLS 4
100
101extern void
102install_signal_handler(int signo, void *handler, unsigned flags);
103
104extern void make_dynamic_heap_executable(void *, void *);
105extern void xMakeDataExecutable(BytePtr, natural);
106extern void lower_heap_start(BytePtr, area*);
107
108#endif /* __lisp__ */
Note: See TracBrowser for help on using the repository browser.