source: trunk/source/lisp-kernel/lisp.h @ 13279

Last change on this file since 13279 was 13279, checked in by gb, 10 years ago

Lots of changes from "purify" branch, mostly involving:

  • new memory layout, to support x86 function purification, static cons
  • fasloader changes to load/save string constants faster

Fasl version, image version changed; new binaries for all platforms soon.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 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
22
23#include "lisptypes.h"
24#ifndef LOWMEM_BIAS
25#define LOWMEM_BIAS 0
26#endif
27
28#ifdef PPC
29#include "ppc-constants.h"
30#endif
31#ifdef X86
32#include "x86-constants.h"
33#endif
34#include "macros.h"
35
36extern Boolean use_mach_exception_handling;
37
38extern int page_size, log2_page_size;
39
40static inline natural
41_align_to_power_of_2(natural n, unsigned power)
42{
43  natural align = (1<<power) -1;
44
45  return (n+align) & ~align;
46}
47
48#define align_to_power_of_2(n,p) _align_to_power_of_2(((natural)(n)),p)
49
50static inline natural
51_truncate_to_power_of_2(natural n, unsigned power)
52{
53  return n & ~((1<<power) -1);
54}
55
56#define truncate_to_power_of_2(n,p) _truncate_to_power_of_2((natural)(n),p)
57
58LispObj start_lisp(TCR*, LispObj);
59
60size_t
61ensure_stack_limit(size_t);
62
63char *
64print_lisp_object(LispObj);
65
66#include "kernel-globals.h"
67#endif
68
69#define PLATFORM_WORD_SIZE_32 0
70#define PLATFORM_WORD_SIZE_64 64
71#define PLATFORM_CPU_PPC (0<<3)
72#define PLATFORM_CPU_SPARC (1<<3)
73#define PLATFORM_CPU_X86 (2<<3)
74#define PLATFORM_OS_VXWORKS 0
75#define PLATFORM_OS_LINUX 1
76#define PLATFORM_OS_SOLARIS 2
77#define PLATFORM_OS_DARWIN 3
78#define PLATFORM_OS_FREEBSD 4
79#define PLATFORM_OS_WINDOWS 5
80
81#ifdef LINUX
82#define PLATFORM_OS PLATFORM_OS_LINUX
83#endif
84
85#ifdef DARWIN
86#define PLATFORM_OS PLATFORM_OS_DARWIN
87#endif
88
89#ifdef FREEBSD
90#define PLATFORM_OS PLATFORM_OS_FREEBSD
91#endif
92
93#ifdef SOLARIS
94#define PLATFORM_OS PLATFORM_OS_SOLARIS
95#endif
96
97#ifdef WINDOWS
98#define PLATFORM_OS PLATFORM_OS_WINDOWS
99#endif
100
101#ifdef PPC
102#define PLATFORM_CPU PLATFORM_CPU_PPC
103#endif
104
105#ifdef X86
106#define PLATFORM_CPU PLATFORM_CPU_X86
107#endif
108
109#if (WORD_SIZE == 32)
110#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_32
111#endif
112
113#if (WORD_SIZE == 64)
114#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_64
115#endif
116
117#define PLATFORM (PLATFORM_OS|PLATFORM_CPU|PLATFORM_WORD_SIZE)
118
119#ifdef WINDOWS
120Boolean check_for_embedded_image (wchar_t *);
121#else
122Boolean check_for_embedded_image (char *);
123#endif
124natural xStackSpace();
125void init_threads(void *, TCR *);
126
127#ifdef WINDOWS
128void wperror(char *);
129#endif
130
131void ensure_static_conses(ExceptionInformation *, TCR *,natural);
132
133#include <stdio.h>
134
135extern FILE *dbgout;
Note: See TracBrowser for help on using the repository browser.