| Commit | Line | Data |
|---|---|---|
| eeab7066 RT |
1 | /* |
| 2 | ||
| 3 | This code was written as part of the CMU Common Lisp project at | |
| 4 | Carnegie Mellon University, and has been placed in the public domain. | |
| 5 | ||
| 6 | */ | |
| 62957726 | 7 | |
| 8 | #ifndef _LISP_H_ | |
| 9 | #define _LISP_H_ | |
| 10 | ||
| 62957726 | 11 | #define LowtagOf(obj) ((obj)&lowtag_Mask) |
| 62957726 | 12 | #define TypeOf(obj) ((obj)&type_Mask) |
| 13 | #define HeaderValue(obj) ((unsigned long) ((obj)>>type_Bits)) | |
| 14 | ||
| 15 | #define Pointerp(obj) ((obj) & 0x01) | |
| 16 | #define PTR(obj) ((obj)&~lowtag_Mask) | |
| 17 | ||
| 18 | #define CONS(obj) ((struct cons *)((obj)-type_ListPointer)) | |
| 19 | #define SYMBOL(obj) ((struct symbol *)((obj)-type_OtherPointer)) | |
| 20 | #define FDEFN(obj) ((struct fdefn *)((obj)-type_OtherPointer)) | |
| 21 | ||
| 5ced0fdf | 22 | #if !defined alpha |
| 62957726 | 23 | typedef unsigned long lispobj; |
| 5ced0fdf | 24 | |
| 4ea11535 | 25 | #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__linux__) |
| 5ced0fdf | 26 | typedef unsigned int u32; |
| 27 | typedef signed int s32; | |
| 28 | #endif | |
| 29 | ||
| 6f4a04e5 | 30 | #else |
| 31 | typedef unsigned int u32; | |
| 32 | typedef signed int s32; | |
| 33 | typedef u32 lispobj; | |
| 34 | #endif | |
| 62957726 | 35 | |
| 306a1dda | 36 | #define make_fixnum(n) ((lispobj)((n)<<(lowtag_Bits-1))) |
| 37 | #define fixnum_value(n) (((long)n)>>(lowtag_Bits-1)) | |
| 62957726 | 38 | |
| 39 | #define boolean int | |
| 40 | #ifndef TRUE | |
| 41 | #define TRUE 1 | |
| 42 | #endif | |
| 43 | #ifndef FALSE | |
| 44 | #define FALSE 0 | |
| 45 | #endif | |
| 46 | ||
| 47 | #define SymbolValue(sym) \ | |
| 48 | (((struct symbol *)((sym)-type_OtherPointer))->value) | |
| 49 | #define SetSymbolValue(sym,val) \ | |
| 50 | (((struct symbol *)((sym)-type_OtherPointer))->value = (val)) | |
| 51 | ||
| 52 | /* This only words for static symbols. */ | |
| 53 | #define SymbolFunction(sym) \ | |
| 54 | (((struct fdefn *)(SymbolValue(sym)-type_OtherPointer))->function) | |
| 55 | ||
| cb786538 | 56 | typedef enum {AUTO, X87, SSE2} fpu_mode_t; |
| 57 | ||
| efd9aa3b | 58 | #endif /* _LISP_H_ */ |