1.0.27.46: Fix build on systems with "src" in the path.
[sbcl/tcr.git] / src / runtime / x86-darwin-os.h
blob20caa8ca583ff736390732c5133fa40b0e2fb4b9
1 #ifndef _X86_DARWIN_OS_H
2 #define _X86_DARWIN_OS_H
4 #include <architecture/i386/table.h>
5 #include <i386/user_ldt.h>
7 #include "darwin-os.h"
9 typedef int os_context_register_t;
11 static inline os_context_t *arch_os_get_context(void **void_context)
13 return (os_context_t *) *void_context;
16 void set_data_desc_size(data_desc_t* desc, unsigned long size);
17 void set_data_desc_addr(data_desc_t* desc, void* addr);
19 /* On OS X 10.5, the field names for the thread state have changed and
20 * now are prepended with __. Use some #define hackery to deal with
21 * this.
23 #if __DARWIN_UNIX03
25 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->__ss.__##stem
26 #define EIP __eip
27 #define ESP __esp
28 #define EBP __ebp
29 #define EAX __eax
30 #define EBX __ebx
31 #define ECX __ecx
32 #define EDX __edx
33 #define ESI __esi
34 #define EDI __edi
35 #define EFLAGS __eflags
36 #define CS __cs
37 #define DS __ds
38 #define ES __es
39 #define FS __fs
40 #define SS __ss
41 #define GS __gs
43 #else
45 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->ss.stem
46 #define EIP eip
47 #define ESP esp
48 #define EBP ebp
49 #define EAX eax
50 #define EBX ebx
51 #define ECX ecx
52 #define EDX edx
53 #define ESI esi
54 #define EDI edi
55 #define EFLAGS eflags
56 #define CS cs
57 #define DS ds
58 #define ES es
59 #define FS fs
60 #define SS ss
61 #define GS gs
63 #endif /* __DARWIN_UNIX03 */
67 #endif /* _X86_DARWIN_OS_H */