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

Last change on this file since 10037 was 10037, checked in by gb, 13 years ago

Darwin reg name nonsense, from trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 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
106
107
108#endif /* PPC */
109
110#ifdef X8664
111/* Broken <i386/ucontext.h> in xcode 2.4 */
112#ifndef _STRUCT_MCONTEXT64 /* A guess at what'll be defined when this is fixed */
113struct mcontext64 {
114        x86_exception_state64_t __es;
115        x86_thread_state64_t    __ss;   
116        x86_float_state64_t     __fs;
117};
118
119typedef struct mcontext64 *MCONTEXT_T;
120typedef ucontext64_t ExceptionInformation;
121#define UC_MCONTEXT(UC) UC->uc_mcontext64
122#define __rax rax
123#define __fpu_mxcsr fpu_mxcsr
124#define __fpu_xmm0 fpu_xmm0
125#define __rsp rsp
126#define __faultvaddr faultvaddr
127#define __err err
128#define __rip rip
129#define __rsi rsi
130#define __rdi rdi
131#define __rdx rdx
132#define __rcx rcx
133#define __r8 r8
134#define __rflags rflags
135#else
136typedef mcontext_t MCONTEXT_T;
137typedef ucontext_t ExceptionInformation;
138#define UC_MCONTEXT(UC) UC->uc_mcontext
139#endif /* _STRUCT_MCONTEXT64 */
140#endif /* X86_64 */
141#endif /* #ifdef DARWIN */
142
143#ifdef LINUX
144typedef struct ucontext ExceptionInformation;
145#endif
146
147#ifdef FREEBSD
148typedef struct __ucontext ExceptionInformation;
149#endif
150
151#ifdef SOLARIS
152typedef struct ucontext ExceptionInformation;
153#endif
154
155#ifdef WIN64
156typedef CONTEXT ExceptionInformation;
157#endif
158
159typedef u32_t lisp_char_code;
160
161typedef int OSStatus, OSErr;
162#define noErr ((OSErr) 0)
163typedef int Boolean;
164typedef void *LogicalAddress;
165typedef char *Ptr, *BytePtr, *StringPtr;
166typedef unsigned int UInt32;
167
168
169
170#define true 1
171#define false 0
172
173#endif /*__lisptypes__ */
Note: See TracBrowser for help on using the repository browser.