1 #ifndef _X86_DARWIN_OS_H
2 #define _X86_DARWIN_OS_H
4 #include <architecture/i386/table.h>
5 #include <i386/user_ldt.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
25 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->__ss.__##stem
35 #define EFLAGS __eflags
43 #define FPU_FCW __fpu_fcw
47 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->ss.stem
65 #define FPU_FCW fpu_fcw
67 #endif /* __DARWIN_UNIX03 */
69 #define RESTORE_FP_CONTROL_FROM_CONTEXT
70 void os_restore_fp_control(os_context_t *context);
72 #endif /* _X86_DARWIN_OS_H */