source: branches/working-0711/ccl/lisp-kernel/lisp.h @ 11089

Last change on this file since 11089 was 11089, checked in by gz, 13 years ago

Merge/bootstrap assorted low level stuff from trunk - kernel, syscall stuff, lowmem-bias, formatting tweaks, a few bug fixes included

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