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

Last change on this file since 9965 was 9965, checked in by gb, 12 years ago

use "natural" type, not "unsigned long".
Still more early Windows stuff from trunk.

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