source: branches/win64/lisp-kernel/lisptypes.h @ 8803

Last change on this file since 8803 was 8803, checked in by gb, 14 years ago

ExceptionInformation? typedef'ed to CONTEXT, not EXCEPTION_POINTERS.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.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 __lisptypes__
18#define __lisptypes__
19
20#include <sys/types.h>
21#define WORD_SIZE 32
22#ifdef PPC64
23#undef WORD_SIZE
24#define WORD_SIZE 64
25#endif
26#ifdef X8664
27#undef WORD_SIZE
28#define WORD_SIZE 64
29#endif
30
31
32#ifdef WIN64
33#include <windows.h>
34typedef long long s64_t;
35typedef unsigned long long u64_t;
36typedef signed long s32_t;
37typedef unsigned long u32_t;
38typedef signed short s16_t;
39typedef unsigned short u16_t;
40typedef signed char s8_t;
41typedef unsigned char u8_t;
42#else
43
44#include <stdint.h>
45
46#ifdef SOLARIS
47/* Solaris doesn't laugh and play like the other children */
48typedef int64_t s64_t;
49typedef uint64_t u64_t;
50typedef int32_t s32_t;
51typedef uint32_t u32_t;
52typedef int16_t s16_t;
53typedef uint16_t u16_t;
54typedef int8_t s8_t;
55typedef uint8_t u8_t;
56#else
57typedef int64_t s64_t;
58typedef u_int64_t u64_t;
59typedef int32_t s32_t;
60typedef u_int32_t u32_t;
61typedef int16_t s16_t;
62typedef u_int16_t u16_t;
63typedef int8_t s8_t;
64typedef u_int8_t u8_t;
65#endif
66#endif
67
68#if WORD_SIZE == 64
69typedef u64_t LispObj;
70typedef u64_t natural;
71typedef s64_t signed_natural;
72typedef u64_t unsigned_of_pointer_size;
73#else
74typedef u32_t LispObj;
75typedef u32_t natural;
76typedef s32_t signed_natural;
77typedef u32_t unsigned_of_pointer_size;
78#endif
79
80
81#ifdef DARWIN
82#include <sys/signal.h>
83#include <sys/ucontext.h>
84
85#ifdef PPC
86#if WORD_SIZE == 64
87#ifdef _STRUCT_UCONTEXT64
88typedef _STRUCT_UCONTEXT64 ExceptionInformation;
89typedef _STRUCT_MCONTEXT64 *MCONTEXT_T;
90#else /* _STRUCT_UCONTEXT64 */
91typedef struct ucontext64 ExceptionInformation;
92typedef struct mcontext64 *MCONTEXT_T;
93#endif /* _STRUCT_UCONTEXT64 */
94#define UC_MCONTEXT(UC) UC->uc_mcontext64
95#else /* WORD_SIZE */
96#ifdef _STRUCT_UCONTEXT
97typedef _STRUCT_UCONTEXT ExceptionInformation;
98typedef _STRUCT_MCONTEXT *MCONTEXT_T;
99#else
100typedef struct ucontext ExceptionInformation;
101typedef struct mcontext *MCONTEXT_T;
102#endif
103#define UC_MCONTEXT(UC) UC->uc_mcontext
104#endif /* WORD_SIZE */
105#ifndef __DARWIN_UNIX03
106#define __DARWIN_UNIX03 0
107#endif
108#if !__DARWIN_UNIX03
109#define __ss ss
110#define __es es
111#define __fs fs
112#define __vs vs
113
114#define __r0 r0
115#define __r1 r1
116#define __r3 r3
117#define __r4 r4
118#define __r5 r5
119#define __r6 r6
120#define __r13 r13
121#define __srr0 srr0
122#define __srr1 srr1
123#define __lr lr
124#define __ctr ctr
125#define __xer xer
126#define __cr cr
127#define __dsisr dsisr
128#define __dar dar
129#define __exception exception
130#define __fpscr fpscr
131#define __fpregs fpregs
132#endif
133#endif /* PPC */
134
135#ifdef X8664
136/* Broken <i386/ucontext.h> in xcode 2.4 */
137#ifndef _STRUCT_MCONTEXT64 /* A guess at what'll be defined when this is fixed */
138struct mcontext64 {
139        x86_exception_state64_t __es;
140        x86_thread_state64_t    __ss;   
141        x86_float_state64_t     __fs;
142};
143
144typedef struct mcontext64 *MCONTEXT_T;
145typedef ucontext64_t ExceptionInformation;
146#define UC_MCONTEXT(UC) UC->uc_mcontext64
147#define __rax rax
148#define __fpu_mxcsr fpu_mxcsr
149#define __fpu_xmm0 fpu_xmm0
150#define __rsp rsp
151#define __faultvaddr faultvaddr
152#define __err err
153#define __rip rip
154#define __rsi rsi
155#define __rdi rdi
156#define __rdx rdx
157#define __rcx rcx
158#define __r8 r8
159#define __rflags rflags
160#else
161typedef mcontext_t MCONTEXT_T;
162typedef ucontext_t ExceptionInformation;
163#define UC_MCONTEXT(UC) UC->uc_mcontext
164#endif /* _STRUCT_MCONTEXT64 */
165#endif /* X86_64 */
166#endif /* #ifdef DARWIN */
167
168#ifdef LINUX
169typedef struct ucontext ExceptionInformation;
170#endif
171
172#ifdef FREEBSD
173typedef struct __ucontext ExceptionInformation;
174#endif
175
176#ifdef SOLARIS
177typedef struct ucontext ExceptionInformation;
178#endif
179
180#ifdef WIN64
181typedef CONTEXT ExceptionInformation;
182#endif
183
184typedef u32_t lisp_char_code;
185
186typedef int OSStatus, OSErr;
187#define noErr ((OSErr) 0)
188typedef int Boolean;
189typedef void *LogicalAddress;
190typedef char *Ptr, *BytePtr, *StringPtr;
191typedef unsigned int UInt32;
192
193
194
195#define true 1
196#define false 0
197
198#endif /*__lisptypes__ */
Note: See TracBrowser for help on using the repository browser.